diff --git a/pkgs/development/compilers/gcc/10/default.nix b/pkgs/development/compilers/gcc/10/default.nix index 1c223fa82f4a8..dbfdbb79be995 100644 --- a/pkgs/development/compilers/gcc/10/default.nix +++ b/pkgs/development/compilers/gcc/10/default.nix @@ -188,7 +188,7 @@ stdenv.mkDerivation ({ preConfigure = import ../common/pre-configure.nix { inherit lib; - inherit version targetPlatform hostPlatform gnatboot langAda langGo langJit crossStageStatic; + inherit version targetPlatform hostPlatform gnatboot langAda langGo langJit crossStageStatic enableMultilib; }; dontDisableStatic = true; @@ -268,8 +268,6 @@ stdenv.mkDerivation ({ enableParallelBuilding = true; inherit enableMultilib enableShared; - inherit (stdenv) is64bit; - meta = { homepage = "https://gcc.gnu.org/"; license = lib.licenses.gpl3Plus; # runtime support libraries are typically LGPLv3+ diff --git a/pkgs/development/compilers/gcc/11/default.nix b/pkgs/development/compilers/gcc/11/default.nix index ca3a89af1806c..4da2ccd25afd5 100644 --- a/pkgs/development/compilers/gcc/11/default.nix +++ b/pkgs/development/compilers/gcc/11/default.nix @@ -196,7 +196,7 @@ stdenv.mkDerivation ({ preConfigure = import ../common/pre-configure.nix { inherit lib; - inherit version targetPlatform hostPlatform gnatboot langAda langGo langJit crossStageStatic; + inherit version targetPlatform hostPlatform gnatboot langAda langGo langJit crossStageStatic enableMultilib; }; dontDisableStatic = true; @@ -276,8 +276,6 @@ stdenv.mkDerivation ({ enableParallelBuilding = true; inherit enableShared enableMultilib; - inherit (stdenv) is64bit; - meta = { homepage = "https://gcc.gnu.org/"; license = lib.licenses.gpl3Plus; # runtime support libraries are typically LGPLv3+ diff --git a/pkgs/development/compilers/gcc/12/default.nix b/pkgs/development/compilers/gcc/12/default.nix index 6fdc31079a899..f350ee13f3051 100644 --- a/pkgs/development/compilers/gcc/12/default.nix +++ b/pkgs/development/compilers/gcc/12/default.nix @@ -191,7 +191,7 @@ stdenv.mkDerivation ({ preConfigure = import ../common/pre-configure.nix { inherit lib; - inherit version targetPlatform hostPlatform gnatboot langAda langGo langJit crossStageStatic; + inherit version targetPlatform hostPlatform gnatboot langAda langGo langJit crossStageStatic enableMultilib; }; dontDisableStatic = true; @@ -271,8 +271,6 @@ stdenv.mkDerivation ({ enableParallelBuilding = true; inherit enableShared enableMultilib; - inherit (stdenv) is64bit; - meta = { homepage = "https://gcc.gnu.org/"; license = lib.licenses.gpl3Plus; # runtime support libraries are typically LGPLv3+ diff --git a/pkgs/development/compilers/gcc/4.8/default.nix b/pkgs/development/compilers/gcc/4.8/default.nix index bc93d6e135857..ffccf6686f37d 100644 --- a/pkgs/development/compilers/gcc/4.8/default.nix +++ b/pkgs/development/compilers/gcc/4.8/default.nix @@ -195,7 +195,7 @@ stdenv.mkDerivation ({ preConfigure = import ../common/pre-configure.nix { inherit lib; - inherit version targetPlatform hostPlatform langJava langGo crossStageStatic; + inherit version targetPlatform hostPlatform langJava langGo crossStageStatic enableMultilib; }; dontDisableStatic = true; @@ -291,8 +291,6 @@ stdenv.mkDerivation ({ enableParallelBuilding = true; inherit enableShared enableMultilib; - inherit (stdenv) is64bit; - meta = { homepage = "https://gcc.gnu.org/"; license = lib.licenses.gpl3Plus; # runtime support libraries are typically LGPLv3+ diff --git a/pkgs/development/compilers/gcc/4.9/default.nix b/pkgs/development/compilers/gcc/4.9/default.nix index cc675de22549a..a51887ec54e0d 100644 --- a/pkgs/development/compilers/gcc/4.9/default.nix +++ b/pkgs/development/compilers/gcc/4.9/default.nix @@ -215,7 +215,7 @@ stdenv.mkDerivation ({ preConfigure = import ../common/pre-configure.nix { inherit lib; - inherit version targetPlatform hostPlatform langJava langGo crossStageStatic; + inherit version targetPlatform hostPlatform langJava langGo crossStageStatic enableMultilib; }; dontDisableStatic = true; @@ -310,8 +310,6 @@ stdenv.mkDerivation ({ enableParallelBuilding = true; inherit enableShared enableMultilib; - inherit (stdenv) is64bit; - meta = { homepage = "https://gcc.gnu.org/"; license = lib.licenses.gpl3Plus; # runtime support libraries are typically LGPLv3+ diff --git a/pkgs/development/compilers/gcc/6/default.nix b/pkgs/development/compilers/gcc/6/default.nix index d108dc11f18c1..20d09da550b0b 100644 --- a/pkgs/development/compilers/gcc/6/default.nix +++ b/pkgs/development/compilers/gcc/6/default.nix @@ -227,7 +227,7 @@ stdenv.mkDerivation ({ preConfigure = import ../common/pre-configure.nix { inherit lib; - inherit version targetPlatform hostPlatform gnatboot langJava langAda langGo crossStageStatic; + inherit version targetPlatform hostPlatform gnatboot langJava langAda langGo crossStageStatic enableMultilib; }; dontDisableStatic = true; @@ -322,8 +322,6 @@ stdenv.mkDerivation ({ enableParallelBuilding = true; inherit enableShared enableMultilib; - inherit (stdenv) is64bit; - meta = { homepage = "https://gcc.gnu.org/"; license = lib.licenses.gpl3Plus; # runtime support libraries are typically LGPLv3+ diff --git a/pkgs/development/compilers/gcc/7/default.nix b/pkgs/development/compilers/gcc/7/default.nix index e4e1f2038de54..d25b6489318ff 100644 --- a/pkgs/development/compilers/gcc/7/default.nix +++ b/pkgs/development/compilers/gcc/7/default.nix @@ -194,7 +194,7 @@ stdenv.mkDerivation ({ preConfigure = import ../common/pre-configure.nix { inherit lib; - inherit version targetPlatform hostPlatform langGo crossStageStatic; + inherit version targetPlatform hostPlatform langGo crossStageStatic enableMultilib; }; dontDisableStatic = true; @@ -276,8 +276,6 @@ stdenv.mkDerivation ({ enableParallelBuilding = true; inherit enableShared enableMultilib; - inherit (stdenv) is64bit; - meta = { homepage = "https://gcc.gnu.org/"; license = lib.licenses.gpl3Plus; # runtime support libraries are typically LGPLv3+ diff --git a/pkgs/development/compilers/gcc/8/default.nix b/pkgs/development/compilers/gcc/8/default.nix index 7e94ec61c6b7e..9f5c416e83245 100644 --- a/pkgs/development/compilers/gcc/8/default.nix +++ b/pkgs/development/compilers/gcc/8/default.nix @@ -177,7 +177,7 @@ stdenv.mkDerivation ({ preConfigure = import ../common/pre-configure.nix { inherit lib; - inherit version targetPlatform hostPlatform langGo crossStageStatic; + inherit version targetPlatform hostPlatform langGo crossStageStatic enableMultilib; }; dontDisableStatic = true; @@ -255,8 +255,6 @@ stdenv.mkDerivation ({ enableParallelBuilding = true; inherit enableShared enableMultilib; - inherit (stdenv) is64bit; - meta = { homepage = "https://gcc.gnu.org/"; license = lib.licenses.gpl3Plus; # runtime support libraries are typically LGPLv3+ diff --git a/pkgs/development/compilers/gcc/9/default.nix b/pkgs/development/compilers/gcc/9/default.nix index 707ead542f06b..82cb4c067a53d 100644 --- a/pkgs/development/compilers/gcc/9/default.nix +++ b/pkgs/development/compilers/gcc/9/default.nix @@ -190,7 +190,7 @@ stdenv.mkDerivation ({ preConfigure = import ../common/pre-configure.nix { inherit lib; - inherit version targetPlatform hostPlatform gnatboot langAda langGo langJit crossStageStatic; + inherit version targetPlatform hostPlatform gnatboot langAda langGo langJit crossStageStatic enableMultilib; }; dontDisableStatic = true; @@ -270,8 +270,6 @@ stdenv.mkDerivation ({ enableParallelBuilding = true; inherit enableShared enableMultilib; - inherit (stdenv) is64bit; - meta = { homepage = "https://gcc.gnu.org/"; license = lib.licenses.gpl3Plus; # runtime support libraries are typically LGPLv3+ diff --git a/pkgs/development/compilers/gcc/builder.sh b/pkgs/development/compilers/gcc/builder.sh index a9b33d9a3e4f5..c73e9e0c10759 100644 --- a/pkgs/development/compilers/gcc/builder.sh +++ b/pkgs/development/compilers/gcc/builder.sh @@ -193,10 +193,15 @@ preInstall() { mkdir -p "$out/${targetConfig}/lib" mkdir -p "${!outputLib}/${targetConfig}/lib" # Make ‘lib64’ symlinks to ‘lib’. - if [ -n "$is64bit" -a -z "$enableMultilib" ]; then + if [ -n "$linkLib64toLib" ]; then ln -s lib "$out/${targetConfig}/lib64" ln -s lib "${!outputLib}/${targetConfig}/lib64" fi + # Make ‘lib32’ symlinks to ‘lib’. + if [ -n "$linkLib32toLib" ]; then + ln -s lib "$out/${targetConfig}/lib32" + ln -s lib "${!outputLib}/${targetConfig}/lib32" + fi } diff --git a/pkgs/development/compilers/gcc/common/pre-configure.nix b/pkgs/development/compilers/gcc/common/pre-configure.nix index 180d5f16e91f9..ae5ffe6ab0d03 100644 --- a/pkgs/development/compilers/gcc/common/pre-configure.nix +++ b/pkgs/development/compilers/gcc/common/pre-configure.nix @@ -5,6 +5,7 @@ , langJit ? false , langGo , crossStageStatic +, enableMultilib }: assert langJava -> lib.versionOlder version "7"; @@ -78,3 +79,17 @@ in lib.optionalString (hostPlatform.isSunOS && hostPlatform.is64bit) '' + lib.optionalString (targetPlatform != hostPlatform && crossStageStatic) '' export inhibit_libc=true '' + ++ lib.optionalString (!enableMultilib && hostPlatform.is64bit && !hostPlatform.isMips64n32) '' + export linkLib64toLib=1 +'' + +# On mips platforms, gcc follows the IRIX naming convention: +# +# $PREFIX/lib = mips32 +# $PREFIX/lib32 = mips64n32 +# $PREFIX/lib64 = mips64 +# ++ lib.optionalString (!enableMultilib && targetPlatform.isMips64n32) '' + export linkLib32toLib=1 +''