Merge pull request #51455 from matthewbauer/fix-46814

ghc: don’t add libiconv automatically
This commit is contained in:
Matthew Bauer 2018-12-05 13:33:54 -06:00 committed by GitHub
commit 69e898eb36
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 37 additions and 3 deletions

View File

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

View File

@ -206,6 +206,9 @@ stdenv.mkDerivation (rec {
"--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.
strictDeps = true;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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