Skip to content

Commit 7de2644

Browse files
authored
Merge pull request #176 from hanxizh9910/fix-clang-lto-linker-mismatch
Fix clang LTO build failure due to LLVM version mismatch
2 parents 3674c03 + 5d3df81 commit 7de2644

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -734,10 +734,10 @@ $(TLS_MODULE_NAME): $(SERVER_NAME)
734734
$(RDMA_MODULE_NAME): $(SERVER_NAME)
735735
$(QUIET_CC)$(CC) $(LDFLAGS) -o $@ rdma.c -shared -fPIC $(RDMA_MODULE_CFLAGS)
736736

737-
# Strip -flto from OPTIMIZATION for the static Lua module build.
737+
# Strip LTO flags from OPTIMIZATION for the static Lua module build.
738738
# When archiving into a .a, LTO bitcode objects cause linker failures
739739
# if the system's LLVM gold plugin version doesn't match clang's version.
740-
LUA_MODULE_OPTIMIZATION=$(subst -flto,,$(OPTIMIZATION))
740+
LUA_MODULE_OPTIMIZATION=$(subst -flto,,$(subst -ffat-lto-objects,,$(subst -flto=auto,,$(OPTIMIZATION))))
741741

742742
# engine_lua.so
743743
$(LUA_MODULE_NAME): .make-prerequisites

0 commit comments

Comments
 (0)