Cleanup perl logic in stdenvLinux
Make thread disabling explicit. This changes the semantics of the perl derivation, so on other platforms it may require setting enableThreading = false This commit doesn't change the derivation or out hash of stdenvLinux.
This commit is contained in:
parent
fca5d864b6
commit
c5df246ba9
@ -1,4 +1,16 @@
|
|||||||
{ stdenv, fetchurl }:
|
{ stdenv, fetchurl, enableThreading ? true }:
|
||||||
|
|
||||||
|
# We can only compile perl with threading on platforms where we have a
|
||||||
|
# real glibc in the stdenv.
|
||||||
|
#
|
||||||
|
# Instead of silently building an unthreaded perl if this is not the
|
||||||
|
# case, we force callers to disableThreading explicitly, therefore
|
||||||
|
# documenting the platforms where the perl is not threaded.
|
||||||
|
#
|
||||||
|
# In the case of stdenv linux boot stage1 it's not possible to use
|
||||||
|
# threading because of the simpleness of the bootstrap glibc, so we
|
||||||
|
# use enableThreading = false there.
|
||||||
|
assert enableThreading -> (stdenv ? glibc);
|
||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
@ -42,7 +54,7 @@ stdenv.mkDerivation rec {
|
|||||||
"-Dlocincpth=${libc}/include"
|
"-Dlocincpth=${libc}/include"
|
||||||
"-Dloclibpth=${libc}/lib"
|
"-Dloclibpth=${libc}/lib"
|
||||||
]
|
]
|
||||||
++ optional (stdenv ? glibc) "-Dusethreads";
|
++ optional enableThreading "-Dusethreads";
|
||||||
|
|
||||||
configureScript = "${stdenv.shell} ./Configure";
|
configureScript = "${stdenv.shell} ./Configure";
|
||||||
|
|
||||||
|
@ -1,4 +1,16 @@
|
|||||||
{ stdenv, fetchurl }:
|
{ stdenv, fetchurl, enableThreading ? true }:
|
||||||
|
|
||||||
|
# We can only compile perl with threading on platforms where we have a
|
||||||
|
# real glibc in the stdenv.
|
||||||
|
#
|
||||||
|
# Instead of silently building an unthreaded perl if this is not the
|
||||||
|
# case, we force callers to disableThreading explicitly, therefore
|
||||||
|
# documenting the platforms where the perl is not threaded.
|
||||||
|
#
|
||||||
|
# In the case of stdenv linux boot stage1 it's not possible to use
|
||||||
|
# threading because of the simpleness of the bootstrap glibc, so we
|
||||||
|
# use enableThreading = false there.
|
||||||
|
assert enableThreading -> (stdenv ? glibc);
|
||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
@ -39,7 +51,7 @@ stdenv.mkDerivation rec {
|
|||||||
"-Dlocincpth=${libc}/include"
|
"-Dlocincpth=${libc}/include"
|
||||||
"-Dloclibpth=${libc}/lib"
|
"-Dloclibpth=${libc}/lib"
|
||||||
]
|
]
|
||||||
++ optional (stdenv ? glibc) "-Dusethreads";
|
++ optional enableThreading "-Dusethreads";
|
||||||
|
|
||||||
configureScript = "${stdenv.shell} ./Configure";
|
configureScript = "${stdenv.shell} ./Configure";
|
||||||
|
|
||||||
|
@ -169,8 +169,12 @@ rec {
|
|||||||
binutils = pkgs.binutils.override { gold = false; };
|
binutils = pkgs.binutils.override { gold = false; };
|
||||||
inherit (stage0.pkgs) glibc;
|
inherit (stage0.pkgs) glibc;
|
||||||
|
|
||||||
# TODO(errge) This was accidentally like this historically, most probably not needed
|
# A threaded perl build needs glibc/libpthread_nonshared.a,
|
||||||
perl = pkgs.perl.override { stdenv = stage1.stdenv.override { extraAttrs = { inherit platform; }; }; };
|
# which is not included in bootstrapTools, so disable threading.
|
||||||
|
# This is not an issue for the final stdenv, because this perl
|
||||||
|
# won't be included in the final stdenv and won't be exported to
|
||||||
|
# top-level pkgs as an override either.
|
||||||
|
perl = pkgs.perl.override { enableThreading = false; };
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user