mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
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:
10
wmake/rules/General/Clang/link-lld-c++
Normal file
10
wmake/rules/General/Clang/link-lld-c++
Normal 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)
|
||||
10
wmake/rules/General/Clang/link-mold-c++
Normal file
10
wmake/rules/General/Clang/link-mold-c++
Normal 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)
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
Reference in New Issue
Block a user