Noticed the unwrapped binary leak in when built enchant1 with config.configurePlatformsByDefault = true; (pass --host= for native builds). There linkage fails because CC=x86_64-unknown-linux-gnu-gcc points to unwrapped binary:
$ ls /nix/store/5k57n0irf29smr12ib721dzh2ffqwlp6-gcc-wrapper-13.0.0/bin
as c++ cc cpp g++ gcc ld ld.bfd ld.gold strip
$ ls /nix/store/fzwli194jbp7dv9s874sd6pn318q6h3c-gcc-13.0.0/bin
c++ g++ gcc-ar gcc-ranlib gcov-dump lto-dump x86_64-unknown-linux-gnu-g++ x86_64-unknown-linux-gnu-gcc-13.0.0 x86_64-unknown-linux-gnu-gcc-nm
cpp gcc gcc-nm gcov gcov-tool x86_64-unknown-linux-gnu-c++ x86_64-unknown-linux-gnu-gcc x86_64-unknown-linux-gnu-gcc-ar x86_64-unknown-linux-gnu-gcc-ranlib
--host=${target} effectively flips CC from gcc-wrapper to gcc. I'm surprised there is that little breakage. I'd say gcc-wrapper should always provide both gcc (& co) and ${target}-gcc (& co).
Proposal: install ${target}-gcc for native wrappers along with gcc.
Optionally we can disable unprefixed tools as suggested by the TODO:
|
# TODO(@Ericson2314) Make unconditional, or optional but always true by |
|
# default. |
|
targetPrefix = lib.optionalString (targetPlatform != hostPlatform) |
|
(targetPlatform.config + "-"); |
. But that will surely be a big breaking change. Better guard it under a flag initially.
Noticed the unwrapped binary leak in when built
enchant1withconfig.configurePlatformsByDefault = true;(pass--host=for native builds). There linkage fails becauseCC=x86_64-unknown-linux-gnu-gccpoints to unwrapped binary:--host=${target}effectively flips CC fromgcc-wrappertogcc. I'm surprised there is that little breakage. I'd saygcc-wrappershould always provide bothgcc(& co) and${target}-gcc(& co).Proposal: install
${target}-gccfor native wrappers along withgcc.Optionally we can disable unprefixed tools as suggested by the TODO:
nixpkgs/pkgs/build-support/cc-wrapper/default.nix
Lines 37 to 40 in 7b185e0