mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-26 00:43:20 +00:00
Merge pull request #271787 from reckenrode/gcc-cross-fix
gcc: Darwin cross-compiler build fixes
This commit is contained in:
commit
3ff9ed03fb
@ -392,7 +392,11 @@ lib.pipe ((callFile ./common/builder.nix {}) ({
|
||||
EXTRA_LDFLAGS_FOR_TARGET
|
||||
;
|
||||
} // optionalAttrs is7 {
|
||||
NIX_CFLAGS_COMPILE = lib.optionalString (stdenv.cc.isClang && langFortran) "-Wno-unused-command-line-argument";
|
||||
NIX_CFLAGS_COMPILE = lib.optionalString (stdenv.cc.isClang && langFortran) "-Wno-unused-command-line-argument"
|
||||
# Downgrade register storage class specifier errors to warnings when building a cross compiler from a clang stdenv.
|
||||
+ lib.optionalString (stdenv.cc.isClang && targetPlatform != hostPlatform) " -Wno-register";
|
||||
} // optionalAttrs (!is7 && !atLeast12 && stdenv.cc.isClang && targetPlatform != hostPlatform) {
|
||||
NIX_CFLAGS_COMPILE = "-Wno-register";
|
||||
} // optionalAttrs (!atLeast7) {
|
||||
inherit langJava;
|
||||
} // optionalAttrs atLeast6 {
|
||||
@ -420,8 +424,10 @@ lib.pipe ((callFile ./common/builder.nix {}) ({
|
||||
;
|
||||
} // lib.optionalAttrs (!atLeast11) {
|
||||
badPlatforms = if !(is48 || is49) then [ "aarch64-darwin" ] else lib.platforms.darwin;
|
||||
} // lib.optionalAttrs is11 {
|
||||
badPlatforms = if targetPlatform != hostPlatform then [ "aarch64-darwin" ] else [ ];
|
||||
};
|
||||
} // 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')
|
||||
|
@ -1,20 +0,0 @@
|
||||
--- a/gcc/config/avr/avr.c 2022-10-08 19:18:33.000000000 +0200
|
||||
+++ b/gcc/config/avr/avr.patched.c 2022-10-08 19:19:34.000000000 +0200
|
||||
@@ -10196,7 +10196,7 @@
|
||||
to track need of __do_copy_data. */
|
||||
|
||||
static void
|
||||
-avr_output_data_section_asm_op (const void *data)
|
||||
+avr_output_data_section_asm_op (const char *data)
|
||||
{
|
||||
avr_need_copy_data_p = true;
|
||||
|
||||
@@ -10209,7 +10209,7 @@
|
||||
to track need of __do_clear_bss. */
|
||||
|
||||
static void
|
||||
-avr_output_bss_section_asm_op (const void *data)
|
||||
+avr_output_bss_section_asm_op (const char *data)
|
||||
{
|
||||
avr_need_clear_bss_p = true;
|
||||
|
@ -175,9 +175,6 @@ in
|
||||
|
||||
## gcc 11.0 and older ##############################################################################
|
||||
|
||||
# https://github.com/osx-cross/homebrew-avr/issues/280#issuecomment-1272381808
|
||||
++ optional (is11 && stdenv.isDarwin && targetPlatform.isAvr) ./avr-gcc-11.3-darwin.patch
|
||||
|
||||
# libgcc’s `configure` script misdetects aarch64-darwin, resulting in an invalid deployment target.
|
||||
++ optional (is11 && stdenv.isDarwin && stdenv.isAarch64) ./11/libgcc-aarch64-darwin-detection.patch
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user