-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
glibc: copy libgcc_s.so from .lib output if it exists #209055
glibc: copy libgcc_s.so from .lib output if it exists #209055
Conversation
@ofborg eval |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm okay with this PR minus the three lines I suggest deleting below. They defeat an important sanity check in stdenv
. Do we really need to nuke the references?
Yes, we have to do it: If we don't remove references then Currently (where we copy Ideal solution would be to get rid of |
If I'm still waiting for my |
It's not enough. We copy file already built against a different |
You're right. I was wrong about this; I get it now. Could you please mark this resolved? |
@ofborg eval |
The segfaults that ofborg is showing should get fixed by this: |
e87c7f0
to
1d93e69
Compare
|
Oh, it even breaks |
Crashes in
Looking at the crash
Current I'll try to bisect the fix to see if it's intentional and rebase against |
1d93e69
to
e420544
Compare
Even rebase against |
Otherwise copy it from the default output. The difference is visible when we build `glibc` with: - `bootstrapTools` `gcc`: ${stdenv.cc.cc.out}/lib/libgcc_s.so.1 is used - `nixpkgs` `gcc`: ${stdenv.cc.cc.lib}/lib/libgcc_s.so.1 is used Noticed when experimented with multiple `gcc` rebuilds in bootstrap. While at it killing `RUNPATH` reference to bootstrap `glibc`.
e420544
to
76f5618
Compare
Instead of force-pulling new libc's --- a/pkgs/development/libraries/glibc/default.nix
+++ b/pkgs/development/libraries/glibc/default.nix
@@ -83,7 +83,9 @@ in
cp -a ${lib.getLib stdenv.cc.cc}/lib/libgcc_s.so $out/lib/libgcc_s.so
# wipe out reference to previous libc it was built against
chmod +w $out/lib/libgcc_s.so.1
- patchelf --set-rpath $out/lib $out/lib/libgcc_s.so.1
+ # rely on default RUNPATHs of the binary and other libraries
+ # Do no force-pull wrong glibc.
+ patchelf --remove-rpath $out/lib/libgcc_s.so.1
fi
'';
It's more forgiving and should not cause more breakage, than the variant with nuked reference. |
Looks good! |
chmod +w $out/lib/libgcc_s.so.1 | ||
# rely on default RUNPATHs of the binary and other libraries | ||
# Do no force-pull wrong glibc. | ||
patchelf --remove-rpath $out/lib/libgcc_s.so.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that patchelf --remove-rpath
doesn't quite completely remove the RPATH. Unfortunately the fix won't be in the bootstrap-files. I've been using --set-rpath ""
as a workaround.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I had to slap nuke-refs
on top: #210741
The way Long term, once we have control of the |
Otherwise copy it from the default output. The difference is visible when we build
glibc
with:bootstrapTools
gcc
: ${stdenv.cc.cc.out}/lib/libgcc_s.so.1 is usednixpkgs
gcc
: ${stdenv.cc.cc.lib}/lib/libgcc_s.so.1 is usedNoticed when experimented with multiple
gcc
rebuilds in bootstrap.While at it killing
RUNPATH
reference to bootstrapglibc
. We expectlibgcc_s.so.1
to be used with currently installedglibc
anyway.Description of changes
Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)nixos/doc/manual/md-to-db.sh
to update generated release notes