File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -141,12 +141,6 @@ FINAL_LDFLAGS=$(LDFLAGS) $(OPT) $(SERVER_LDFLAGS) $(DEBUG)
141141FINAL_LIBS =-lm
142142DEBUG =-g -ggdb
143143
144- # Use lld when linking with clang to avoid LLVM version mismatches
145- # between clang and the system's gold plugin during LTO.
146- ifeq (clang,$(CLANG ) )
147- FINAL_LDFLAGS+=-fuse-ld=lld
148- endif
149-
150144# Linux ARM32 needs -latomic at linking time
151145ifneq (,$(findstring armv,$(uname_M ) ) )
152146 FINAL_LIBS+ =-latomic
@@ -740,9 +734,14 @@ $(TLS_MODULE_NAME): $(SERVER_NAME)
740734$(RDMA_MODULE_NAME ) : $(SERVER_NAME )
741735 $(QUIET_CC )$(CC ) $(LDFLAGS ) -o $@ rdma.c -shared -fPIC $(RDMA_MODULE_CFLAGS )
742736
737+ # Strip -flto from OPTIMIZATION for the static Lua module build.
738+ # When archiving into a .a, LTO bitcode objects cause linker failures
739+ # if the system's LLVM gold plugin version doesn't match clang's version.
740+ LUA_MODULE_OPTIMIZATION =$(subst -flto,,$(OPTIMIZATION ) )
741+
743742# engine_lua.so
744743$(LUA_MODULE_NAME ) : .make-prerequisites
745- $(MAKE ) -C modules/lua OPTIMIZATION=" $( OPTIMIZATION ) " BUILD_LUA=" $( BUILD_LUA) "
744+ $(MAKE ) -C modules/lua OPTIMIZATION=" $( LUA_MODULE_OPTIMIZATION ) " BUILD_LUA=" $( BUILD_LUA) "
746745
747746# valkey-cli
748747$(ENGINE_CLI_NAME ) : $(ENGINE_CLI_OBJ )
Original file line number Diff line number Diff line change @@ -32,8 +32,6 @@ QUIET_LINK_MOD = @printf ' %b %b\n' $(LINKCOLOR_MOD)LINK$(RESET) $(BINCOLOR_M
3232endif
3333ifeq (clang,$(CLANG ) )
3434 SHOBJ_LDFLAGS+= -fuse-ld=lld
35- # Use llvm-ar for LTO bitcode compatibility when archiving with clang.
36- AR=llvm-ar
3735endif
3836
3937endif
You can’t perform that action at this time.
0 commit comments