-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Broken rpath output when building Zig with Nix #18612
Comments
why are you saying those lib directories are include paths? What files are in there? |
Ah, sorry, these Let's take
Contents:
The same goes for all other |
Hmm. When I do the following on my system:
It looks to me like adding an rpath for that -L directory was the right move. I think the only confirmed regression in this issue is the missing directory that you identified above - the gcc one. I'm not convinced these other differences are problematic. |
Yes, these are lib outputs in |
|
Hmm, I see. The new implementation of Alternately, we could proceed with removing that feature entirely, as I mentioned in that PR, since the original motivation for What remains to be diagnosed is
|
Only adding required rpath entries would be perfect. |
The libstdc++.so missing from rpath issue is likely related to #18742 |
Zig somehow auto-detects Ideally, Zig should remove this heuristic or correctly setup the rpath on Nix, so that a successful build guarantees that the binary can load its libs correctly. |
I believe it does this in Line 715 in d0c06ca
(There are also other non linux parts that directly link libstdc++) Solutions include:
|
FYI I complained about this in a other issue, but IMO zig should not use the nixpkgs specific env vars at all |
is it possible to also add the path to Line 819 in fb88cfd
it's a bit hacky, but maybe something like
so that we can ensure the path to |
Since #17917, when building Zig within a Nix environment, the rpath of the resulting Zig binary is faulty/broken:
libgcc
, the lib providing the direct dependencylibstdc++.so
, is missing from rpath.This causes an error when running
zig
:Previously,
libgcc
was correctly included in rpath.Include paths from
NIX_CFLAGS_COMPILE
are present in rpath.These paths contain no shared objects and should not be present in rpath.
Examples:
Details
Zig rpath before #17917:
Zig rpath after #17917:
When the Zig src is located in
/home/user/src/zig
, the path to the nonexisting dir/home/user/src/outputs/out/lib
is added to rpath.This is probably also an error, but this was already present before #17917.
Reproduce
cc @Jan200101, @kubkon, @andrewrk
The text was updated successfully, but these errors were encountered: