Skip to content

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

Merged
andrewrk merged 7 commits into
ziglang:masterfrom
alexrp:compiler-rt-names
Dec 7, 2024
Merged

andrewrk merged 7 commits into
ziglang:masterfrom
alexrp:compiler-rt-names

Conversation

@alexrp

@alexrp alexrp commented Dec 6, 2024

Copy link
Copy Markdown
Member

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 #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 #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.
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 thread src/main.zig
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;

@andrewrk andrewrk Dec 6, 2024 •

Copy link
Copy Markdown
Member

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
@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

Development

Successfully merging this pull request may close these issues.

Unable to link RISC-V linux-gnu and linux-musl executables using zig cc and CMake unable to find Static system library 'gcc_eh'

2 participants