Fix "string table corrupt" build error on modern Linux linkers - #155
Open
Khodesaeed wants to merge 1 commit into
Open
Fix "string table corrupt" build error on modern Linux linkers#155Khodesaeed wants to merge 1 commit into
Khodesaeed wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes a build failure on newer Linux distributions (e.g., Ubuntu 22.04, 24.04) where the linker (ld) reports that obj/bytecode.o: string table [3] is corrupt.
The Problem
The current build process uses luajit -b to generate a raw object file (.o). Modern versions of binutils have stricter requirements for the ELF string table format. The object files generated by the bundled (older) LuaJIT version are often flagged as corrupt by modern linkers.
The Solution
Instead of generating a raw object file directly, this change instructs LuaJIT to output a standard C source file. This C file is then compiled by the system's gcc, ensuring the resulting object file metadata is perfectly compatible with the host's linker.
I have also added LUA_PATH to the command to ensure luajit can find its internal modules during the build process, preventing the "unknown luaJIT command" error.
Changes