glibc: copy libgcc_s.so from .lib output if it exists#209055
glibc: copy libgcc_s.so from .lib output if it exists#209055trofi merged 1 commit intoNixOS:stagingfrom
Conversation
|
@ofborg eval |
ghost
left a comment
There was a problem hiding this comment.
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.
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.
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
glibcwith:bootstrapToolsgcc: ${stdenv.cc.cc.out}/lib/libgcc_s.so.1 is usednixpkgsgcc: ${stdenv.cc.cc.lib}/lib/libgcc_s.so.1 is usedNoticed when experimented with multiple
gccrebuilds in bootstrap.While at it killing
RUNPATHreference to bootstrapglibc. We expectlibgcc_s.so.1to be used with currently installedglibcanyway.Description of changes
Things done
sandbox = trueset 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.shto update generated release notes