glibc, gcc: closure-size fixes for ARM targets#15867
Conversation
|
History is a bit unclean (for instance, commit "works but rebasethese changes"), but +1 for fixing cross-compilation. |
|
Yes, sorry, I will recapitulate before it's merged, reorganizing the fixes to different gcc versions into parallel rather than serial commits. Since this includes changes to the core of nixpkgs, I wanted to leave lots of time for review. I would like approval especially of removing glibc's builder.sh; it may have consequences I haven't been able to imagine. |
(excluding darwin and mingw for now)
|
The CI build is failing because of logsize/timeout. Is there any way to up these limits or at least run the same tests locally? |
|
"nox-review wip --against origin/master" |
|
cc @edolstra for the glibc parts, I suppose. Generally looks good to me; now test-building which will take some time... Also what's our policy for dropping old GCC versions? 4.5 has no in-tree users, 4.6 has only one that could be replaced with a patch. |
|
Removing the glibc builder is fine. Removing GCC 4.5 would be fine, except that it does have a in-tree user: |
|
After checking out this branch and rebasing it on master I'm having an issue with: /nix/store/g8wapfiw6y5237q3r1xwi38yqsmrvm50-binutils-2.26-armv7l-unknown-linux-gnueabi/armv7l-unknown-linux-gnueabi/bin/ld: cannot find -lcrypt
/nix/store/g8wapfiw6y5237q3r1xwi38yqsmrvm50-binutils-2.26-armv7l-unknown-linux-gnueabi/armv7l-unknown-linux-gnueabi/bin/ld: cannot find -lm
collect2: error: ld returned 1 exit status
Makefile:716: recipe for target 'busybox_unstripped' failed
make: *** [busybox_unstripped] Error 1
builder for ‘/nix/store/11kp4ysi6nxwjlvs1k0jdmg4djyczd98-busybox-1.23.2-armv7l-unknown-linux-gnueabi.drv’ failed with exit code 2
error: build of ‘/nix/store/11kp4ysi6nxwjlvs1k0jdmg4djyczd98-busybox-1.23.2-armv7l-unknown-linux-gnueabi.drv’ failed |
|
Yes, that is still left broken. I have a branch (based on this) to make it work and will apply it at the same time as this (as both touch mass-rebuild packages) once I've cleaned it up a little. |
... needed after closure-size merge (#7701)
The evaluation problem happened in while checking find-tarballs.nix http://hydra.nixos.org/build/36754203/nixlog/1/raw (it didn't seem worth digging into why exactly)
|
i think this PR has caused glibc to depend on the bootstrap tools at runtime, testing further |
|
In any case, the dependency is there now, which is rather bad. I'm sorry I haven't checked better. |
The main output started to retain dependency on bootstrap-tools; see #15867 (comment) This reverts commit c05d829, reversing changes made to f073df6.
|
Thanks for finding and reporting. I reverted the last staging merge to quickly avoid it for now; fixing can be done on staging later. |
|
Sorry, I missed the question on gnat45. If we drop gnat, we would not be able to build any ghdl, which I do use a lot. I have not tried to update gnat45 because it has been working fine until now and I have very limited Ada knowledge. |
|
e8ca9dc is the culprit. I don't yet understand why exactly. |
|
fwiw, you need to call the strip specific for the objects architecture. Applying x86_64 strip to arm objects breaks them. |
|
I meant I can't see why the auto-stripping doesn't strip those files; it's possible some fixes inside #15339 would make it apply. Anyway, I suppose for now I'd simply go for: diff --git a/pkgs/development/libraries/glibc/default.nix b/pkgs/development/libraries/glibc/default.nix
index 0ea6b4b..2a1652a 100644
--- a/pkgs/development/libraries/glibc/default.nix
+++ b/pkgs/development/libraries/glibc/default.nix
@@ -72,6 +72,14 @@ in
# Get rid of more unnecessary stuff.
rm -rf $out/var $out/sbin/sln
+ # For some reason these aren't stripped otherwise and retain reference
+ # to bootstrap-tools; on cross-arm this stripping would break objects.
+ if [ -z "$crossConfig" ]; then
+ for i in "$out"/lib/*.a; do
+ strip -S "$i"
+ done
+ fi
+
# Put libraries for static linking in a separate output. Note
# that libc_nonshared.a and libpthread_nonshared.a are required
# for dynamically-linked applications. |
|
i was also surprised this was even possible, the stdenv had code to prevent this but now i see it was disabled |
|
The problem there is that |
|
i see, and the comment explains why that safety is no longer doing its job |
Taken from https://pastebin.com/my8gcybx given to me on IRC.
gcc-4.8: fixup cross compilation after merging #15867 for 18.09
The main output started to retain dependency on bootstrap-tools; see NixOS/nixpkgs#15867 (comment) This reverts commit c05d8295988697adbb920a7b4a999ae3670c5504, reversing changes made to f073df60d60444c30c49cb26d6b187a4100b41fe.
Cross compiling to arm and most of every other target was broken by the closure-size merge.
Here're fixes for ARMv5 and 7, tested on a some packages from the small set that are actually cross-compilable to begin with.
I also disposed of builder.sh for glibc, as its only contents were a couple of hooks that I just moved into nix. I did this so that the cross/native differentiation was a bit cleaner.