Hey, > Congrats on this, Mathieu! Thank you :) > Perhaps add “Fixes .” Well I think it doesn't. In the bug report 39941, I reported a recent increase of the cross-compiled disk-image on core-updates (1.5 -> 2.0 GiB), over the last two months. It is not resolved, and this patch fixes something that has always been around I guess. >> + ;; TOOLDIR_BASE_PREFIX is erroneous when using a separate "lib" >> + ;; output. Specify it correctly, otherwise GCC won't find its shared >> + ;; libraries installed in the "lib" output. > > How erroneous is it? Is there a bug report we could link to? I didn't find any bug report related. The issue is that in gcc/Makefile.in, when computing libsubdir_to_prefix: --8<---------------cut here---------------start------------->8--- libsubdir_to_prefix := \ $(unlibsubdir)/$(shell echo "$(libdir)" | \ sed -e 's|^$(prefix)||' -e 's|/$$||' -e 's|^[^/]|/|' \ -e 's|/[^/]*|../|g') --8<---------------cut here---------------end--------------->8--- unlibsubdir is ../../../ libdir /gnu/store/xxx-gcc-cross-aarch64-linux-gnu-7.5.0-lib/lib prefix is /gnu/store/yyy-gcc-cross-aarch64-linux-gnu-7.5.0 then, libsubdir_to_prefix = ../../../../../.. Which then gives a search path that looks like: /gnu/store/5qh73asm77554wj43z2wjdrkl3fjxxbp-gcc-cross-aarch64-linux-gnu-7.5.0-lib/lib/gcc/aarch64-linux-gnu/7.5.0/../../../../../../../aarch64-linux-gnu/lib/aarch64-linux-gnu/7.5.0/ So its just that this hack is completely broken for non FHS compliant path I guess. Note that on our native toolchain, we have the same issue. If you run: --8<---------------cut here---------------start------------->8--- `guix build -e '(@@ (gnu packages gcc) gcc-9)'|tail -1`/bin/gcc -print-search-dirs --8<---------------cut here---------------end--------------->8--- You can see the same kind of wrong path: --8<---------------cut here---------------start------------->8--- /gnu/store/347y0zr1a9s2f5pkcncgi3gd0r33qq81-gcc-9.2.0-lib/lib/gcc/x86_64-unknown-linux-gnu/9.2.0/../../../../../../../x86_64-unknown-linux-gnu/lib/x86_64-unknown-linux-gnu/9.2.0/ --8<---------------cut here---------------end--------------->8--- and it still works, because of this snippet in GCC, disabled when cross-compiling: --8<---------------cut here---------------start------------->8--- else if (*cross_compile == '0') { add_prefix (&startfile_prefixes, concat (gcc_exec_prefix ? gcc_exec_prefix : standard_exec_prefix, machine_suffix, standard_startfile_prefix, NULL), NULL, PREFIX_PRIORITY_LAST, 0, 1); } --8<---------------cut here---------------end--------------->8--- that produces an extra search-path that looks like: --8<---------------cut here---------------start------------->8--- /gnu/store/347y0zr1a9s2f5pkcncgi3gd0r33qq81-gcc-9.2.0-lib/lib/gcc/x86_64-unknown-linux-gnu/9.2.0/../../../ --8<---------------cut here---------------end--------------->8--- In short, quite a big mess... > Apologies for suggesting some more tedious work, but I think it’ll be > helpful! :-) Hehe no worries, here's an updated patch :) Mathieu