summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/stdenv.xml17
-rw-r--r--pkgs/development/compilers/ghc/8.2.2.nix3
-rw-r--r--pkgs/development/compilers/ghc/8.4.4.nix3
-rw-r--r--pkgs/development/compilers/ghc/8.6.1.nix3
-rw-r--r--pkgs/development/compilers/ghc/8.6.2.nix3
-rw-r--r--pkgs/development/compilers/ghc/head.nix3
-rw-r--r--pkgs/development/libraries/gettext/gettext-setup-hook.sh2
-rw-r--r--pkgs/development/libraries/libiconv/setup-hook.sh6
8 files changed, 37 insertions, 3 deletions
diff --git a/doc/stdenv.xml b/doc/stdenv.xml
index 26190debc29b..4ef89991d2f2 100644
--- a/doc/stdenv.xml
+++ b/doc/stdenv.xml
@@ -2527,6 +2527,23 @@ addEnvHooks "$hostOffset" myBashFunction
</varlistentry>
<varlistentry>
<term>
+ libiconv, libintl
+ </term>
+ <listitem>
+ <para>
+ A few libraries automatically add to
+ <literal>NIX_LDFLAGS</literal> their library, making their
+ symbols automatically available to the linker. This includes
+ libiconv and libintl (gettext). This is done to provide
+ compatibility between GNU Linux, where libiconv and libintl
+ are bundled in, and other systems where that might not be the
+ case. Sometimes, this behavior is not desired. To disable
+ this behavior, set <literal>dontAddExtraLibs</literal>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
cmake
</term>
<listitem>
diff --git a/pkgs/development/compilers/ghc/8.2.2.nix b/pkgs/development/compilers/ghc/8.2.2.nix
index 3ecea2b54edb..3b9fecd55e10 100644
--- a/pkgs/development/compilers/ghc/8.2.2.nix
+++ b/pkgs/development/compilers/ghc/8.2.2.nix
@@ -206,6 +206,9 @@ stdenv.mkDerivation (rec {
"--disable-large-address-space"
];
+ # Don’t add -liconv to LDFLAGS automatically so that GHC will add it itself.
+ dontAddExtraLibs = true;
+
# Make sure we never relax`$PATH` and hooks support for compatability.
strictDeps = true;
diff --git a/pkgs/development/compilers/ghc/8.4.4.nix b/pkgs/development/compilers/ghc/8.4.4.nix
index 1ea18149d1ef..4db5c07b4601 100644
--- a/pkgs/development/compilers/ghc/8.4.4.nix
+++ b/pkgs/development/compilers/ghc/8.4.4.nix
@@ -186,6 +186,9 @@ stdenv.mkDerivation (rec {
# Make sure we never relax`$PATH` and hooks support for compatability.
strictDeps = true;
+ # Don’t add -liconv to LDFLAGS automatically so that GHC will add it itself.
+ dontAddExtraLibs = true;
+
nativeBuildInputs = [
perl autoconf automake m4 python3 sphinx
ghc bootPkgs.alex bootPkgs.happy bootPkgs.hscolour
diff --git a/pkgs/development/compilers/ghc/8.6.1.nix b/pkgs/development/compilers/ghc/8.6.1.nix
index 434570fe9889..5710c60338a8 100644
--- a/pkgs/development/compilers/ghc/8.6.1.nix
+++ b/pkgs/development/compilers/ghc/8.6.1.nix
@@ -167,6 +167,9 @@ stdenv.mkDerivation (rec {
# Make sure we never relax`$PATH` and hooks support for compatability.
strictDeps = true;
+ # Don’t add -liconv to LDFLAGS automatically so that GHC will add it itself.
+ dontAddExtraLibs = true;
+
nativeBuildInputs = [
perl autoconf automake m4 python3 sphinx
ghc bootPkgs.alex bootPkgs.happy bootPkgs.hscolour
diff --git a/pkgs/development/compilers/ghc/8.6.2.nix b/pkgs/development/compilers/ghc/8.6.2.nix
index 85853e158327..914d6ae08fac 100644
--- a/pkgs/development/compilers/ghc/8.6.2.nix
+++ b/pkgs/development/compilers/ghc/8.6.2.nix
@@ -167,6 +167,9 @@ stdenv.mkDerivation (rec {
# Make sure we never relax`$PATH` and hooks support for compatability.
strictDeps = true;
+ # Don’t add -liconv to LDFLAGS automatically so that GHC will add it itself.
+ dontAddExtraLibs = true;
+
nativeBuildInputs = [
perl autoconf automake m4 python3 sphinx
ghc bootPkgs.alex bootPkgs.happy bootPkgs.hscolour
diff --git a/pkgs/development/compilers/ghc/head.nix b/pkgs/development/compilers/ghc/head.nix
index 29de668767b8..42119682892d 100644
--- a/pkgs/development/compilers/ghc/head.nix
+++ b/pkgs/development/compilers/ghc/head.nix
@@ -149,6 +149,9 @@ stdenv.mkDerivation (rec {
# Make sure we never relax`$PATH` and hooks support for compatability.
strictDeps = true;
+ # Don’t add -liconv to LDFLAGS automatically so that GHC will add it itself.
+ dontAddExtraLibs = true;
+
nativeBuildInputs = [
perl autoconf automake m4 python3
ghc bootPkgs.alex bootPkgs.happy bootPkgs.hscolour
diff --git a/pkgs/development/libraries/gettext/gettext-setup-hook.sh b/pkgs/development/libraries/gettext/gettext-setup-hook.sh
index 0a6bc0dd253a..ad3763c29b64 100644
--- a/pkgs/development/libraries/gettext/gettext-setup-hook.sh
+++ b/pkgs/development/libraries/gettext/gettext-setup-hook.sh
@@ -10,7 +10,7 @@ addEnvHooks "$hostOffset" gettextDataDirsHook
# libintl must be listed in load flags on non-Glibc
# it doesn't hurt to have it in Glibc either though
-if [ ! -z "@gettextNeedsLdflags@" ]; then
+if [ -n "@gettextNeedsLdflags@" -a -z "$dontAddExtraLibs" ]; then
# See pkgs/build-support/setup-hooks/role.bash
getHostRole
export NIX_${role_pre}LDFLAGS+=" -lintl"
diff --git a/pkgs/development/libraries/libiconv/setup-hook.sh b/pkgs/development/libraries/libiconv/setup-hook.sh
index d20e94513e26..f89361a62998 100644
--- a/pkgs/development/libraries/libiconv/setup-hook.sh
+++ b/pkgs/development/libraries/libiconv/setup-hook.sh
@@ -2,5 +2,7 @@
# it doesn't hurt to have it in Glibc either though
# See pkgs/build-support/setup-hooks/role.bash
-getHostRole
-export NIX_${role_pre}LDFLAGS+=" -liconv"
+if [ -z "$dontAddExtraLibs" ]; then
+ getHostRole
+ export NIX_${role_pre}LDFLAGS+=" -liconv"
+fi