Skip to content

Commit

Permalink
config: add extras for lld and mold
Browse files Browse the repository at this point in the history
  • Loading branch information
riptl authored and ripatel-fd committed Nov 16, 2024
1 parent 10ce8cd commit 82822e4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions config/extra/with-lld.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
LDFLAGS+=-fuse-ld=lld
16 changes: 16 additions & 0 deletions config/extra/with-mold.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Switches linker to 'mold'
# https://github.com/rui314/mold
#
# This linker is usually much faster than the default linker when working
# with large binaries (Rust projects, fdctl, etc.)

MOLD_LDFLAGS=-fuse-ld=mold

ifdef FD_USING_GCC
ifeq ($(shell test $(FD_COMPILER_MAJOR_VERSION) -lt 12 && echo 1),1)
# Old GCC versions don't recognize mold
MOLD_LDFLAGS=-B$(shell which mold)
endif
endif

LDFLAGS+=$(MOLD_LDFLAGS)

0 comments on commit 82822e4

Please sign in to comment.