Strip LTO flags from static Lua module build#3555
Strip LTO flags from static Lua module build#3555hanxizh9910 wants to merge 3 commits intovalkey-io:unstablefrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## unstable #3555 +/- ##
============================================
- Coverage 76.35% 76.33% -0.03%
============================================
Files 159 159
Lines 80054 80054
============================================
- Hits 61125 61106 -19
- Misses 18929 18948 +19 🚀 New features to boost your workflow:
|
|
I've reverted #3546 in #3556 independently. I'll let @eifrah-aws review this. |
db7f331 to
7664381
Compare
| # engine_lua.so | ||
| $(LUA_MODULE_NAME): .make-prerequisites | ||
| $(MAKE) -C modules/lua OPTIMIZATION="$(OPTIMIZATION)" BUILD_LUA="$(BUILD_LUA)" | ||
| $(MAKE) -C modules/lua OPTIMIZATION="$(LUA_MODULE_OPTIMIZATION)" BUILD_LUA="$(BUILD_LUA)" |
There was a problem hiding this comment.
I would move this logic to the Lua makefile. (modules/lua/Makefile)
This part:
LUA_MODULE_OPTIMIZATION=$(subst -flto,,$(subst -ffat-lto-objects,,$(subst -flto=auto,,$(OPTIMIZATION))))3358bb6 to
0959311
Compare
Signed-off-by: Hanxi Zhang <hanxizh@amazon.com>
Signed-off-by: Hanxi Zhang <hanxizh@amazon.com>
Signed-off-by: Hanxi Zhang <hanxizh@amazon.com>
0959311 to
caf189a
Compare
roshkhatri
left a comment
There was a problem hiding this comment.
LGTM, this incorporates @eifrah-aws's suggestion
|
@hanxizh9910 can you share the latest test link, the one in the PR description tests the changes done in source makefile. |
@sarthakaggarwal97 Hi this is the latest test link: https://github.com/hanxizh9910/valkey/actions/runs/24913834442. I also updated the PR description |
Summary
The daily CI sanitizer jobs with clang are failing during the build step.
When the static Lua module is built with
-flto, the.ofiles containLLVM bitcode that gets archived into
libvalkeylua.a. The system linkercannot read this bitcode, causing build failures:
/usr/bin/ld: /home/runner/work/valkey/valkey/src/modules/lua/libvalkeylua.a: member /home/runner/work/valkey/valkey/src/modules/lua/libvalkeylua.a(debug_lua.o) in archive is not an objectThe previous fix (#3546) pinned clang to version 17, but this was
insufficient, the issue is not just a version mismatch but that the
system linker fundamentally cannot read LTO bitcode from
.aarchives.Example failure: https://github.com/valkey-io/valkey/actions/runs/24865821147/job/72801509768
Fix
Strip LTO flags from OPTIMIZATION in the Lua module Makefile using
overrideTested: https://github.com/hanxizh9910/valkey/actions/runs/24913834442