ghc: don’t add libiconv automatically

ghc needs it to fail to correctly detect it for later.
This commit is contained in:
Matthew Bauer 2018-12-02 14:26:53 -06:00
parent a9d153633e
commit 7a00e80329
8 changed files with 37 additions and 3 deletions

View File

@ -2525,6 +2525,23 @@ addEnvHooks "$hostOffset" myBashFunction
</para> </para>
</listitem> </listitem>
</varlistentry> </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> <varlistentry>
<term> <term>
cmake cmake

View File

@ -206,6 +206,9 @@ stdenv.mkDerivation (rec {
"--disable-large-address-space" "--disable-large-address-space"
]; ];
# Dont 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. # Make sure we never relax`$PATH` and hooks support for compatability.
strictDeps = true; strictDeps = true;

View File

@ -186,6 +186,9 @@ stdenv.mkDerivation (rec {
# Make sure we never relax`$PATH` and hooks support for compatability. # Make sure we never relax`$PATH` and hooks support for compatability.
strictDeps = true; strictDeps = true;
# Dont add -liconv to LDFLAGS automatically so that GHC will add it itself.
dontAddExtraLibs = true;
nativeBuildInputs = [ nativeBuildInputs = [
perl autoconf automake m4 python3 sphinx perl autoconf automake m4 python3 sphinx
ghc bootPkgs.alex bootPkgs.happy bootPkgs.hscolour ghc bootPkgs.alex bootPkgs.happy bootPkgs.hscolour

View File

@ -167,6 +167,9 @@ stdenv.mkDerivation (rec {
# Make sure we never relax`$PATH` and hooks support for compatability. # Make sure we never relax`$PATH` and hooks support for compatability.
strictDeps = true; strictDeps = true;
# Dont add -liconv to LDFLAGS automatically so that GHC will add it itself.
dontAddExtraLibs = true;
nativeBuildInputs = [ nativeBuildInputs = [
perl autoconf automake m4 python3 sphinx perl autoconf automake m4 python3 sphinx
ghc bootPkgs.alex bootPkgs.happy bootPkgs.hscolour ghc bootPkgs.alex bootPkgs.happy bootPkgs.hscolour

View File

@ -167,6 +167,9 @@ stdenv.mkDerivation (rec {
# Make sure we never relax`$PATH` and hooks support for compatability. # Make sure we never relax`$PATH` and hooks support for compatability.
strictDeps = true; strictDeps = true;
# Dont add -liconv to LDFLAGS automatically so that GHC will add it itself.
dontAddExtraLibs = true;
nativeBuildInputs = [ nativeBuildInputs = [
perl autoconf automake m4 python3 sphinx perl autoconf automake m4 python3 sphinx
ghc bootPkgs.alex bootPkgs.happy bootPkgs.hscolour ghc bootPkgs.alex bootPkgs.happy bootPkgs.hscolour

View File

@ -149,6 +149,9 @@ stdenv.mkDerivation (rec {
# Make sure we never relax`$PATH` and hooks support for compatability. # Make sure we never relax`$PATH` and hooks support for compatability.
strictDeps = true; strictDeps = true;
# Dont add -liconv to LDFLAGS automatically so that GHC will add it itself.
dontAddExtraLibs = true;
nativeBuildInputs = [ nativeBuildInputs = [
perl autoconf automake m4 python3 perl autoconf automake m4 python3
ghc bootPkgs.alex bootPkgs.happy bootPkgs.hscolour ghc bootPkgs.alex bootPkgs.happy bootPkgs.hscolour

View File

@ -10,7 +10,7 @@ addEnvHooks "$hostOffset" gettextDataDirsHook
# libintl must be listed in load flags on non-Glibc # libintl must be listed in load flags on non-Glibc
# it doesn't hurt to have it in Glibc either though # 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 # See pkgs/build-support/setup-hooks/role.bash
getHostRole getHostRole
export NIX_${role_pre}LDFLAGS+=" -lintl" export NIX_${role_pre}LDFLAGS+=" -lintl"

View File

@ -2,5 +2,7 @@
# it doesn't hurt to have it in Glibc either though # it doesn't hurt to have it in Glibc either though
# See pkgs/build-support/setup-hooks/role.bash # See pkgs/build-support/setup-hooks/role.bash
if [ -z "$dontAddExtraLibs" ]; then
getHostRole getHostRole
export NIX_${role_pre}LDFLAGS+=" -liconv" export NIX_${role_pre}LDFLAGS+=" -liconv"
fi