diff --git a/pkgs/development/compilers/gcc/10/default.nix b/pkgs/development/compilers/gcc/10/default.nix index 4ff7c18ab80d..d00d428a6950 100644 --- a/pkgs/development/compilers/gcc/10/default.nix +++ b/pkgs/development/compilers/gcc/10/default.nix @@ -8,12 +8,7 @@ , profiledCompiler ? false , langJit ? false , staticCompiler ? false -, # N.B. the defult is intentionally not from an `isStatic`. See - # https://gcc.gnu.org/install/configure.html - this is about target - # platform libraries not host platform ones unlike normal. But since - # we can't rebuild those without also rebuilding the compiler itself, - # we opt to always build everything unlike our usual policy. - enableShared ? true +, enableShared ? !stdenv.targetPlatform.isStatic , enableLTO ? !stdenv.hostPlatform.isStatic , texinfo ? null , perl ? null # optional, for texi2pod (then pod2man) @@ -266,7 +261,7 @@ stdenv.mkDerivation ({ }; enableParallelBuilding = true; - inherit enableMultilib; + inherit enableMultilib enableShared; inherit (stdenv) is64bit; diff --git a/pkgs/development/compilers/gcc/11/default.nix b/pkgs/development/compilers/gcc/11/default.nix index b78ca339fb85..79e682e88c4e 100644 --- a/pkgs/development/compilers/gcc/11/default.nix +++ b/pkgs/development/compilers/gcc/11/default.nix @@ -8,12 +8,7 @@ , profiledCompiler ? false , langJit ? false , staticCompiler ? false -, # N.B. the defult is intentionally not from an `isStatic`. See - # https://gcc.gnu.org/install/configure.html - this is about target - # platform libraries not host platform ones unlike normal. But since - # we can't rebuild those without also rebuilding the compiler itself, - # we opt to always build everything unlike our usual policy. - enableShared ? true +, enableShared ? !stdenv.targetPlatform.isStatic , enableLTO ? !stdenv.hostPlatform.isStatic , texinfo ? null , perl ? null # optional, for texi2pod (then pod2man) @@ -269,7 +264,7 @@ stdenv.mkDerivation ({ }; enableParallelBuilding = true; - inherit enableMultilib; + inherit enableShared enableMultilib; inherit (stdenv) is64bit; diff --git a/pkgs/development/compilers/gcc/4.8/default.nix b/pkgs/development/compilers/gcc/4.8/default.nix index bc7868cc4606..ef1a04635f9a 100644 --- a/pkgs/development/compilers/gcc/4.8/default.nix +++ b/pkgs/development/compilers/gcc/4.8/default.nix @@ -8,12 +8,7 @@ , profiledCompiler ? false , langJit ? false , staticCompiler ? false -, # N.B. the defult is intentionally not from an `isStatic`. See - # https://gcc.gnu.org/install/configure.html - this is about target - # platform libraries not host platform ones unlike normal. But since - # we can't rebuild those without also rebuilding the compiler itself, - # we opt to always build everything unlike our usual policy. - enableShared ? true +, enableShared ? !stdenv.targetPlatform.isStatic , enableLTO ? !stdenv.hostPlatform.isStatic , texinfo ? null , perl ? null # optional, for texi2pod (then pod2man); required for Java @@ -295,7 +290,7 @@ stdenv.mkDerivation ({ }; enableParallelBuilding = true; - inherit enableMultilib; + inherit enableShared enableMultilib; inherit (stdenv) is64bit; diff --git a/pkgs/development/compilers/gcc/4.9/default.nix b/pkgs/development/compilers/gcc/4.9/default.nix index bb1a3dd7d636..289df07d0312 100644 --- a/pkgs/development/compilers/gcc/4.9/default.nix +++ b/pkgs/development/compilers/gcc/4.9/default.nix @@ -8,12 +8,7 @@ , profiledCompiler ? false , langJit ? false , staticCompiler ? false -, # N.B. the defult is intentionally not from an `isStatic`. See - # https://gcc.gnu.org/install/configure.html - this is about target - # platform libraries not host platform ones unlike normal. But since - # we can't rebuild those without also rebuilding the compiler itself, - # we opt to always build everything unlike our usual policy. - enableShared ? true +, enableShared ? !stdenv.targetPlatform.isStatic , enableLTO ? !stdenv.hostPlatform.isStatic , texinfo ? null , perl ? null # optional, for texi2pod (then pod2man); required for Java @@ -311,7 +306,7 @@ stdenv.mkDerivation ({ }; enableParallelBuilding = true; - inherit enableMultilib; + inherit enableShared enableMultilib; inherit (stdenv) is64bit; diff --git a/pkgs/development/compilers/gcc/6/default.nix b/pkgs/development/compilers/gcc/6/default.nix index 7548ec56c759..5191c3b461be 100644 --- a/pkgs/development/compilers/gcc/6/default.nix +++ b/pkgs/development/compilers/gcc/6/default.nix @@ -9,12 +9,7 @@ , profiledCompiler ? false , langJit ? false , staticCompiler ? false -, # N.B. the defult is intentionally not from an `isStatic`. See - # https://gcc.gnu.org/install/configure.html - this is about target - # platform libraries not host platform ones unlike normal. But since - # we can't rebuild those without also rebuilding the compiler itself, - # we opt to always build everything unlike our usual policy. - enableShared ? true +, enableShared ? !stdenv.targetPlatform.isStatic , enableLTO ? !stdenv.hostPlatform.isStatic , texinfo ? null , flex @@ -325,7 +320,7 @@ stdenv.mkDerivation ({ }; enableParallelBuilding = true; - inherit enableMultilib; + inherit enableShared enableMultilib; inherit (stdenv) is64bit; diff --git a/pkgs/development/compilers/gcc/7/default.nix b/pkgs/development/compilers/gcc/7/default.nix index 70bb5df255c4..937ccbb35103 100644 --- a/pkgs/development/compilers/gcc/7/default.nix +++ b/pkgs/development/compilers/gcc/7/default.nix @@ -7,12 +7,7 @@ , profiledCompiler ? false , langJit ? false , staticCompiler ? false -, # N.B. the defult is intentionally not from an `isStatic`. See - # https://gcc.gnu.org/install/configure.html - this is about target - # platform libraries not host platform ones unlike normal. But since - # we can't rebuild those without also rebuilding the compiler itself, - # we opt to always build everything unlike our usual policy. - enableShared ? true +, enableShared ? !stdenv.targetPlatform.isStatic , enableLTO ? !stdenv.hostPlatform.isStatic , texinfo ? null , perl ? null # optional, for texi2pod (then pod2man) @@ -280,7 +275,7 @@ stdenv.mkDerivation ({ }; enableParallelBuilding = true; - inherit enableMultilib; + inherit enableShared enableMultilib; inherit (stdenv) is64bit; diff --git a/pkgs/development/compilers/gcc/8/default.nix b/pkgs/development/compilers/gcc/8/default.nix index 609dfa722a65..e98197836955 100644 --- a/pkgs/development/compilers/gcc/8/default.nix +++ b/pkgs/development/compilers/gcc/8/default.nix @@ -7,12 +7,7 @@ , profiledCompiler ? false , langJit ? false , staticCompiler ? false -, # N.B. the defult is intentionally not from an `isStatic`. See - # https://gcc.gnu.org/install/configure.html - this is about target - # platform libraries not host platform ones unlike normal. But since - # we can't rebuild those without also rebuilding the compiler itself, - # we opt to always build everything unlike our usual policy. - enableShared ? true +, enableShared ? !stdenv.targetPlatform.isStatic , enableLTO ? !stdenv.hostPlatform.isStatic , texinfo ? null , perl ? null # optional, for texi2pod (then pod2man) @@ -259,7 +254,7 @@ stdenv.mkDerivation ({ }; enableParallelBuilding = true; - inherit enableMultilib; + inherit enableShared enableMultilib; inherit (stdenv) is64bit; diff --git a/pkgs/development/compilers/gcc/9/default.nix b/pkgs/development/compilers/gcc/9/default.nix index a96d16a6a502..a96a23da2ced 100644 --- a/pkgs/development/compilers/gcc/9/default.nix +++ b/pkgs/development/compilers/gcc/9/default.nix @@ -9,12 +9,7 @@ , profiledCompiler ? false , langJit ? false , staticCompiler ? false -, # N.B. the defult is intentionally not from an `isStatic`. See - # https://gcc.gnu.org/install/configure.html - this is about target - # platform libraries not host platform ones unlike normal. But since - # we can't rebuild those without also rebuilding the compiler itself, - # we opt to always build everything unlike our usual policy. - enableShared ? true +, enableShared ? !stdenv.targetPlatform.isStatic , enableLTO ? !stdenv.hostPlatform.isStatic , texinfo ? null , perl ? null # optional, for texi2pod (then pod2man) @@ -285,7 +280,7 @@ stdenv.mkDerivation ({ }; enableParallelBuilding = true; - inherit enableMultilib; + inherit enableShared enableMultilib; inherit (stdenv) is64bit; diff --git a/pkgs/development/compilers/gcc/builder.sh b/pkgs/development/compilers/gcc/builder.sh index e6d41d7b29ab..9d0514f17590 100644 --- a/pkgs/development/compilers/gcc/builder.sh +++ b/pkgs/development/compilers/gcc/builder.sh @@ -222,6 +222,10 @@ postInstall() { moveToOutput "${targetConfig+$targetConfig/}lib/lib*.dll.a" "${!outputLib}" moveToOutput "share/gcc-*/python" "${!outputLib}" + if [ -z "$enableShared" ]; then + moveToOutput "${targetConfig+$targetConfig/}lib/lib*.a" "${!outputLib}" + fi + for i in "${!outputLib}/${targetConfig}"/lib/*.{la,py}; do substituteInPlace "$i" --replace "$out" "${!outputLib}" done