Merge pull request #163489 from alyssais/gcc-static-lib

pkgsStatic.stdenv.cc.cc: put static libs in $lib
This commit is contained in:
John Ericson 2022-03-22 22:07:50 -04:00 committed by GitHub
commit ed07c3b1a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 20 additions and 56 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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