Skip to content

gen_stubs: No compiler-rt hacks, more compact output, and more arch support#22049

Merged
andrewrk merged 7 commits intoziglang:masterfrom
alexrp:musl-gen-stubs
Nov 24, 2024
Merged

gen_stubs: No compiler-rt hacks, more compact output, and more arch support#22049
andrewrk merged 7 commits intoziglang:masterfrom
alexrp:musl-gen-stubs

Conversation

@alexrp
Copy link
Member

@alexrp alexrp commented Nov 23, 2024

Resurrection of #20943. See commit messages for details.

Fixes musl libc.so compilation with zig cc.
The tool will now skip over undefined symbols. These can only occur as a result
of building musl without compiler-rt, i.e. -rtlib=none. Thanks to this, it's no
longer necessary to patch Zig's compiler-rt, nor is it necessary to maintain a
symbol blacklist.

See the updated instructions here: https://github.com/ziglang/zig/wiki/Updating-libc#updating-the-libcs-file

Additionally, the tool now produces slightly more compact output by recognizing
symbols that are defined for a single arch, for a family of arches, or only for
arches using 32-bit or 64-bit time as their primary ABI.

Finally, the tool now supports all architectures that we can emit code for, with
the single exception of x86_64-linux-muslx32. (x32 currently fails with a ton of
relocation errors, leading me to believe that it might be an LLVM or LLD bug.)
Also adjust ARCH_* logic for the updated gen_stubs.zig tool.
All supported architectures included except for x32 (currently broken).
@alexrp alexrp requested a review from andrewrk November 23, 2024 02:11
@alexrp
Copy link
Member Author

alexrp commented Nov 23, 2024

@andrewrk this makes some major changes to gen_stubs.zig so you may want to review this one.

@andrewrk
Copy link
Member

Great work!

@andrewrk andrewrk merged commit ed8955c into ziglang:master Nov 24, 2024
@alexrp alexrp deleted the musl-gen-stubs branch November 24, 2024 05:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants