diff --git a/pkgs/development/compilers/gcc/4.8/default.nix b/pkgs/development/compilers/gcc/4.8/default.nix index 06c2aa838c5a..9180e733f3a1 100644 --- a/pkgs/development/compilers/gcc/4.8/default.nix +++ b/pkgs/development/compilers/gcc/4.8/default.nix @@ -101,20 +101,7 @@ let version = "4.8.5"; # Ensure that -print-prog-name is able to find the correct programs. [ "--with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" "--with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" ] ++ - (if crossMingw && crossStageStatic then [ - "--with-headers=${libcCross}/include" - "--with-gcc" - "--with-gnu-as" - "--with-gnu-ld" - "--with-gnu-ld" - "--disable-shared" - "--disable-nls" - "--disable-debug" - "--enable-sjlj-exceptions" - "--enable-threads=win32" - "--disable-win32-registry" - "--disable-libmpx" # requires libc - ] else if crossStageStatic then [ + (if crossStageStatic then [ "--disable-libssp" "--disable-nls" "--without-headers" @@ -125,38 +112,47 @@ let version = "4.8.5"; "--disable-libatomic" # requires libc "--disable-decimal-float" # requires libc "--disable-libmpx" # requires libc + ] ++ optionals crossMingw [ + "--with-headers=${libcCross}/include" + "--with-gcc" + "--with-gnu-as" + "--with-gnu-ld" + "--disable-debug" + "--enable-sjlj-exceptions" + "--disable-win32-registry" ] else [ (if crossDarwin then "--with-sysroot=${getLib libcCross}/share/sysroot" else "--with-headers=${getDev libcCross}${libcCross.incdir or "/include"}") "--enable-__cxa_atexit" "--enable-long-long" - ] ++ - (if crossMingw then [ - "--enable-threads=win32" - "--enable-sjlj-exceptions" - "--enable-hash-synchronization" - "--enable-libssp" - "--disable-nls" - "--with-dwarf2" - # To keep ABI compatibility with upstream mingw-w64 - "--enable-fully-dynamic-string" - ] else - optionals (targetPlatform.libc == "uclibc" || targetPlatform.libc == "musl") [ - # In uclibc cases, libgomp needs an additional '-ldl' - # and as I don't know how to pass it, I disable libgomp. - "--disable-libgomp" - ] - ++ optional (targetPlatform.libc == "newlib") "--with-newlib" - ++ optional (targetPlatform.libc == "avrlibc") "--with-avrlibc" - ++ [ - "--enable-threads=${if targetPlatform.isUnix then "posix" - else if targetPlatform.isWindows then "win32" - else "single"}" - "--enable-nls" - "--disable-decimal-float" # No final libdecnumber (it may work only in 386) - ])); + "--enable-threads=${if targetPlatform.isUnix then "posix" + else if targetPlatform.isWindows then "win32" + else "single"}" + "--enable-nls" + "--disable-decimal-float" # No final libdecnumber (it may work only in 386) + ] ++ optionals (targetPlatform.libc == "uclibc" || targetPlatform.libc == "musl") [ + # libsanitizer requires netrom/netrom.h which is not + # available in uclibc. + "--disable-libsanitizer" + # In uclibc cases, libgomp needs an additional '-ldl' + # and as I don't know how to pass it, I disable libgomp. + "--disable-libgomp" + ] ++ optionals (targetPlatform.libc == "musl") [ + # musl at least, disable: https://git.buildroot.net/buildroot/commit/?id=873d4019f7fb00f6a80592224236b3ba7d657865 + "--disable-libmpx" + ] ++ optionals crossMingw [ + "--enable-sjlj-exceptions" + "--enable-hash-synchronization" + "--enable-libssp" + "--disable-nls" + "--with-dwarf2" + # To keep ABI compatibility with upstream mingw-w64 + "--enable-fully-dynamic-string" + ] ++ optional (targetPlatform.libc == "newlib") "--with-newlib" + ++ optional (targetPlatform.libc == "avrlibc") "--with-avrlibc" + ); stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final"; - crossNameAddon = if targetPlatform != hostPlatform then "${targetPlatform.config}${stageNameAddon}-" else ""; + crossNameAddon = if targetPlatform != hostPlatform then "-${targetPlatform.config}" + stageNameAddon else ""; bootstrap = targetPlatform == hostPlatform; diff --git a/pkgs/development/compilers/gcc/4.9/default.nix b/pkgs/development/compilers/gcc/4.9/default.nix index ebcf20d4e099..fbfb9f202c3f 100644 --- a/pkgs/development/compilers/gcc/4.9/default.nix +++ b/pkgs/development/compilers/gcc/4.9/default.nix @@ -106,20 +106,7 @@ let version = "4.9.4"; # Ensure that -print-prog-name is able to find the correct programs. [ "--with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" "--with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" ] ++ - (if crossMingw && crossStageStatic then [ - "--with-headers=${libcCross}/include" - "--with-gcc" - "--with-gnu-as" - "--with-gnu-ld" - "--with-gnu-ld" - "--disable-shared" - "--disable-nls" - "--disable-debug" - "--enable-sjlj-exceptions" - "--enable-threads=win32" - "--disable-win32-registry" - "--disable-libmpx" # requires libc - ] else if crossStageStatic then [ + (if crossStageStatic then [ "--disable-libssp" "--disable-nls" "--without-headers" @@ -130,41 +117,47 @@ let version = "4.9.4"; "--disable-libatomic" # requires libc "--disable-decimal-float" # requires libc "--disable-libmpx" # requires libc + ] ++ optionals crossMingw [ + "--with-headers=${libcCross}/include" + "--with-gcc" + "--with-gnu-as" + "--with-gnu-ld" + "--disable-debug" + "--enable-sjlj-exceptions" + "--disable-win32-registry" ] else [ (if crossDarwin then "--with-sysroot=${getLib libcCross}/share/sysroot" else "--with-headers=${getDev libcCross}${libcCross.incdir or "/include"}") "--enable-__cxa_atexit" "--enable-long-long" - ] ++ - (if crossMingw then [ - "--enable-threads=win32" - "--enable-sjlj-exceptions" - "--enable-hash-synchronization" - "--enable-libssp" - "--disable-nls" - "--with-dwarf2" - # To keep ABI compatibility with upstream mingw-w64 - "--enable-fully-dynamic-string" - ] else - optionals (targetPlatform.libc == "uclibc" || targetPlatform.libc == "musl") [ - # libsanitizer requires netrom/netrom.h which is not - # available in uclibc. - "--disable-libsanitizer" - # In uclibc cases, libgomp needs an additional '-ldl' - # and as I don't know how to pass it, I disable libgomp. - "--disable-libgomp" - ] - ++ optional (targetPlatform.libc == "newlib") "--with-newlib" - ++ optional (targetPlatform.libc == "avrlibc") "--with-avrlibc" - ++ [ - "--enable-threads=${if targetPlatform.isUnix then "posix" - else if targetPlatform.isWindows then "win32" - else "single"}" - "--enable-nls" - "--disable-decimal-float" # No final libdecnumber (it may work only in 386) - ])); + "--enable-threads=${if targetPlatform.isUnix then "posix" + else if targetPlatform.isWindows then "win32" + else "single"}" + "--enable-nls" + "--disable-decimal-float" # No final libdecnumber (it may work only in 386) + ] ++ optionals (targetPlatform.libc == "uclibc" || targetPlatform.libc == "musl") [ + # libsanitizer requires netrom/netrom.h which is not + # available in uclibc. + "--disable-libsanitizer" + # In uclibc cases, libgomp needs an additional '-ldl' + # and as I don't know how to pass it, I disable libgomp. + "--disable-libgomp" + ] ++ optionals (targetPlatform.libc == "musl") [ + # musl at least, disable: https://git.buildroot.net/buildroot/commit/?id=873d4019f7fb00f6a80592224236b3ba7d657865 + "--disable-libmpx" + ] ++ optionals crossMingw [ + "--enable-sjlj-exceptions" + "--enable-hash-synchronization" + "--enable-libssp" + "--disable-nls" + "--with-dwarf2" + # To keep ABI compatibility with upstream mingw-w64 + "--enable-fully-dynamic-string" + ] ++ optional (targetPlatform.libc == "newlib") "--with-newlib" + ++ optional (targetPlatform.libc == "avrlibc") "--with-avrlibc" + ); stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final"; - crossNameAddon = if targetPlatform != hostPlatform then "${targetPlatform.config}${stageNameAddon}-" else ""; + crossNameAddon = if targetPlatform != hostPlatform then "-${targetPlatform.config}" + stageNameAddon else ""; bootstrap = targetPlatform == hostPlatform; diff --git a/pkgs/development/compilers/gcc/5/default.nix b/pkgs/development/compilers/gcc/5/default.nix index 0adedb6f8420..e034b0e0c548 100644 --- a/pkgs/development/compilers/gcc/5/default.nix +++ b/pkgs/development/compilers/gcc/5/default.nix @@ -93,20 +93,7 @@ let version = "5.5.0"; # Ensure that -print-prog-name is able to find the correct programs. [ "--with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" "--with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" ] ++ - (if crossMingw && crossStageStatic then [ - "--with-headers=${libcCross}/include" - "--with-gcc" - "--with-gnu-as" - "--with-gnu-ld" - "--with-gnu-ld" - "--disable-shared" - "--disable-nls" - "--disable-debug" - "--enable-sjlj-exceptions" - "--enable-threads=win32" - "--disable-win32-registry" - "--disable-libmpx" # requires libc - ] else if crossStageStatic then [ + (if crossStageStatic then [ "--disable-libssp" "--disable-nls" "--without-headers" @@ -117,41 +104,47 @@ let version = "5.5.0"; "--disable-libatomic" # requires libc "--disable-decimal-float" # requires libc "--disable-libmpx" # requires libc + ] ++ optionals crossMingw [ + "--with-headers=${libcCross}/include" + "--with-gcc" + "--with-gnu-as" + "--with-gnu-ld" + "--disable-debug" + "--enable-sjlj-exceptions" + "--disable-win32-registry" ] else [ (if crossDarwin then "--with-sysroot=${getLib libcCross}/share/sysroot" else "--with-headers=${getDev libcCross}${libcCross.incdir or "/include"}") "--enable-__cxa_atexit" "--enable-long-long" - ] ++ - (if crossMingw then [ - "--enable-threads=win32" - "--enable-sjlj-exceptions" - "--enable-hash-synchronization" - "--enable-libssp" - "--disable-nls" - "--with-dwarf2" - # To keep ABI compatibility with upstream mingw-w64 - "--enable-fully-dynamic-string" - ] else - optionals (targetPlatform.libc == "uclibc" || targetPlatform.libc == "musl") [ - # libsanitizer requires netrom/netrom.h which is not - # available in uclibc. - "--disable-libsanitizer" - # In uclibc cases, libgomp needs an additional '-ldl' - # and as I don't know how to pass it, I disable libgomp. - "--disable-libgomp" - ] - ++ optional (targetPlatform.libc == "newlib") "--with-newlib" - ++ optional (targetPlatform.libc == "avrlibc") "--with-avrlibc" - ++ [ - "--enable-threads=${if targetPlatform.isUnix then "posix" - else if targetPlatform.isWindows then "win32" - else "single"}" - "--enable-nls" - "--disable-decimal-float" # No final libdecnumber (it may work only in 386) - ])); + "--enable-threads=${if targetPlatform.isUnix then "posix" + else if targetPlatform.isWindows then "win32" + else "single"}" + "--enable-nls" + "--disable-decimal-float" # No final libdecnumber (it may work only in 386) + ] ++ optionals (targetPlatform.libc == "uclibc" || targetPlatform.libc == "musl") [ + # libsanitizer requires netrom/netrom.h which is not + # available in uclibc. + "--disable-libsanitizer" + # In uclibc cases, libgomp needs an additional '-ldl' + # and as I don't know how to pass it, I disable libgomp. + "--disable-libgomp" + ] ++ optionals (targetPlatform.libc == "musl") [ + # musl at least, disable: https://git.buildroot.net/buildroot/commit/?id=873d4019f7fb00f6a80592224236b3ba7d657865 + "--disable-libmpx" + ] ++ optionals crossMingw [ + "--enable-sjlj-exceptions" + "--enable-hash-synchronization" + "--enable-libssp" + "--disable-nls" + "--with-dwarf2" + # To keep ABI compatibility with upstream mingw-w64 + "--enable-fully-dynamic-string" + ] ++ optional (targetPlatform.libc == "newlib") "--with-newlib" + ++ optional (targetPlatform.libc == "avrlibc") "--with-avrlibc" + ); stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final"; - crossNameAddon = if targetPlatform != hostPlatform then "${targetPlatform.config}${stageNameAddon}-" else ""; + crossNameAddon = if targetPlatform != hostPlatform then "-${targetPlatform.config}" + stageNameAddon else ""; bootstrap = targetPlatform == hostPlatform; diff --git a/pkgs/development/compilers/gcc/6/default.nix b/pkgs/development/compilers/gcc/6/default.nix index 959b5e62381e..001a4a80c0b0 100644 --- a/pkgs/development/compilers/gcc/6/default.nix +++ b/pkgs/development/compilers/gcc/6/default.nix @@ -90,20 +90,7 @@ let version = "6.5.0"; # Ensure that -print-prog-name is able to find the correct programs. [ "--with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" "--with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" ] ++ - (if crossMingw && crossStageStatic then [ - "--with-headers=${libcCross}/include" - "--with-gcc" - "--with-gnu-as" - "--with-gnu-ld" - "--with-gnu-ld" - "--disable-shared" - "--disable-nls" - "--disable-debug" - "--enable-sjlj-exceptions" - "--enable-threads=win32" - "--disable-win32-registry" - "--disable-libmpx" # requires libc - ] else if crossStageStatic then [ + (if crossStageStatic then [ "--disable-libssp" "--disable-nls" "--without-headers" @@ -114,43 +101,47 @@ let version = "6.5.0"; "--disable-libatomic" # requires libc "--disable-decimal-float" # requires libc "--disable-libmpx" # requires libc + ] ++ optionals crossMingw [ + "--with-headers=${libcCross}/include" + "--with-gcc" + "--with-gnu-as" + "--with-gnu-ld" + "--disable-debug" + "--enable-sjlj-exceptions" + "--disable-win32-registry" ] else [ (if crossDarwin then "--with-sysroot=${getLib libcCross}/share/sysroot" else "--with-headers=${getDev libcCross}${libcCross.incdir or "/include"}") "--enable-__cxa_atexit" "--enable-long-long" - ] ++ - (if crossMingw then [ - "--enable-threads=win32" - "--enable-sjlj-exceptions" - "--enable-hash-synchronization" - "--enable-libssp" - "--disable-nls" - "--with-dwarf2" - # To keep ABI compatibility with upstream mingw-w64 - "--enable-fully-dynamic-string" - ] else - optionals (targetPlatform.libc == "uclibc" || targetPlatform.libc == "musl") [ - # libsanitizer requires netrom/netrom.h which is not - # available in uclibc. - "--disable-libsanitizer" - # In uclibc cases, libgomp needs an additional '-ldl' - # and as I don't know how to pass it, I disable libgomp. - "--disable-libgomp" - # musl at least, disable: https://git.buildroot.net/buildroot/commit/?id=873d4019f7fb00f6a80592224236b3ba7d657865 - "--disable-libmpx" - ] - ++ optional (targetPlatform.libc == "newlib") "--with-newlib" - ++ optional (targetPlatform.libc == "avrlibc") "--with-avrlibc" - ++ [ - "--enable-threads=${if targetPlatform.isUnix then "posix" - else if targetPlatform.isWindows then "win32" - else "single"}" - "--enable-nls" - "--disable-decimal-float" # No final libdecnumber (it may work only in 386) - ])); + "--enable-threads=${if targetPlatform.isUnix then "posix" + else if targetPlatform.isWindows then "win32" + else "single"}" + "--enable-nls" + "--disable-decimal-float" # No final libdecnumber (it may work only in 386) + ] ++ optionals (targetPlatform.libc == "uclibc" || targetPlatform.libc == "musl") [ + # libsanitizer requires netrom/netrom.h which is not + # available in uclibc. + "--disable-libsanitizer" + # In uclibc cases, libgomp needs an additional '-ldl' + # and as I don't know how to pass it, I disable libgomp. + "--disable-libgomp" + ] ++ optionals (targetPlatform.libc == "musl") [ + # musl at least, disable: https://git.buildroot.net/buildroot/commit/?id=873d4019f7fb00f6a80592224236b3ba7d657865 + "--disable-libmpx" + ] ++ optionals crossMingw [ + "--enable-sjlj-exceptions" + "--enable-hash-synchronization" + "--enable-libssp" + "--disable-nls" + "--with-dwarf2" + # To keep ABI compatibility with upstream mingw-w64 + "--enable-fully-dynamic-string" + ] ++ optional (targetPlatform.libc == "newlib") "--with-newlib" + ++ optional (targetPlatform.libc == "avrlibc") "--with-avrlibc" + ); stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final"; - crossNameAddon = if targetPlatform != hostPlatform then "${targetPlatform.config}${stageNameAddon}-" else ""; + crossNameAddon = if targetPlatform != hostPlatform then "-${targetPlatform.config}" + stageNameAddon else ""; bootstrap = targetPlatform == hostPlatform; diff --git a/pkgs/development/compilers/gcc/7/default.nix b/pkgs/development/compilers/gcc/7/default.nix index 39b3e4734fe2..656605b5bb26 100644 --- a/pkgs/development/compilers/gcc/7/default.nix +++ b/pkgs/development/compilers/gcc/7/default.nix @@ -68,20 +68,7 @@ let version = "7.4.0"; # Ensure that -print-prog-name is able to find the correct programs. [ "--with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" "--with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" ] ++ - (if crossMingw && crossStageStatic then [ - "--with-headers=${getDev libcCross}${libcCross.incdir or "/include"}" - "--with-gcc" - "--with-gnu-as" - "--with-gnu-ld" - "--with-gnu-ld" - "--disable-shared" - "--disable-nls" - "--disable-debug" - "--enable-sjlj-exceptions" - "--enable-threads=win32" - "--disable-win32-registry" - "--disable-libmpx" # requires libc - ] else if crossStageStatic then [ + (if crossStageStatic then [ "--disable-libssp" "--disable-nls" "--without-headers" @@ -92,44 +79,47 @@ let version = "7.4.0"; "--disable-libatomic" # requires libc "--disable-decimal-float" # requires libc "--disable-libmpx" # requires libc + ] ++ optionals crossMingw [ + "--with-headers=${libcCross}/include" + "--with-gcc" + "--with-gnu-as" + "--with-gnu-ld" + "--disable-debug" + "--enable-sjlj-exceptions" + "--disable-win32-registry" ] else [ (if crossDarwin then "--with-sysroot=${getLib libcCross}/share/sysroot" else "--with-headers=${getDev libcCross}${libcCross.incdir or "/include"}") "--enable-__cxa_atexit" "--enable-long-long" - ] ++ - (if crossMingw then [ - "--enable-threads=win32" - "--enable-sjlj-exceptions" - "--enable-hash-synchronization" - "--enable-libssp" - "--disable-nls" - "--with-dwarf2" - # To keep ABI compatibility with upstream mingw-w64 - "--enable-fully-dynamic-string" - ] else - optionals (targetPlatform.libc == "uclibc" || targetPlatform.libc == "musl") [ - # libsanitizer requires netrom/netrom.h which is not - # available in uclibc. - "--disable-libsanitizer" - # In uclibc cases, libgomp needs an additional '-ldl' - # and as I don't know how to pass it, I disable libgomp. - "--disable-libgomp" - # musl at least, disable: https://git.buildroot.net/buildroot/commit/?id=873d4019f7fb00f6a80592224236b3ba7d657865 - "--disable-libmpx" - ] - ++ optional (targetPlatform.libc == "newlib") "--with-newlib" - ++ optional (targetPlatform.libc == "avrlibc") "--with-avrlibc" - ++ [ - "--enable-threads=${if targetPlatform.isUnix then "posix" - else if targetPlatform.isWindows then "win32" - else "single"}" - "--enable-nls" - # No final libdecnumber (it may work only in 386) - "--disable-decimal-float" - ])); + "--enable-threads=${if targetPlatform.isUnix then "posix" + else if targetPlatform.isWindows then "win32" + else "single"}" + "--enable-nls" + "--disable-decimal-float" # No final libdecnumber (it may work only in 386) + ] ++ optionals (targetPlatform.libc == "uclibc" || targetPlatform.libc == "musl") [ + # libsanitizer requires netrom/netrom.h which is not + # available in uclibc. + "--disable-libsanitizer" + # In uclibc cases, libgomp needs an additional '-ldl' + # and as I don't know how to pass it, I disable libgomp. + "--disable-libgomp" + ] ++ optionals (targetPlatform.libc == "musl") [ + # musl at least, disable: https://git.buildroot.net/buildroot/commit/?id=873d4019f7fb00f6a80592224236b3ba7d657865 + "--disable-libmpx" + ] ++ optionals crossMingw [ + "--enable-sjlj-exceptions" + "--enable-hash-synchronization" + "--enable-libssp" + "--disable-nls" + "--with-dwarf2" + # To keep ABI compatibility with upstream mingw-w64 + "--enable-fully-dynamic-string" + ] ++ optional (targetPlatform.libc == "newlib") "--with-newlib" + ++ optional (targetPlatform.libc == "avrlibc") "--with-avrlibc" + ); stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final"; - crossNameAddon = if targetPlatform != hostPlatform then "${targetPlatform.config}${stageNameAddon}-" else ""; + crossNameAddon = if targetPlatform != hostPlatform then "-${targetPlatform.config}" + stageNameAddon else ""; bootstrap = targetPlatform == hostPlatform; diff --git a/pkgs/development/compilers/gcc/8/default.nix b/pkgs/development/compilers/gcc/8/default.nix index 52f568b2ed94..dd03e6f04cfa 100644 --- a/pkgs/development/compilers/gcc/8/default.nix +++ b/pkgs/development/compilers/gcc/8/default.nix @@ -60,20 +60,7 @@ let version = "8.3.0"; # Ensure that -print-prog-name is able to find the correct programs. [ "--with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" "--with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" ] ++ - (if crossMingw && crossStageStatic then [ - "--with-headers=${libcCross}/include" - "--with-gcc" - "--with-gnu-as" - "--with-gnu-ld" - "--with-gnu-ld" - "--disable-shared" - "--disable-nls" - "--disable-debug" - "--enable-sjlj-exceptions" - "--enable-threads=win32" - "--disable-win32-registry" - "--disable-libmpx" # requires libc - ] else if crossStageStatic then [ + (if crossStageStatic then [ "--disable-libssp" "--disable-nls" "--without-headers" @@ -84,41 +71,45 @@ let version = "8.3.0"; "--disable-libatomic" # requires libc "--disable-decimal-float" # requires libc "--disable-libmpx" # requires libc + ] ++ optionals crossMingw [ + "--with-headers=${libcCross}/include" + "--with-gcc" + "--with-gnu-as" + "--with-gnu-ld" + "--disable-debug" + "--enable-sjlj-exceptions" + "--disable-win32-registry" ] else [ (if crossDarwin then "--with-sysroot=${getLib libcCross}/share/sysroot" else "--with-headers=${getDev libcCross}${libcCross.incdir or "/include"}") "--enable-__cxa_atexit" "--enable-long-long" - ] ++ - (if crossMingw then [ - "--enable-threads=win32" - "--enable-sjlj-exceptions" - "--enable-hash-synchronization" - "--enable-libssp" - "--disable-nls" - "--with-dwarf2" - # To keep ABI compatibility with upstream mingw-w64 - "--enable-fully-dynamic-string" - ] else - optionals (targetPlatform.libc == "uclibc" || targetPlatform.libc == "musl") [ - # libsanitizer requires netrom/netrom.h which is not - # available in uclibc. - "--disable-libsanitizer" - # In uclibc cases, libgomp needs an additional '-ldl' - # and as I don't know how to pass it, I disable libgomp. - "--disable-libgomp" - # musl at least, disable: https://git.buildroot.net/buildroot/commit/?id=873d4019f7fb00f6a80592224236b3ba7d657865 - "--disable-libmpx" - ] - ++ optional (targetPlatform.libc == "newlib") "--with-newlib" - ++ optional (targetPlatform.libc == "avrlibc") "--with-avrlibc" - ++ [ - "--enable-threads=${if targetPlatform.isUnix then "posix" - else if targetPlatform.isWindows then "win32" - else "single"}" - "--enable-nls" - "--disable-decimal-float" # No final libdecnumber (it may work only in 386) - ])); + "--enable-threads=${if targetPlatform.isUnix then "posix" + else if targetPlatform.isWindows then "win32" + else "single"}" + "--enable-nls" + "--disable-decimal-float" # No final libdecnumber (it may work only in 386) + ] ++ optionals (targetPlatform.libc == "uclibc" || targetPlatform.libc == "musl") [ + # libsanitizer requires netrom/netrom.h which is not + # available in uclibc. + "--disable-libsanitizer" + # In uclibc cases, libgomp needs an additional '-ldl' + # and as I don't know how to pass it, I disable libgomp. + "--disable-libgomp" + ] ++ optionals (targetPlatform.libc == "musl") [ + # musl at least, disable: https://git.buildroot.net/buildroot/commit/?id=873d4019f7fb00f6a80592224236b3ba7d657865 + "--disable-libmpx" + ] ++ optionals crossMingw [ + "--enable-sjlj-exceptions" + "--enable-hash-synchronization" + "--enable-libssp" + "--disable-nls" + "--with-dwarf2" + # To keep ABI compatibility with upstream mingw-w64 + "--enable-fully-dynamic-string" + ] ++ optional (targetPlatform.libc == "newlib") "--with-newlib" + ++ optional (targetPlatform.libc == "avrlibc") "--with-avrlibc" + ); stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final"; crossNameAddon = if targetPlatform != hostPlatform then "-${targetPlatform.config}" + stageNameAddon else ""; @@ -127,7 +118,7 @@ let version = "8.3.0"; in stdenv.mkDerivation ({ - name = "${name}${if stripped then "" else "-debug"}-${version}" + crossNameAddon; + name = crossNameAddon + "${name}${if stripped then "" else "-debug"}-${version}"; builder = ../builder.sh; diff --git a/pkgs/development/compilers/gcc/9/default.nix b/pkgs/development/compilers/gcc/9/default.nix index de4d893b99e2..013409393b51 100644 --- a/pkgs/development/compilers/gcc/9/default.nix +++ b/pkgs/development/compilers/gcc/9/default.nix @@ -58,20 +58,7 @@ let version = "9.2.0"; # Ensure that -print-prog-name is able to find the correct programs. [ "--with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" "--with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" ] ++ - (if crossMingw && crossStageStatic then [ - "--with-headers=${libcCross}/include" - "--with-gcc" - "--with-gnu-as" - "--with-gnu-ld" - "--with-gnu-ld" - "--disable-shared" - "--disable-nls" - "--disable-debug" - "--enable-sjlj-exceptions" - "--enable-threads=win32" - "--disable-win32-registry" - "--disable-libmpx" # requires libc - ] else if crossStageStatic then [ + (if crossStageStatic then [ "--disable-libssp" "--disable-nls" "--without-headers" @@ -82,41 +69,45 @@ let version = "9.2.0"; "--disable-libatomic" # requires libc "--disable-decimal-float" # requires libc "--disable-libmpx" # requires libc + ] ++ optionals crossMingw [ + "--with-headers=${libcCross}/include" + "--with-gcc" + "--with-gnu-as" + "--with-gnu-ld" + "--disable-debug" + "--enable-sjlj-exceptions" + "--disable-win32-registry" ] else [ (if crossDarwin then "--with-sysroot=${getLib libcCross}/share/sysroot" else "--with-headers=${getDev libcCross}${libcCross.incdir or "/include"}") "--enable-__cxa_atexit" "--enable-long-long" - ] ++ - (if crossMingw then [ - "--enable-threads=win32" - "--enable-sjlj-exceptions" - "--enable-hash-synchronization" - "--enable-libssp" - "--disable-nls" - "--with-dwarf2" - # To keep ABI compatibility with upstream mingw-w64 - "--enable-fully-dynamic-string" - ] else - optionals (targetPlatform.libc == "uclibc" || targetPlatform.libc == "musl") [ - # libsanitizer requires netrom/netrom.h which is not - # available in uclibc. - "--disable-libsanitizer" - # In uclibc cases, libgomp needs an additional '-ldl' - # and as I don't know how to pass it, I disable libgomp. - "--disable-libgomp" - # musl at least, disable: https://git.buildroot.net/buildroot/commit/?id=873d4019f7fb00f6a80592224236b3ba7d657865 - "--disable-libmpx" - ] - ++ optional (targetPlatform.libc == "newlib") "--with-newlib" - ++ optional (targetPlatform.libc == "avrlibc") "--with-avrlibc" - ++ [ - "--enable-threads=${if targetPlatform.isUnix then "posix" - else if targetPlatform.isWindows then "win32" - else "single"}" - "--enable-nls" - "--disable-decimal-float" # No final libdecnumber (it may work only in 386) - ])); + "--enable-threads=${if targetPlatform.isUnix then "posix" + else if targetPlatform.isWindows then "win32" + else "single"}" + "--enable-nls" + "--disable-decimal-float" # No final libdecnumber (it may work only in 386) + ] ++ optionals (targetPlatform.libc == "uclibc" || targetPlatform.libc == "musl") [ + # libsanitizer requires netrom/netrom.h which is not + # available in uclibc. + "--disable-libsanitizer" + # In uclibc cases, libgomp needs an additional '-ldl' + # and as I don't know how to pass it, I disable libgomp. + "--disable-libgomp" + ] ++ optionals (targetPlatform.libc == "musl") [ + # musl at least, disable: https://git.buildroot.net/buildroot/commit/?id=873d4019f7fb00f6a80592224236b3ba7d657865 + "--disable-libmpx" + ] ++ optionals crossMingw [ + "--enable-sjlj-exceptions" + "--enable-hash-synchronization" + "--enable-libssp" + "--disable-nls" + "--with-dwarf2" + # To keep ABI compatibility with upstream mingw-w64 + "--enable-fully-dynamic-string" + ] ++ optional (targetPlatform.libc == "newlib") "--with-newlib" + ++ optional (targetPlatform.libc == "avrlibc") "--with-avrlibc" + ); stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final"; crossNameAddon = if targetPlatform != hostPlatform then "-${targetPlatform.config}" + stageNameAddon else ""; @@ -125,7 +116,7 @@ let version = "9.2.0"; in stdenv.mkDerivation ({ - name = "${name}${if stripped then "" else "-debug"}-${version}" + crossNameAddon; + name = crossNameAddon + "${name}${if stripped then "" else "-debug"}-${version}"; builder = ../builder.sh; diff --git a/pkgs/development/compilers/gcc/snapshot/default.nix b/pkgs/development/compilers/gcc/snapshot/default.nix index a07f6f1feb2f..b04094a1a9b4 100644 --- a/pkgs/development/compilers/gcc/snapshot/default.nix +++ b/pkgs/development/compilers/gcc/snapshot/default.nix @@ -55,20 +55,7 @@ let version = "7-20170409"; # Ensure that -print-prog-name is able to find the correct programs. [ "--with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" "--with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" ] ++ - (if crossMingw && crossStageStatic then [ - "--with-headers=${libcCross}/include" - "--with-gcc" - "--with-gnu-as" - "--with-gnu-ld" - "--with-gnu-ld" - "--disable-shared" - "--disable-nls" - "--disable-debug" - "--enable-sjlj-exceptions" - "--enable-threads=win32" - "--disable-win32-registry" - "--disable-libmpx" # requires libc - ] else if crossStageStatic then [ + (if crossStageStatic then [ "--disable-libssp" "--disable-nls" "--without-headers" @@ -79,39 +66,45 @@ let version = "7-20170409"; "--disable-libatomic" # requires libc "--disable-decimal-float" # requires libc "--disable-libmpx" # requires libc + ] ++ optionals crossMingw [ + "--with-headers=${libcCross}/include" + "--with-gcc" + "--with-gnu-as" + "--with-gnu-ld" + "--disable-debug" + "--enable-sjlj-exceptions" + "--disable-win32-registry" ] else [ (if crossDarwin then "--with-sysroot=${getLib libcCross}/share/sysroot" - else "--with-headers=${getDev libcCross}/include") + else "--with-headers=${getDev libcCross}${libcCross.incdir or "/include"}") "--enable-__cxa_atexit" "--enable-long-long" - ] ++ - (if crossMingw then [ - "--enable-threads=win32" - "--enable-sjlj-exceptions" - "--enable-hash-synchronization" - "--enable-libssp" - "--disable-nls" - "--with-dwarf2" - # To keep ABI compatibility with upstream mingw-w64 - "--enable-fully-dynamic-string" - ] else - optionals (targetPlatform.libc == "uclibc") [ - # libsanitizer requires netrom/netrom.h which is not - # available in uclibc. - "--disable-libsanitizer" - # In uclibc cases, libgomp needs an additional '-ldl' - # and as I don't know how to pass it, I disable libgomp. - "--disable-libgomp" - ] - ++ optional (targetPlatform.libc == "newlib") "--with-newlib" - ++ optional (targetPlatform.libc == "avrlibc") "--with-avrlibc" - ++ [ - "--enable-threads=${if targetPlatform.isUnix then "posix" - else if targetPlatform.isWindows then "win32" - else "single"}" - "--enable-nls" - "--disable-decimal-float" # No final libdecnumber (it may work only in 386) - ])); + "--enable-threads=${if targetPlatform.isUnix then "posix" + else if targetPlatform.isWindows then "win32" + else "single"}" + "--enable-nls" + "--disable-decimal-float" # No final libdecnumber (it may work only in 386) + ] ++ optionals (targetPlatform.libc == "uclibc" || targetPlatform.libc == "musl") [ + # libsanitizer requires netrom/netrom.h which is not + # available in uclibc. + "--disable-libsanitizer" + # In uclibc cases, libgomp needs an additional '-ldl' + # and as I don't know how to pass it, I disable libgomp. + "--disable-libgomp" + ] ++ optionals (targetPlatform.libc == "musl") [ + # musl at least, disable: https://git.buildroot.net/buildroot/commit/?id=873d4019f7fb00f6a80592224236b3ba7d657865 + "--disable-libmpx" + ] ++ optionals crossMingw [ + "--enable-sjlj-exceptions" + "--enable-hash-synchronization" + "--enable-libssp" + "--disable-nls" + "--with-dwarf2" + # To keep ABI compatibility with upstream mingw-w64 + "--enable-fully-dynamic-string" + ] ++ optional (targetPlatform.libc == "newlib") "--with-newlib" + ++ optional (targetPlatform.libc == "avrlibc") "--with-avrlibc" + ); stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final"; crossNameAddon = if targetPlatform != hostPlatform then "-${targetPlatform.config}" + stageNameAddon else ""; @@ -120,7 +113,7 @@ let version = "7-20170409"; in stdenv.mkDerivation ({ - name = "${name}${if stripped then "" else "-debug"}-${version}" + crossNameAddon; + name = crossNameAddon + "${name}${if stripped then "" else "-debug"}-${version}"; builder = ../builder.sh;