ENH: add optional control to use clang lld linker (#2449)

Eg,
    export WM_COMPILER=Clang130
    export WM_COMPILE_CONTROL="version=13.0 +lld"

- also support the mold linker (+mold) for clang

STYLE: report as 'link' stage instead of 'ld' in short messages
This commit is contained in:
Mark Olesen
2022-04-22 16:39:21 +02:00
parent 442c309dca
commit a27af5e369
7 changed files with 49 additions and 7 deletions

View File

@ -0,0 +1,10 @@
LINK_LIBS = $(c++DBUG)
LINKLIBSO = $(CC) $(c++FLAGS) -shared \
-fuse-ld=lld \
$(FOAM_EXTRA_LDFLAGS)
LINKEXE = $(CC) $(c++FLAGS) \
-fuse-ld=lld \
-L$(FOAM_LIBBIN)/dummy -lPstream \
$(FOAM_EXTRA_LDFLAGS)

View File

@ -0,0 +1,10 @@
LINK_LIBS = $(c++DBUG)
LINKLIBSO = $(CC) $(c++FLAGS) -shared \
-fuse-ld=mold \
$(FOAM_EXTRA_LDFLAGS)
LINKEXE = $(CC) $(c++FLAGS) \
-fuse-ld=mold \
-L$(FOAM_LIBBIN)/dummy -lPstream \
$(FOAM_EXTRA_LDFLAGS)

View File

@ -12,8 +12,17 @@ cctoo = $(Ctoo)
cpptoo = $(Ctoo)
cxxtoo = $(Ctoo)
# Linking:
ifneq (,$(findstring +gold,$(WM_COMPILE_CONTROL)))
include $(GENERAL_RULES)/Clang/link-gold-c++
else ifneq (,$(findstring +mold,$(WM_COMPILE_CONTROL)))
include $(GENERAL_RULES)/Clang/link-mold-c++
else ifneq (,$(findstring +lld,$(WM_COMPILE_CONTROL)))
include $(GENERAL_RULES)/Clang/link-lld-c++
else
include $(GENERAL_RULES)/Clang/link-c++
endif

View File

@ -12,8 +12,17 @@ cctoo = $(Ctoo)
cpptoo = $(Ctoo)
cxxtoo = $(Ctoo)
# Linking:
ifneq (,$(findstring +gold,$(WM_COMPILE_CONTROL)))
include $(GENERAL_RULES)/Clang/link-gold-c++
else ifneq (,$(findstring +mold,$(WM_COMPILE_CONTROL)))
include $(GENERAL_RULES)/Clang/link-mold-c++
else ifneq (,$(findstring +lld,$(WM_COMPILE_CONTROL)))
include $(GENERAL_RULES)/Clang/link-lld-c++
else
include $(GENERAL_RULES)/Clang/link-c++
endif