Skip to content
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

[WIP] gcc: put target-specific libs in lib output #58606

Closed

Conversation

illegalprime
Copy link
Member

@illegalprime illegalprime commented Mar 31, 2019

Motivation for this change

this attempts to solve #58501 and doesn't handle lib64 yet.
so far this seems like the right approach, building a cross package will have less contamination:

nix build -f . pkgsCross.armv7l-hf-multiplatform.gmp
nix-store -q --tree result

outputs:

/nix/store/ag3f3skkh5jpgj66nvifzldk6b587s2g-gmp-6.1.2-armv7l-unknown-linux-gnueabihf
+---/nix/store/9vx22lxyflvh32bnl3abfp9nz49bq3qy-glibc-2.27-armv7l-unknown-linux-gnueabihf
|   +---/nix/store/1318v60073q1lhhwai2156gkymb2yd99-linux-headers-4.19.16
|   +---/nix/store/fgv5srabn8dc3c4q9a564whzbxssacwh-armv7l-unknown-linux-gnueabihf-stage-static-gcc-debug-7.4.0
|   |   +---/nix/store/qnpbfbj9skc060v1m4f91rbiqz1r51wf-glibc-2.27
|   |   |   +---/nix/store/qnpbfbj9skc060v1m4f91rbiqz1r51wf-glibc-2.27 [...]
|   |   +---/nix/store/9hsvkkjaj6cjkbnj6hp6fviaqxg7hz5p-zlib-1.2.11
|   |   |   +---/nix/store/qnpbfbj9skc060v1m4f91rbiqz1r51wf-glibc-2.27 [...]
|   |   +---/nix/store/i7dbgzq3kl4asgrsmgxfj2anz9g8xpkx-gcc-7.4.0-lib
|   |   |   +---/nix/store/qnpbfbj9skc060v1m4f91rbiqz1r51wf-glibc-2.27 [...]
|   |   |   +---/nix/store/i7dbgzq3kl4asgrsmgxfj2anz9g8xpkx-gcc-7.4.0-lib [...]
|   |   +---/nix/store/hxva4x72bnf8x30ncxbxpqic1cj4w97v-gmp-6.1.2
|   |   |   +---/nix/store/qnpbfbj9skc060v1m4f91rbiqz1r51wf-glibc-2.27 [...]
|   |   |   +---/nix/store/i7dbgzq3kl4asgrsmgxfj2anz9g8xpkx-gcc-7.4.0-lib [...]
|   |   |   +---/nix/store/hxva4x72bnf8x30ncxbxpqic1cj4w97v-gmp-6.1.2 [...]
|   |   +---/nix/store/g1ak0vlfbapfi6w51xddx7fqv3vi05fy-gmp-6.1.2-dev
|   |   |   +---/nix/store/hxva4x72bnf8x30ncxbxpqic1cj4w97v-gmp-6.1.2 [...]
|   |   +---/nix/store/wzlq4mai2nv48n4si8sy08xxc7jlwidr-mpfr-4.0.1
|   |   |   +---/nix/store/qnpbfbj9skc060v1m4f91rbiqz1r51wf-glibc-2.27 [...]
|   |   |   +---/nix/store/hxva4x72bnf8x30ncxbxpqic1cj4w97v-gmp-6.1.2 [...]
|   |   |   +---/nix/store/wzlq4mai2nv48n4si8sy08xxc7jlwidr-mpfr-4.0.1 [...]
|   |   +---/nix/store/c03y6a02asz0xw6b30wdl647d1v1vx50-mpfr-4.0.1-dev
|   |   |   +---/nix/store/g1ak0vlfbapfi6w51xddx7fqv3vi05fy-gmp-6.1.2-dev [...]
|   |   |   +---/nix/store/wzlq4mai2nv48n4si8sy08xxc7jlwidr-mpfr-4.0.1 [...]
|   |   |   +---/nix/store/c03y6a02asz0xw6b30wdl647d1v1vx50-mpfr-4.0.1-dev [...]
|   |   +---/nix/store/dlcd2z84f1bk0k7p4s96j4cax1v29a3l-glibc-2.27-dev
|   |   |   +---/nix/store/0kb1y660fncf1pnrarrxjrk9jv0g2dnp-linux-headers-4.19.16
|   |   |   +---/nix/store/qnpbfbj9skc060v1m4f91rbiqz1r51wf-glibc-2.27 [...]
|   |   |   +---/nix/store/yq8nb7p9zv2bb473dm6m0ims46pnnxxv-glibc-2.27-bin
|   |   |       +---/nix/store/qnpbfbj9skc060v1m4f91rbiqz1r51wf-glibc-2.27 [...]
|   |   |       +---/nix/store/yq8nb7p9zv2bb473dm6m0ims46pnnxxv-glibc-2.27-bin [...]
|   |   +---/nix/store/jkl9478pha4frcrr7rnfx1qf2mv3xyhm-gcc-7.4.0
|   |   |   +---/nix/store/qnpbfbj9skc060v1m4f91rbiqz1r51wf-glibc-2.27 [...]
|   |   |   +---/nix/store/9hsvkkjaj6cjkbnj6hp6fviaqxg7hz5p-zlib-1.2.11 [...]
|   |   |   +---/nix/store/dlcd2z84f1bk0k7p4s96j4cax1v29a3l-glibc-2.27-dev [...]
|   |   |   +---/nix/store/i7dbgzq3kl4asgrsmgxfj2anz9g8xpkx-gcc-7.4.0-lib [...]
|   |   |   +---/nix/store/jkl9478pha4frcrr7rnfx1qf2mv3xyhm-gcc-7.4.0 [...]
|   |   +---/nix/store/fhlglb7cd3nw965sgpgv1vghqzrva31h-armv7l-unknown-linux-gnueabihf-stage-static-gcc-debug-7.4.0-lib
|   |   |   +---/nix/store/qnpbfbj9skc060v1m4f91rbiqz1r51wf-glibc-2.27 [...]
|   |   |   +---/nix/store/dlcd2z84f1bk0k7p4s96j4cax1v29a3l-glibc-2.27-dev [...]
|   |   |   +---/nix/store/g1ak0vlfbapfi6w51xddx7fqv3vi05fy-gmp-6.1.2-dev [...]
|   |   |   +---/nix/store/i7dbgzq3kl4asgrsmgxfj2anz9g8xpkx-gcc-7.4.0-lib [...]
|   |   |   +---/nix/store/jkl9478pha4frcrr7rnfx1qf2mv3xyhm-gcc-7.4.0 [...]
|   |   |   +---/nix/store/fhlglb7cd3nw965sgpgv1vghqzrva31h-armv7l-unknown-linux-gnueabihf-stage-static-gcc-debug-7.4.0-lib [...]
|   |   +---/nix/store/k7i1fvz0hqj2r5fzbnhhpk3mw2frx9b9-isl-0.17.1
|   |   |   +---/nix/store/qnpbfbj9skc060v1m4f91rbiqz1r51wf-glibc-2.27 [...]
|   |   |   +---/nix/store/hxva4x72bnf8x30ncxbxpqic1cj4w97v-gmp-6.1.2 [...]
|   |   |   +---/nix/store/k7i1fvz0hqj2r5fzbnhhpk3mw2frx9b9-isl-0.17.1 [...]
|   |   +---/nix/store/kyqlj3mwbijbnkz3nnjr2axixla0rj6p-zlib-1.2.11-dev
|   |   |   +---/nix/store/9hsvkkjaj6cjkbnj6hp6fviaqxg7hz5p-zlib-1.2.11 [...]
|   |   |   +---/nix/store/kyqlj3mwbijbnkz3nnjr2axixla0rj6p-zlib-1.2.11-dev [...]
|   |   +---/nix/store/nrgnbk0hb2s5hxfa5ndqirr32rcp99wh-libmpc-1.1.0
|   |   |   +---/nix/store/qnpbfbj9skc060v1m4f91rbiqz1r51wf-glibc-2.27 [...]
|   |   |   +---/nix/store/hxva4x72bnf8x30ncxbxpqic1cj4w97v-gmp-6.1.2 [...]
|   |   |   +---/nix/store/wzlq4mai2nv48n4si8sy08xxc7jlwidr-mpfr-4.0.1 [...]
|   |   |   +---/nix/store/nrgnbk0hb2s5hxfa5ndqirr32rcp99wh-libmpc-1.1.0 [...]
|   |   +---/nix/store/pxfr26jq9i660vrh6wwg8jvj1lriiifl-armv7l-unknown-linux-gnueabihf-binutils-wrapper-2.31.1
|   |   |   +---/nix/store/134rh2gyfx67hicrb72nn72a5qxnxi03-armv7l-unknown-linux-gnueabihf-binutils-2.31.1
|   |   |   |   +---/nix/store/qnpbfbj9skc060v1m4f91rbiqz1r51wf-glibc-2.27 [...]
|   |   |   |   +---/nix/store/9hsvkkjaj6cjkbnj6hp6fviaqxg7hz5p-zlib-1.2.11 [...]
|   |   |   |   +---/nix/store/dlcd2z84f1bk0k7p4s96j4cax1v29a3l-glibc-2.27-dev [...]
|   |   |   |   +---/nix/store/jkl9478pha4frcrr7rnfx1qf2mv3xyhm-gcc-7.4.0 [...]
|   |   |   |   +---/nix/store/kyqlj3mwbijbnkz3nnjr2axixla0rj6p-zlib-1.2.11-dev [...]
|   |   |   |   +---/nix/store/134rh2gyfx67hicrb72nn72a5qxnxi03-armv7l-unknown-linux-gnueabihf-binutils-2.31.1 [...]
|   |   |   +---/nix/store/6srk6zg63pmhfk70xb524ly64s74ifh0-coreutils-8.30
|   |   |   |   +---/nix/store/qnpbfbj9skc060v1m4f91rbiqz1r51wf-glibc-2.27 [...]
|   |   |   |   +---/nix/store/7yzs8cyz7zwxxhb1dhz234s54rqi49fq-attr-2.4.48
|   |   |   |   |   +---/nix/store/qnpbfbj9skc060v1m4f91rbiqz1r51wf-glibc-2.27 [...]
|   |   |   |   |   +---/nix/store/7yzs8cyz7zwxxhb1dhz234s54rqi49fq-attr-2.4.48 [...]
|   |   |   |   +---/nix/store/p8ci32bj6ar2z4lcqh82p5pjk93pry49-acl-2.2.53
|   |   |   |   |   +---/nix/store/qnpbfbj9skc060v1m4f91rbiqz1r51wf-glibc-2.27 [...]
|   |   |   |   |   +---/nix/store/7yzs8cyz7zwxxhb1dhz234s54rqi49fq-attr-2.4.48 [...]
|   |   |   |   |   +---/nix/store/p8ci32bj6ar2z4lcqh82p5pjk93pry49-acl-2.2.53 [...]
|   |   |   |   +---/nix/store/6srk6zg63pmhfk70xb524ly64s74ifh0-coreutils-8.30 [...]
|   |   |   +---/nix/store/j5m01jg66nyvpzyiias64qvhnnwk4h1w-bash-4.4-p23
|   |   |   |   +---/nix/store/qnpbfbj9skc060v1m4f91rbiqz1r51wf-glibc-2.27 [...]
|   |   |   |   +---/nix/store/j5m01jg66nyvpzyiias64qvhnnwk4h1w-bash-4.4-p23 [...]
|   |   |   +---/nix/store/qqwv26l3144wmlq2azd59vb12vc70pbi-expand-response-params
|   |   |   |   +---/nix/store/qnpbfbj9skc060v1m4f91rbiqz1r51wf-glibc-2.27 [...]
|   |   |   +---/nix/store/pxfr26jq9i660vrh6wwg8jvj1lriiifl-armv7l-unknown-linux-gnueabihf-binutils-wrapper-2.31.1 [...]
|   |   +---/nix/store/fgv5srabn8dc3c4q9a564whzbxssacwh-armv7l-unknown-linux-gnueabihf-stage-static-gcc-debug-7.4.0 [...]
|   +---/nix/store/9vx22lxyflvh32bnl3abfp9nz49bq3qy-glibc-2.27-armv7l-unknown-linux-gnueabihf [...]
+---/nix/store/v7pqcls3yg3c07g3nv626k52g857g6nn-armv7l-unknown-linux-gnueabihf-stage-final-gcc-debug-7.4.0-lib
|   +---/nix/store/fgv5srabn8dc3c4q9a564whzbxssacwh-armv7l-unknown-linux-gnueabihf-stage-static-gcc-debug-7.4.0 [...]
|   +---/nix/store/9vx22lxyflvh32bnl3abfp9nz49bq3qy-glibc-2.27-armv7l-unknown-linux-gnueabihf [...]
|   +---/nix/store/2cmra08am4j5ivh7r45mlx76gi713brn-glibc-2.27-armv7l-unknown-linux-gnueabihf-dev
|   |   +---/nix/store/1318v60073q1lhhwai2156gkymb2yd99-linux-headers-4.19.16 [...]
|   |   +---/nix/store/9vx22lxyflvh32bnl3abfp9nz49bq3qy-glibc-2.27-armv7l-unknown-linux-gnueabihf [...]
|   |   +---/nix/store/1nd86q922hb3vd047d7xqnkjk9284rs0-glibc-2.27-armv7l-unknown-linux-gnueabihf-bin
|   |       +---/nix/store/1318v60073q1lhhwai2156gkymb2yd99-linux-headers-4.19.16 [...]
|   |       +---/nix/store/fgv5srabn8dc3c4q9a564whzbxssacwh-armv7l-unknown-linux-gnueabihf-stage-static-gcc-debug-7.4.0 [...]
|   |       +---/nix/store/9vx22lxyflvh32bnl3abfp9nz49bq3qy-glibc-2.27-armv7l-unknown-linux-gnueabihf [...]
|   |       +---/nix/store/j5m01jg66nyvpzyiias64qvhnnwk4h1w-bash-4.4-p23 [...]
|   +---/nix/store/v7pqcls3yg3c07g3nv626k52g857g6nn-armv7l-unknown-linux-gnueabihf-stage-final-gcc-debug-7.4.0-lib [...]
+---/nix/store/ag3f3skkh5jpgj66nvifzldk6b587s2g-gmp-6.1.2-armv7l-unknown-linux-gnueabihf [...]

so that's great! *.sos are correctly moved to the lib output so we don't have to take the entire cross-gcc runtime closure with us, but there's still contamination! the rest of it comes from the stage-static-gcc compiler and is in the form of references to /nix/store/HASH-armv7l-unknown-linux-gnueabihf-stage-static-gcc-debug-7.4.0/lib/gcc/armv7l-unknown-linux-gnueabihf/7.4.0/include.

You can verify this by taking a binary (say a lib from glibc) and grepping for the cross-compiler's hash:

$ strings /nix/store/9vx22lxyflvh32bnl3abfp9nz49bq3qy-glibc-2.27-armv7l-unknown-linux-gnueabihf/lib/libc.so.6 | grep fgv5srabn8dc3c4q9a564whzbxssacwh 
/nix/store/fgv5srabn8dc3c4q9a564whzbxssacwh-armv7l-unknown-linux-gnueabihf-stage-static-gcc-debug-7.4.0/lib/gcc/armv7l-unknown-linux-gnueabihf/7.4.0/include
/nix/store/fgv5srabn8dc3c4q9a564whzbxssacwh-armv7l-unknown-linux-gnueabihf-stage-static-gcc-debug-7.4.0/lib/gcc/armv7l-unknown-linux-gnueabihf/7.4.0/include
/nix/store/fgv5srabn8dc3c4q9a564whzbxssacwh-armv7l-unknown-linux-gnueabihf-stage-static-gcc-debug-7.4.0/lib/gcc/armv7l-unknown-linux-gnueabihf/7.4.0/include
/nix/store/fgv5srabn8dc3c4q9a564whzbxssacwh-armv7l-unknown-linux-gnueabihf-stage-static-gcc-debug-7.4.0/lib/gcc/armv7l-unknown-linux-gnueabihf/7.4.0/include
...

So it turns out there's some headers stored in the cross-gcc closure whose path is compiled into a bunch of binaries. It's at this point where I'm unsure of what to do. I should separate the headers into a separate output, but then how do I tell other derivations to look at that path for header files (where do I add the extra -I flag)? Maybe in the gcc wrapper? not sure where that's built.

Here's a running list of build dependencies that are brought into run-time:

  • stage-final-gcc-debug-7.4.0/armv7l-unknown-linux-gnueabihf/lib/*
  • stage-final-gcc-debug-7.4.0/armv7l-unknown-linux-gnueabihf/lib64/*
  • stage-static-gcc-debug-7.4.0/lib/gcc/armv7l-unknown-linux-gnueabihf/7.4.0/include/*
  • stage-final-gcc-debug-7.4.0/lib/gcc/armv7l-unknown-linux-gnueabihf/7.4.0/include/*
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@delroth
Copy link
Contributor

delroth commented Apr 17, 2019

I think the header paths is an artifact of glibc not being stripped in cross build -- these paths you're seeing are in a debug section. This is a decision that was made in 2012 in commit 5481e67. I suspect the reasons to not strip glibc in cross build that applied at the time might not be current anymore.

@delroth
Copy link
Contributor

delroth commented Apr 17, 2019

@illegalprime can you rebase this PR on top of #59787 now that it's merged and check that it fixes the libgcc / libc++ problem? Your issue with headers should be gone.

@illegalprime
Copy link
Member Author

thanks @delroth that worked! here's the new (much shorter) output:

$ nix build -f . pkgsCross.armv7l-hf-multiplatform.gmp
$ nix-store -q --tree result
/nix/store/g1wwacnii5kvk3qkbyrifjaniw92x20x-gmp-6.1.2-armv7l-unknown-linux-gnueabihf
+---/nix/store/zbq5p04sgacl2pw0fjh0djywg963abwa-glibc-2.27-armv7l-unknown-linux-gnueabihf
|   +---/nix/store/zbq5p04sgacl2pw0fjh0djywg963abwa-glibc-2.27-armv7l-unknown-linux-gnueabihf [...]
+---/nix/store/6irc9n6p6h1sq62w7ynqjaxvaq6v0jnw-armv7l-unknown-linux-gnueabihf-stage-final-gcc-debug-7.4.0-lib
|   +---/nix/store/zbq5p04sgacl2pw0fjh0djywg963abwa-glibc-2.27-armv7l-unknown-linux-gnueabihf [...]
|   +---/nix/store/brdwp12a7v3r87v8yighnm06z1rkghzg-glibc-2.27-armv7l-unknown-linux-gnueabihf-dev
|   |   +---/nix/store/zbq5p04sgacl2pw0fjh0djywg963abwa-glibc-2.27-armv7l-unknown-linux-gnueabihf [...]
|   |   +---/nix/store/pzq03i467m0p14xyj4rmhwi3pxynah07-glibc-2.27-armv7l-unknown-linux-gnueabihf-bin
|   |   |   +---/nix/store/zbq5p04sgacl2pw0fjh0djywg963abwa-glibc-2.27-armv7l-unknown-linux-gnueabihf [...]
|   |   +---/nix/store/rbxk8gzdcci6rq4hnr3i6yj9mbck6l4p-linux-headers-4.19.16
|   +---/nix/store/6irc9n6p6h1sq62w7ynqjaxvaq6v0jnw-armv7l-unknown-linux-gnueabihf-stage-final-gcc-debug-7.4.0-lib [...]
+---/nix/store/g1wwacnii5kvk3qkbyrifjaniw92x20x-gmp-6.1.2-armv7l-unknown-linux-gnueabihf [...]

@Thra11
Copy link
Member

Thra11 commented Apr 18, 2019

Looks like the header situation isn't quite fixed yet. Still lots of references to /nix/store/97kxpc2dwrxxrqcda1f2c5h5mirh2kwl-glibc-2.27-armv7l-unknown-linux-gnueabihf-dev/include in libgcc_s.so.1 and libgomp.so.1.0.0

@illegalprime
Copy link
Member Author

illegalprime commented Apr 18, 2019

@Thra11 you're right, seems to be https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/compilers/gcc/7/default.nix#L21 which was introduced in c42118b nevermind it was there when gcc7 started: 0dc5473

EDIT: seems to go as far back as 6 years ago (with gcc 4.8), maybe it could be removed?

@Thra11
Copy link
Member

Thra11 commented Apr 19, 2019

If I change it so that stripped is true, regardless of whether it's a cross build, the situation improves:

% nix-store -q --tree $(nix eval nixpkgs.pkgsCross.armv7l-hf-multiplatform.hello-cpp.outPath | tr -d '"')
/nix/store/2mppyy5zjy5pif3l8sdq1wgy1p90p8cm-hello-cpp-2-armv7l-unknown-linux-gnueabihf
+---/nix/store/xz327z2wxlyadpgzjc35wxii8y4lalv5-glibc-2.27-armv7l-unknown-linux-gnueabihf
|   +---/nix/store/xz327z2wxlyadpgzjc35wxii8y4lalv5-glibc-2.27-armv7l-unknown-linux-gnueabihf [...]
+---/nix/store/5gbajh72z5srgfl9nlql02swv0lq65kl-armv7l-unknown-linux-gnueabihf-stage-final-gcc-7.4.0-lib
    +---/nix/store/xz327z2wxlyadpgzjc35wxii8y4lalv5-glibc-2.27-armv7l-unknown-linux-gnueabihf [...]
    +---/nix/store/mp3wggh2bbi024dxgvmpaciw151z7gb0-glibc-2.27-armv7l-unknown-linux-gnueabihf-dev
    |   +---/nix/store/4hdk8s79nk2q6wiydf3ir4gcm6a4wy3b-linux-headers-4.19.16
    |   +---/nix/store/xz327z2wxlyadpgzjc35wxii8y4lalv5-glibc-2.27-armv7l-unknown-linux-gnueabihf [...]
    |   +---/nix/store/kci03hbarl3i9ik212pwcb7bkacab7pp-glibc-2.27-armv7l-unknown-linux-gnueabihf-bin
    |       +---/nix/store/xz327z2wxlyadpgzjc35wxii8y4lalv5-glibc-2.27-armv7l-unknown-linux-gnueabihf [...]
    +---/nix/store/5gbajh72z5srgfl9nlql02swv0lq65kl-armv7l-unknown-linux-gnueabihf-stage-final-gcc-7.4.0-lib [...]
% nix why-depends --all /nix/store/5gbajh72z5srgfl9nlql02swv0lq65kl-armv7l-unknown-linux-gnueabihf-stage-final-gcc-7.4.0-lib /nix/store/mp3wggh2bbi024dxgvmpaciw151z7gb0-glibc-2.27-armv7l-unknown-linux-gnueabihf-dev 
/nix/store/5gbajh72z5srgfl9nlql02swv0lq65kl-armv7l-unknown-linux-gnueabihf-stage-final-gcc-7.4.0-lib
╚═══lib/libgcc_s.so.1: …ld/build/gcc/include./nix/store/mp3wggh2bbi024dxgvmpaciw151z7gb0-glibc-2.27-armv7l-unknown-linux…
    => /nix/store/mp3wggh2bbi024dxgvmpaciw151z7gb0-glibc-2.27-armv7l-unknown-linux-gnueabihf-dev

However, we do still have a reference to glibc-2.27-armv7l-unknown-linux-gnueabihf-dev in there.

@illegalprime
Copy link
Member Author

@Thra11 it could also be this:

if test -n "${targetConfig-}"; then
# The host strip will destroy some important details of the objects
dontStrip=1
fi

targetConfig is only set when cross compiling, i would just try removing the lines above.

@illegalprime
Copy link
Member Author

@delroth @Mic92 there's some stripping hacks:

$ git grep 'dontStrip.*stdenv.*;'
pkgs/development/libraries/boehm-gc/7.6.6.nix:  dontStrip = stdenv.hostPlatform != stdenv.buildPlatform;
pkgs/development/libraries/boehm-gc/default.nix:  dontStrip = stdenv.hostPlatform != stdenv.buildPlatform;
pkgs/development/libraries/libffi/default.nix:  dontStrip = stdenv.hostPlatform != stdenv.buildPlatform; # Don't run the native `strip' when cross-compiling.
pkgs/development/libraries/libpcap/default.nix:  dontStrip = stdenv.hostPlatform != stdenv.buildPlatform;
pkgs/development/libraries/librsync/0.9.nix:  dontStrip = stdenv.hostPlatform != stdenv.buildPlatform;
pkgs/development/libraries/librsync/default.nix:  dontStrip = stdenv.hostPlatform != stdenv.buildPlatform;
pkgs/development/libraries/qt-4.x/4.8/default.nix:  dontStrip = stdenv.hostPlatform != stdenv.buildPlatform;
pkgs/development/libraries/readline/6.3.nix:  dontStrip = stdenv.hostPlatform != stdenv.buildPlatform;
pkgs/development/libraries/readline/7.0.nix:  dontStrip = stdenv.hostPlatform != stdenv.buildPlatform;
pkgs/development/libraries/readline/8.0.nix:  dontStrip = stdenv.hostPlatform != stdenv.buildPlatform;
pkgs/development/libraries/zlib/default.nix:  dontStrip = stdenv.hostPlatform != stdenv.buildPlatform && static;
pkgs/development/tools/misc/libtool/libtool2.nix:  dontStrip = stdenv.hostPlatform != stdenv.buildPlatform;
pkgs/os-specific/linux/uclibc/default.nix:  dontStrip = stdenv.hostPlatform != stdenv.buildPlatform;

maybe some of these aren't needed anymore?

@matthewbauer
Copy link
Member

@delroth @Mic92 there's some stripping hacks:

$ git grep 'dontStrip.*stdenv.*;'
pkgs/development/libraries/boehm-gc/7.6.6.nix:  dontStrip = stdenv.hostPlatform != stdenv.buildPlatform;
pkgs/development/libraries/boehm-gc/default.nix:  dontStrip = stdenv.hostPlatform != stdenv.buildPlatform;
pkgs/development/libraries/libffi/default.nix:  dontStrip = stdenv.hostPlatform != stdenv.buildPlatform; # Don't run the native `strip' when cross-compiling.
pkgs/development/libraries/libpcap/default.nix:  dontStrip = stdenv.hostPlatform != stdenv.buildPlatform;
pkgs/development/libraries/librsync/0.9.nix:  dontStrip = stdenv.hostPlatform != stdenv.buildPlatform;
pkgs/development/libraries/librsync/default.nix:  dontStrip = stdenv.hostPlatform != stdenv.buildPlatform;
pkgs/development/libraries/qt-4.x/4.8/default.nix:  dontStrip = stdenv.hostPlatform != stdenv.buildPlatform;
pkgs/development/libraries/readline/6.3.nix:  dontStrip = stdenv.hostPlatform != stdenv.buildPlatform;
pkgs/development/libraries/readline/7.0.nix:  dontStrip = stdenv.hostPlatform != stdenv.buildPlatform;
pkgs/development/libraries/readline/8.0.nix:  dontStrip = stdenv.hostPlatform != stdenv.buildPlatform;
pkgs/development/libraries/zlib/default.nix:  dontStrip = stdenv.hostPlatform != stdenv.buildPlatform && static;
pkgs/development/tools/misc/libtool/libtool2.nix:  dontStrip = stdenv.hostPlatform != stdenv.buildPlatform;
pkgs/os-specific/linux/uclibc/default.nix:  dontStrip = stdenv.hostPlatform != stdenv.buildPlatform;

maybe some of these aren't needed anymore?

Most likely the build systems are using the wrong strip for those cases. It's okay to remove them if you know for sure they're using strip correctly

@delroth
Copy link
Contributor

delroth commented Apr 19, 2019

Most of these are probably obsolete. Stripping is done by the generic Nix builder script, there shouldn't be anything package-specific in selecting the right toolchain for stripping.

gcc is the exception: it's a host package with some target libs in a subdir. It should likely have some custom stripping logic to handle this. Though so far I haven't hit any issues with running host strip on the target libs -- but my choice of (host, target) tuple might not be exotic enough :-)

@illegalprime
Copy link
Member Author

illegalprime commented Apr 20, 2019

thinking about this a bit more, maybe if we only strip on the lib & bin outputs of gcc (to avoid the dependency on glibc-dev)?
I don't know how to do that though

moveToOutput "lib/lib*.so*" "$lib"
moveToOutput "lib/lib*.la" "$lib"
moveToOutput "lib/lib*.dylib" "$lib"
if [[ -d "$out/$target_triple/lib" && -n "$(ls -A $out/$target_triple/lib)" ]]; then
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i should check if $target_triple is defined first

@Thra11
Copy link
Member

Thra11 commented Apr 20, 2019

I have confirmed that removing these lines

if test -n "${targetConfig-}"; then
# The host strip will destroy some important details of the objects
dontStrip=1
fi
results in my test case having the correct dependencies:

% nix-store -q --tree $(nix eval nixpkgs.pkgsCross.armv7l-hf-multiplatform.hello-cpp.outPath | tr -d '"')
/nix/store/fcq18z9pl303yihl0qsj8liqg4n1rm6b-hello-cpp-2-armv7l-unknown-linux-gnueabihf
+---/nix/store/2mm8gpnipz6i27s2314wm35kdih2kimm-glibc-2.27-armv7l-unknown-linux-gnueabihf
|   +---/nix/store/2mm8gpnipz6i27s2314wm35kdih2kimm-glibc-2.27-armv7l-unknown-linux-gnueabihf [...]
+---/nix/store/28nb6zzh6mjj3706s0w4jyvvh5hb4dnb-armv7l-unknown-linux-gnueabihf-stage-final-gcc-7.4.0-lib
    +---/nix/store/2mm8gpnipz6i27s2314wm35kdih2kimm-glibc-2.27-armv7l-unknown-linux-gnueabihf [...]
    +---/nix/store/28nb6zzh6mjj3706s0w4jyvvh5hb4dnb-armv7l-unknown-linux-gnueabihf-stage-final-gcc-7.4.0-lib [...]

@illegalprime
Copy link
Member Author

@Thra11 did you set stripped = true and remove those lines? When I try to do that I'm unable to compile glibc. Can you post what your derivation looks like?

@Thra11
Copy link
Member

Thra11 commented Apr 20, 2019

@illegalprime Here is the current state of my nixpkgs: https://github.com/Thra11/nixpkgs/tree/gcc-cross-contamination2

@illegalprime
Copy link
Member Author

thanks @Thra11! but I still get an error with your nixpkgs:

$ nix build -f . pkgsCross.armv7l-hf-multiplatform.gmp
builder for '/nix/store/4spm87d4bm4s0cwqs78v4is6jd38x444-glibc-2.27-armv7l-unknown-linux-gnueabihf.drv' failed with exit code 2; last 10 log lines:
        '-Wl,-(' /build/build/elf/dl-allobjs.os /build/build/libc_pic.a -lgcc '-Wl,-)' -Wl,-Map,/build/build/elf/librtld.mapT
  /nix/store/8xc7n978j2hmq4b87rrdgv21bwjyfggv-armv7l-unknown-linux-gnueabihf-binutils-2.31.1/bin/armv7l-unknown-linux-gnueabihf-ld: skipping incompatible /nix/store/w0jzgdq9rl8nbhwhbr3rwglg7cvsqvnn-armv7l-unknown-linux-gnueabihf-stage-static-gcc-7.4.0/lib/gcc/armv7l-unknown-linux-gnueabihf/7.4.0/libgcc.a when searching for -lgcc
  /nix/store/8xc7n978j2hmq4b87rrdgv21bwjyfggv-armv7l-unknown-linux-gnueabihf-binutils-2.31.1/bin/armv7l-unknown-linux-gnueabihf-ld: cannot find -lgcc
  collect2: error: ld returned 1 exit status
  make[2]: *** [Makefile:438: /build/build/elf/librtld.map] Error 1
  make[2]: *** Waiting for unfinished jobs....
  make[2]: Leaving directory '/build/glibc-2.27/elf'
  make[1]: *** [Makefile:215: elf/subdir_lib] Error 2
  make[1]: Leaving directory '/build/glibc-2.27'
  make: *** [Makefile:9: all] Error 2

@Thra11
Copy link
Member

Thra11 commented Apr 23, 2019

I can only assume that the difference is the host architecture. I believe you are compiling on x86 (based on your original issue), while I am compiling on an aarch64 host.

What architecture is the /nix/store/w0jzgdq9rl8nbhwhbr3rwglg7cvsqvnn-armv7l-unknown-linux-gnueabihf-stage-static-gcc-7.4.0/lib/gcc/armv7l-unknown-linux-gnueabihf/7.4.0/libgcc.a which it's complaining about? Are you able to compile for any other target platforms? e.g. i686

@illegalprime
Copy link
Member Author

illegalprime commented Apr 23, 2019

@Thra11 the file is an archive with ARM 32-bit files in it, but only the first file in the archive has the Machine field stripped off. This is what I get from readelf:

File: /nix/store/w0jzgdq9rl8nbhwhbr3rwglg7cvsqvnn-armv7l-unknown-linux-gnueabihf-stage-static-gcc-7.4.0/lib/gcc/armv7l
-unknown-linux-gnueabihf/7.4.0/libgcc.a(_thumb1_case_sqi.o)
ELF Header:
  Magic:   7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00 
  Class:                             ELF32
  Data:                              2's complement, little endian
  Version:                           1 (current)
  OS/ABI:                            UNIX - System V
  ABI Version:                       0
  Type:                              REL (Relocatable file)
  Machine:                           None
  Version:                           0x1
  Entry point address:               0x0
  Start of program headers:          0 (bytes into file)
  Start of section headers:          340 (bytes into file)
  Flags:                             0x5000000
  Size of this header:               52 (bytes)
  Size of program headers:           0 (bytes)
  Number of program headers:         0
  Size of section headers:           40 (bytes)
  Number of section headers:         9
  Section header string table index: 8

this is the same problem I ran into when cross compiling rust libs: #56540 (comment)

maybe if that field was ARM like the other object files in that archive, then everything would work.

EDIT: not sure how the strip process works now, but maybe it should unpack archive files and strip individually? Or just be changed somehow to accommodate

EDIT 2: it seems that running the host's strip is what mangles the file, but running armv7l-unknown-linux-gnueabihf-strip is fine. but I'm not sure if gcc has that tool available in its static stage.

EDIT 3: maybe this means I need to set dontStripHost=1

@Ericson2314
Copy link
Member

Thanks for take a stab at this you all! Someday I hope gcc can be changed so building the libraries separately is supported like LLVM, but this is definitely the right approach for now.

@Thra11
Copy link
Member

Thra11 commented Apr 23, 2019

@illegalprime I guess aarch64 strip must strip aarch32 files correctly

@illegalprime
Copy link
Member Author

illegalprime commented Apr 23, 2019

turns out dontStripHost = true is what we needed, this is my gmp:

$ nix-store -qR result
/nix/store/xf2g58x8fnb5d4mvmns86zrvz9xpdsp6-glibc-2.27-armv7l-unknown-linux-gnueabihf
/nix/store/2ahiwgzl11wmg4yc1lw0rx2c98nqya0v-armv7l-unknown-linux-gnueabihf-stage-final-gcc-7.4.0-lib
/nix/store/950smj8610ibiky1ihfk671i9gx2786q-gmp-6.1.2-armv7l-unknown-linux-gnueabihf

even smaller than before, thanks for your help @Thra11!

wouldn't it be sane to never call strip on binaries of a different arch? instead only call the cross-tools strip? (cc @Ericson2314)

@illegalprime
Copy link
Member Author

already talked on IRC with @matthewbauer a bit about this but I'm having trouble testing the other gcc versions to complete this PR (and building u-boot for the odroid-c1). Specifically I'm having trouble cross compiling with a different version of the gcc toolchain, I have tried:

nix-build -E 'with (import <nixpkgs> {}).pkgsCross.armv7l-hf-multiplatform; hello.override { stdenv = overrideCC stdenv gcc48; }'

which resulted in this log https://pastebin.com/3zhaiuKL

trying:

nix-build -E 'with (import <nixpkgs> {}).pkgsCross.armv7l-hf-multiplatform; hello.override { stdenv = overrideCC stdenv buildPackages.gcc48; }'

runs without error, but a nix-store -qR result | grep gcc reveals its linked to the wrong gcc.

how should I do this?

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/proposal-a-dedicated-cross-compiling-team/3824/8

@veprbl veprbl added the 6.topic: cross-compilation Building packages on a different sort platform than than they will be run on label Aug 29, 2019
@illegalprime
Copy link
Member Author

I'm waiting on #68395 to be resolved for this patch and to figure out how to test this patch against different gcc versions (i.e. how do i cross compile with a different gcc version?).

@lheckemann
Copy link
Member

To check target_triple's existence…

diff --git a/pkgs/development/compilers/gcc/builder.sh b/pkgs/development/compilers/gcc/builder.sh
index 795b52d0f59..157485fda4d 100644
--- a/pkgs/development/compilers/gcc/builder.sh
+++ b/pkgs/development/compilers/gcc/builder.sh
@@ -213,13 +213,13 @@ preInstall() {

 postInstall() {
     # Move runtime libraries to $lib.
-    if [[ -d "$out/$target_triple/lib" && -n "$(ls -A $out/$target_triple/lib)" ]]; then
+    if [[ -n "$target_triple" && -d "$out/$target_triple/lib" && -n "$(ls -A $out/$target_triple/lib)" ]]; then
         moveToOutput "$target_triple/lib/lib*.so*" "$lib"
         moveToOutput "$target_triple/lib/lib*.la" "$lib"
         moveToOutput "$target_triple/lib/lib*.dylib" "$lib"
         mv "$lib/$target_triple"/lib/* "$lib/lib/"
         rmdir -p --ignore-fail-on-non-empty "$lib/$target_triple/lib" || :
-    elif [[ -d "$out/$target_triple/lib64" && -n "$(ls -A $out/$target_triple/lib64)" ]]; then
+    elif [[ -n "$target_triple" && -d "$out/$target_triple/lib64" && -n "$(ls -A $out/$target_triple/lib64)" ]]; then
         moveToOutput "$target_triple/lib64/lib*.so*" "$lib"
         moveToOutput "$target_triple/lib64/lib*.la" "$lib"
         moveToOutput "$target_triple/lib64/lib*.dylib" "$lib"

What else is missing for this not to be WIP anymore?

@matthewbauer
Copy link
Member

Yeah, this looks ready to go. Make sure it goes to staging.

/cc @Ericson2314

@@ -152,6 +152,9 @@ stdenv.mkDerivation ({

libc_dev = stdenv.cc.libc_dev;

# set this var to use in builder.sh
target_triple = targetPlatform.config;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can use targetConfig below, actually

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this also need to be done for later gccs (8, 9) for this PR to apply to them?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but as @matthewbauer wrote, this variable should probably be removed replaced with targetConfig, which is already defined.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@matthewbauer @lopsided98 I made a branch with this change applied (delete target_triple binding and use targetConfig in the script), and master merged: https://github.com/eamsden/nixpkgs/tree/eamsden/gcc-cross-contamination

It fails with a long list of attempts to mv files to the same directory:

Moving /nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0//lib/libasan.so to /nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libasan.so
rmdir: failed to remove '/nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0/lib': Directory not empty
Moving /nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0//lib/libasan.so.5 to /nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libasan.so.5
rmdir: failed to remove '/nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0/lib': Directory not empty
Moving /nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0//lib/libasan.so.5.0.0 to /nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libasan.so.5.0.0
rmdir: failed to remove '/nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0/lib': Directory not empty
Moving /nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0//lib/libatomic.so to /nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libatomic.so
rmdir: failed to remove '/nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0/lib': Directory not empty
Moving /nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0//lib/libatomic.so.1 to /nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libatomic.so.1
rmdir: failed to remove '/nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0/lib': Directory not empty
Moving /nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0//lib/libatomic.so.1.2.0 to /nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libatomic.so.1.2.0
rmdir: failed to remove '/nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0/lib': Directory not empty
Moving /nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0//lib/libcc1.so to /nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libcc1.so
rmdir: failed to remove '/nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0/lib': Directory not empty
Moving /nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0//lib/libcc1.so.0 to /nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libcc1.so.0
rmdir: failed to remove '/nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0/lib': Directory not empty
Moving /nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0//lib/libcc1.so.0.0.0 to /nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libcc1.so.0.0.0
rmdir: failed to remove '/nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0/lib': Directory not empty
Moving /nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0//lib/libgcc_s.so to /nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libgcc_s.so
rmdir: failed to remove '/nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0/lib': Directory not empty
Moving /nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0//lib/libgcc_s.so.1 to /nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libgcc_s.so.1
rmdir: failed to remove '/nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0/lib': Directory not empty
Moving /nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0//lib/libgomp.so to /nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libgomp.so
rmdir: failed to remove '/nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0/lib': Directory not empty
Moving /nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0//lib/libgomp.so.1 to /nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libgomp.so.1
rmdir: failed to remove '/nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0/lib': Directory not empty
Moving /nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0//lib/libgomp.so.1.0.0 to /nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libgomp.so.1.0.0
rmdir: failed to remove '/nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0/lib': Directory not empty
Moving /nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0//lib/libitm.so to /nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libitm.so
rmdir: failed to remove '/nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0/lib': Directory not empty
Moving /nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0//lib/libitm.so.1 to /nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libitm.so.1
rmdir: failed to remove '/nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0/lib': Directory not empty
Moving /nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0//lib/libitm.so.1.0.0 to /nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libitm.so.1.0.0
rmdir: failed to remove '/nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0/lib': Directory not empty
Moving /nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0//lib/liblsan.so to /nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/liblsan.so
rmdir: failed to remove '/nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0/lib': Directory not empty
Moving /nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0//lib/liblsan.so.0 to /nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/liblsan.so.0
rmdir: failed to remove '/nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0/lib': Directory not empty
Moving /nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0//lib/liblsan.so.0.0.0 to /nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/liblsan.so.0.0.0
rmdir: failed to remove '/nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0/lib': Directory not empty
Moving /nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0//lib/libquadmath.so to /nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libquadmath.so
rmdir: failed to remove '/nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0/lib': Directory not empty
Moving /nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0//lib/libquadmath.so.0 to /nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libquadmath.so.0
rmdir: failed to remove '/nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0/lib': Directory not empty
Moving /nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0//lib/libquadmath.so.0.0.0 to /nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libquadmath.so.0.0.0
rmdir: failed to remove '/nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0/lib': Directory not empty
Moving /nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0//lib/libssp.so to /nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libssp.so
rmdir: failed to remove '/nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0/lib': Directory not empty
Moving /nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0//lib/libssp.so.0 to /nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libssp.so.0
rmdir: failed to remove '/nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0/lib': Directory not empty
Moving /nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0//lib/libssp.so.0.0.0 to /nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libssp.so.0.0.0
rmdir: failed to remove '/nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0/lib': Directory not empty
Moving /nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0//lib/libstdc++.so to /nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libstdc++.so
rmdir: failed to remove '/nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0/lib': Directory not empty
Moving /nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0//lib/libstdc++.so.6 to /nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libstdc++.so.6
rmdir: failed to remove '/nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0/lib': Directory not empty
Moving /nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0//lib/libstdc++.so.6.0.27 to /nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libstdc++.so.6.0.27
rmdir: failed to remove '/nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0/lib': Directory not empty
Moving /nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0//lib/libstdc++.so.6.0.27-gdb.py to /nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libstdc++.so.6.0.27-gdb.py
rmdir: failed to remove '/nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0/lib': Directory not empty
Moving /nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0//lib/libtsan.so to /nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libtsan.so
rmdir: failed to remove '/nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0/lib': Directory not empty
Moving /nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0//lib/libtsan.so.0 to /nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libtsan.so.0
rmdir: failed to remove '/nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0/lib': Directory not empty
Moving /nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0//lib/libtsan.so.0.0.0 to /nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libtsan.so.0.0.0
rmdir: failed to remove '/nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0/lib': Directory not empty
Moving /nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0//lib/libubsan.so to /nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libubsan.so
rmdir: failed to remove '/nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0/lib': Directory not empty
Moving /nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0//lib/libubsan.so.1 to /nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libubsan.so.1
rmdir: failed to remove '/nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0/lib': Directory not empty
Moving /nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0//lib/libubsan.so.1.0.0 to /nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libubsan.so.1.0.0
rmdir: failed to remove '/nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0/lib': Directory not empty
Moving /nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0//lib/libasan.la to /nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libasan.la
rmdir: failed to remove '/nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0/lib': Directory not empty
Moving /nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0//lib/libatomic.la to /nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libatomic.la
rmdir: failed to remove '/nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0/lib': Directory not empty
Moving /nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0//lib/libcc1.la to /nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libcc1.la
rmdir: failed to remove '/nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0/lib': Directory not empty
Moving /nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0//lib/libgomp.la to /nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libgomp.la
rmdir: failed to remove '/nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0/lib': Directory not empty
Moving /nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0//lib/libitm.la to /nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libitm.la
rmdir: failed to remove '/nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0/lib': Directory not empty
Moving /nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0//lib/liblsan.la to /nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/liblsan.la
rmdir: failed to remove '/nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0/lib': Directory not empty
Moving /nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0//lib/libquadmath.la to /nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libquadmath.la
rmdir: failed to remove '/nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0/lib': Directory not empty
Moving /nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0//lib/libssp.la to /nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libssp.la
rmdir: failed to remove '/nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0/lib': Directory not empty
Moving /nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0//lib/libssp_nonshared.la to /nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libssp_nonshared.la
rmdir: failed to remove '/nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0/lib': Directory not empty
Moving /nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0//lib/libstdc++.la to /nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libstdc++.la
rmdir: failed to remove '/nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0/lib': Directory not empty
Moving /nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0//lib/libstdc++fs.la to /nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libstdc++fs.la
rmdir: failed to remove '/nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0/lib': Directory not empty
Moving /nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0//lib/libsupc++.la to /nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libsupc++.la
rmdir: failed to remove '/nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0/lib': Directory not empty
Moving /nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0//lib/libtsan.la to /nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libtsan.la
rmdir: failed to remove '/nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0/lib': Directory not empty
Moving /nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0//lib/libubsan.la to /nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libubsan.la
rmdir: failed to remove '/nix/store/s5rz11azrvlmsc9392r75wi79akygn88-gcc-9.2.0/lib': Directory not empty
mv: '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libasan.la' and '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib/lib/libasan.la' are the same file
mv: '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libasan.so' and '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib/lib/libasan.so' are the same file
mv: '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libasan.so.5' and '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib/lib/libasan.so.5' are the same file
mv: '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libasan.so.5.0.0' and '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib/lib/libasan.so.5.0.0' are the same file
mv: '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libatomic.la' and '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib/lib/libatomic.la' are the same file
mv: '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libatomic.so' and '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib/lib/libatomic.so' are the same file
mv: '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libatomic.so.1' and '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib/lib/libatomic.so.1' are the same file
mv: '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libatomic.so.1.2.0' and '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib/lib/libatomic.so.1.2.0' are the same file
mv: '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libcc1.la' and '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib/lib/libcc1.la' are the same file
mv: '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libcc1.so' and '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib/lib/libcc1.so' are the same file
mv: '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libcc1.so.0' and '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib/lib/libcc1.so.0' are the same file
mv: '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libcc1.so.0.0.0' and '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib/lib/libcc1.so.0.0.0' are the same file
mv: '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libgcc_s.so' and '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib/lib/libgcc_s.so' are the same file
mv: '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libgcc_s.so.1' and '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib/lib/libgcc_s.so.1' are the same file
mv: '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libgomp.la' and '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib/lib/libgomp.la' are the same file
mv: '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libgomp.so' and '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib/lib/libgomp.so' are the same file
mv: '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libgomp.so.1' and '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib/lib/libgomp.so.1' are the same file
mv: '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libgomp.so.1.0.0' and '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib/lib/libgomp.so.1.0.0' are the same file
mv: '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libitm.la' and '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib/lib/libitm.la' are the same file
mv: '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libitm.so' and '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib/lib/libitm.so' are the same file
mv: '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libitm.so.1' and '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib/lib/libitm.so.1' are the same file
mv: '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libitm.so.1.0.0' and '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib/lib/libitm.so.1.0.0' are the same file
mv: '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/liblsan.la' and '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib/lib/liblsan.la' are the same file
mv: '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/liblsan.so' and '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib/lib/liblsan.so' are the same file
mv: '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/liblsan.so.0' and '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib/lib/liblsan.so.0' are the same file
mv: '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/liblsan.so.0.0.0' and '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib/lib/liblsan.so.0.0.0' are the same file
mv: '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libquadmath.la' and '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib/lib/libquadmath.la' are the same file
mv: '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libquadmath.so' and '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib/lib/libquadmath.so' are the same file
mv: '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libquadmath.so.0' and '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib/lib/libquadmath.so.0' are the same file
mv: '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libquadmath.so.0.0.0' and '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib/lib/libquadmath.so.0.0.0' are the same file
mv: '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libssp.la' and '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib/lib/libssp.la' are the same file
mv: '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libssp.so' and '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib/lib/libssp.so' are the same file
mv: '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libssp.so.0' and '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib/lib/libssp.so.0' are the same file
mv: '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libssp.so.0.0.0' and '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib/lib/libssp.so.0.0.0' are the same file
mv: '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libssp_nonshared.la' and '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib/lib/libssp_nonshared.la' are the same file
mv: '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libstdc++.la' and '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib/lib/libstdc++.la' are the same file
mv: '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libstdc++.so' and '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib/lib/libstdc++.so' are the same file
mv: '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libstdc++.so.6' and '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib/lib/libstdc++.so.6' are the same file
mv: '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libstdc++.so.6.0.27' and '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib/lib/libstdc++.so.6.0.27' are the same file
mv: '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libstdc++.so.6.0.27-gdb.py' and '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib/lib/libstdc++.so.6.0.27-gdb.py' are the same file
mv: '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libstdc++fs.la' and '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib/lib/libstdc++fs.la' are the same file
mv: '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libsupc++.la' and '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib/lib/libsupc++.la' are the same file
mv: '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libtsan.la' and '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib/lib/libtsan.la' are the same file
mv: '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libtsan.so' and '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib/lib/libtsan.so' are the same file
mv: '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libtsan.so.0' and '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib/lib/libtsan.so.0' are the same file
mv: '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libtsan.so.0.0.0' and '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib/lib/libtsan.so.0.0.0' are the same file
mv: '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libubsan.la' and '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib/lib/libubsan.la' are the same file
mv: '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libubsan.so' and '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib/lib/libubsan.so' are the same file
mv: '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libubsan.so.1' and '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib/lib/libubsan.so.1' are the same file
mv: '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib//lib/libubsan.so.1.0.0' and '/nix/store/4dq9a667f3hsrk3lc6h5177i0nj1y297-gcc-9.2.0-lib/lib/libubsan.so.1.0.0' are the same file
builder for '/nix/store/6fiigj3xj5bm7h23kz4x6iws8fvws12c-gcc-9.2.0.drv' failed with exit code 1

(command: nix-build ./. -A pkgsCross.armv7l-hf-multiplatform.buildPackages.gcc-unwrapped)

This same attribute path builds successfully (though of course with all the cross-contamination) on unpatched nixpkgs master

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

targetConfig is empty during native builds, so you need to add -n "${targetConfig}" to the if statements in builder.sh

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatively you could just add target_triple to GCC 9 if that is easier.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this one works: matthewbauer@16951cf

mv "$lib/$target_triple"/lib/* "$lib/lib/"
rmdir -p --ignore-fail-on-non-empty "$lib/$target_triple/lib" || :
elif [[ -d "$out/$target_triple/lib64" && -n "$(ls -A $out/$target_triple/lib64)" ]]; then
moveToOutput "$target_triple/lib64/lib*.so*" "$lib"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can remove the special handling of lib64 if you replace $out with $out/$targetConfig in the preInstall hook above. This should cause the libraries to be installed into lib rather than lib64, and since $targetConfig is empty during native builds, it will work for both native and cross.

@lopsided98
Copy link
Contributor

lopsided98 commented Mar 4, 2020

I've been experimenting with this today, and came up a with a different version of this change that I think is somewhat cleaner: lopsided98@e1831eb It installs the libraries into $lib/$targetConfig/lib instead of $lib/lib. I tested building pkgsCross.aarch64-multiplatform.hello and pkgsCross.armv7l-hf-multiplatform.hello.

@matthewbauer
Copy link
Member

Closing in favor of #81844.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet