Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compiler: Classify various compiler-rt and libunwind names accurately and satisfy them #22167

Merged
merged 7 commits into from
Dec 7, 2024

Conversation

alexrp
Copy link
Member

@alexrp alexrp commented Dec 6, 2024

Closes #17268.
Closes #22165.

This is a library that ships with GCC and provides fallback implementations of
atomic intrinsics where necessary. Since we do the same in our compiler-rt
implementation, and since some build systems insist on passing -latomic even
for Clang (which zig cc masquerades as), just satisfy this dependency by way of
compiler-rt.

Closes ziglang#22165.
@alexrp alexrp requested a review from andrewrk December 6, 2024 13:53
The real libgcc_s is a compiler-provided library; it works just fine with both
glibc and musl. There's no reason that I can see for this check to be limited to
glibc-based targets.
This is GCC's take on libunwind. We can satisfy it by way of our bundled LLVM
libunwind implementation.

Closes ziglang#17268.
This is GCC's equivalent to compiler-rt. The two libraries have a huge overlap
in exported symbols, so we may as well satisfy it this way to increase
compatibility with build systems in the wild.
* This warning's wording is actually inaccurate when using the -fno-compiler-rt
  or -rtlib=none options.
* It's not all that helpful; it's already understood that these libraries are
  part of the compiler, so printing a warning is just noise. In practice, this
  warning would always happen when building upstream musl, for example.
* We don't warn when we satisfy -lunwind using our bundled libunwind either, or
  various libc libraries using our bundled libc, or when providing libc++, etc.
  So I really don't think we should be warning here either.
@alexrp alexrp force-pushed the compiler-rt-names branch from 22a1f5f to da794ec Compare December 6, 2024 13:57
This is, roughly, GCC's equivalent of libc++abi.
This is a GCC library providing symbols with stack smashing protection. We
provide (most of) these symbols in our compiler-rt.
Comment on lines -3842 to -3843
warn("ignoring superfluous library '{s}': this dependency is fulfilled instead by compiler-rt which zig unconditionally provides", .{lib_name});
continue;
Copy link
Member

@andrewrk andrewrk Dec 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this gone now?

edit: nvm I see you addressed it in the commit message.

@andrewrk andrewrk merged commit eb9c9a3 into ziglang:master Dec 7, 2024
10 checks passed
@alexrp alexrp deleted the compiler-rt-names branch December 7, 2024 11:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants