diff --git a/pkgs/development/libraries/glibc/builder.sh b/pkgs/development/libraries/glibc/builder.sh index 9d34bda23bf..177e8482c90 100644 --- a/pkgs/development/libraries/glibc/builder.sh +++ b/pkgs/development/libraries/glibc/builder.sh @@ -35,6 +35,16 @@ preConfigure() { } +postConfigure=postConfigure +postConfigure() { + # Hack: get rid of the `-static' flag set by the bootstrap stdenv. + # This has to be done *after* `configure' because it builds some + # test binaries. + export NIX_CFLAGS_LINK= + export NIX_LDFLAGS_BEFORE= +} + + postInstall=postInstall postInstall() { if test -n "$installLocales"; then diff --git a/pkgs/stdenv/linux/default.nix b/pkgs/stdenv/linux/default.nix index cd2357df48f..e497acc9c25 100644 --- a/pkgs/stdenv/linux/default.nix +++ b/pkgs/stdenv/linux/default.nix @@ -100,6 +100,7 @@ rec { import ../generic { name = "stdenv-linux-boot"; + param1 = if staticGlibc then "static" else "dynamic"; preHook = ./scripts/prehook.sh; stdenv = stdenvInitial; shell = bootstrapTools.bash; diff --git a/pkgs/stdenv/linux/scripts/prehook.sh b/pkgs/stdenv/linux/scripts/prehook.sh index 29c02e2eaf2..4ba81f1eef7 100644 --- a/pkgs/stdenv/linux/scripts/prehook.sh +++ b/pkgs/stdenv/linux/scripts/prehook.sh @@ -1,3 +1,8 @@ export NIX_ENFORCE_PURITY=1 +if test "$param1" = "static"; then + export NIX_CFLAGS_LINK="-static" + export NIX_LDFLAGS_BEFORE="-static" +fi + havePatchELF=1