gcc{6,7,8,9}: use target bintools on Darwin

Using the host bintools results in evaluation errors when building an
AVR cross-compiler due to trying to build cctools for AVR.
This commit is contained in:
Randy Eckenrode 2023-12-02 18:32:15 -05:00
parent db20831951
commit fe27958aed
No known key found for this signature in database
GPG Key ID: 64C1CD4EC2A600D9

View File

@ -421,7 +421,7 @@ lib.pipe ((callFile ./common/builder.nix {}) ({
} // lib.optionalAttrs (!atLeast11) {
badPlatforms = if !(is48 || is49) then [ "aarch64-darwin" ] else lib.platforms.darwin;
};
} // lib.optionalAttrs (!atLeast10 && stdenv.hostPlatform.isDarwin) {
} // lib.optionalAttrs (!atLeast10 && stdenv.targetPlatform.isDarwin) {
# GCC <10 requires default cctools `strip` instead of `llvm-strip` used by Darwin bintools.
preBuild = ''
makeFlagsArray+=('STRIP=${lib.getBin darwin.cctools-port}/bin/${stdenv.cc.targetPrefix}strip')