mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-17 23:36:17 +01:00
I took away the patch about the -Bxxx not being passed to target libraries
through libtool. I found a make variable holding flags that will not be trimmed by libtool: FLAGS_FOR_TARGET. svn path=/nixpkgs/branches/stdenv-updates/; revision=18846
This commit is contained in:
parent
21b2bc74b2
commit
916896e252
3 changed files with 23 additions and 67 deletions
|
@ -10,9 +10,9 @@ mkdir $NIX_FIXINC_DUMMY
|
|||
export CPP="gcc -E"
|
||||
|
||||
if test "$staticCompiler" = "1"; then
|
||||
NIX_EXTRA_LDFLAGS="-static"
|
||||
EXTRA_LDFLAGS="-static"
|
||||
else
|
||||
NIX_EXTRA_LDFLAGS=""
|
||||
EXTRA_LDFLAGS=""
|
||||
fi
|
||||
|
||||
if test "$noSysDirs" = "1"; then
|
||||
|
@ -21,7 +21,7 @@ if test "$noSysDirs" = "1"; then
|
|||
|
||||
# Figure out what extra flags to pass to the gcc compilers
|
||||
# being generated to make sure that they use our glibc.
|
||||
extraCFlags="$(cat $NIX_GCC/nix-support/libc-cflags)"
|
||||
extraFlags="$(cat $NIX_GCC/nix-support/libc-cflags)"
|
||||
extraLDFlags="$(cat $NIX_GCC/nix-support/libc-ldflags) $(cat $NIX_GCC/nix-support/libc-ldflags-before)"
|
||||
|
||||
# Use *real* header files, otherwise a limits.h is generated
|
||||
|
@ -34,18 +34,18 @@ if test "$noSysDirs" = "1"; then
|
|||
|
||||
else
|
||||
# Hack: support impure environments.
|
||||
extraCFlags="-isystem /usr/include"
|
||||
extraFlags="-isystem /usr/include"
|
||||
extraLDFlags="-L/usr/lib64 -L/usr/lib"
|
||||
glibc_libdir="/usr/lib"
|
||||
export NIX_FIXINC_DUMMY=/usr/include
|
||||
fi
|
||||
|
||||
extraCFlags="-g0 -O2 -I$NIX_FIXINC_DUMMY $extraCFlags"
|
||||
extraFlags="-g0 -O2 -I$NIX_FIXINC_DUMMY $extraFlags"
|
||||
extraLDFlags="--strip-debug -L$glibc_libdir -rpath $glibc_libdir $extraLDFlags"
|
||||
|
||||
export NIX_EXTRA_CFLAGS="$extraCFlags"
|
||||
EXTRA_FLAGS="$extraFlags"
|
||||
for i in $extraLDFlags; do
|
||||
export NIX_EXTRA_LDFLAGS="$NIX_EXTRA_LDFLAGS -Wl,$i"
|
||||
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,$i"
|
||||
done
|
||||
|
||||
if test -n "$targetConfig"; then
|
||||
|
@ -57,30 +57,34 @@ if test "$noSysDirs" = "1"; then
|
|||
unset LIBRARY_PATH
|
||||
unset CPATH
|
||||
if test -z "$crossStageStatic"; then
|
||||
export NIX_EXTRA_CFLAGS_TARGET="-g0 -O2 -B${libcCross}/lib -idirafter ${libcCross}/include"
|
||||
export NIX_EXTRA_LDFLAGS_TARGET="-Wl,-L${libcCross}/lib"
|
||||
EXTRA_FLAGS_TARGET="-g0 -O2 -B${libcCross}/lib -idirafter ${libcCross}/include"
|
||||
EXTRA_LDFLAGS_TARGET="-Wl,-L${libcCross}/lib"
|
||||
fi
|
||||
else
|
||||
# To be read by configure scripts (libtool-glibc.patch)
|
||||
export NIX_EXTRA_CFLAGS_TARGET="$NIX_EXTRA_CFLAGS"
|
||||
export NIX_EXTRA_LDFLAGS_TARGET="$NIX_EXTRA_LDFLAGS"
|
||||
EXTRA_FLAGS_TARGET="$EXTRA_FLAGS"
|
||||
EXTRA_LDFLAGS_TARGET="$EXTRA_LDFLAGS"
|
||||
fi
|
||||
|
||||
# CFLAGS_FOR_TARGET are needed for the libstdc++ configure script to find
|
||||
# the startfiles.
|
||||
# FLAGS_FOR_TARGET are needed for the target libraries to receive the -Bxxx
|
||||
# for the startfiles.
|
||||
makeFlagsArray=( \
|
||||
"${makeFlagsArray[@]}" \
|
||||
NATIVE_SYSTEM_HEADER_DIR="$NIX_FIXINC_DUMMY" \
|
||||
SYSTEM_HEADER_DIR="$NIX_FIXINC_DUMMY" \
|
||||
CFLAGS_FOR_BUILD="$NIX_EXTRA_CFLAGS $NIX_EXTRA_LDFLAGS" \
|
||||
CFLAGS_FOR_TARGET="$NIX_EXTRA_CFLAGS_TARGET $NIX_EXTRA_LDFLAGS_TARGET" \
|
||||
LDFLAGS_FOR_BUILD="$NIX_EXTRA_CFLAGS $NIX_EXTRA_LDFLAGS" \
|
||||
LDFLAGS_FOR_TARGET="$NIX_EXTRA_CFLAGS_TARGET $NIX_EXTRA_LDFLAGS_TARGET" \
|
||||
CFLAGS_FOR_BUILD="$EXTRA_FLAGS $EXTRA_LDFLAGS" \
|
||||
CFLAGS_FOR_TARGET="$EXTRA_FLAGS_TARGET $EXTRA_LDFLAGS_TARGET" \
|
||||
FLAGS_FOR_TARGET="$EXTRA_FLAGS_TARGET $EXTRA_LDFLAGS_TARGET" \
|
||||
LDFLAGS_FOR_BUILD="$EXTRA_FLAGS $EXTRA_LDFLAGS" \
|
||||
LDFLAGS_FOR_TARGET="$EXTRA_FLAGS_TARGET $EXTRA_LDFLAGS_TARGET" \
|
||||
)
|
||||
|
||||
if test -z "$targetConfig"; then
|
||||
makeFlagsArray=( \
|
||||
"${makeFlagsArray[@]}" \
|
||||
BOOT_CFLAGS="$NIX_EXTRA_CFLAGS $NIX_EXTRA_LDFLAGS" \
|
||||
BOOT_LDFLAGS="$NIX_EXTRA_CFLAGS_TARGET $NIX_EXTRA_LDFLAGS_TARGET" \
|
||||
BOOT_CFLAGS="$EXTRA_FLAGS $EXTRA_LDFLAGS" \
|
||||
BOOT_LDFLAGS="$EXTRA_FLAGS_TARGET $EXTRA_LDFLAGS_TARGET" \
|
||||
)
|
||||
fi
|
||||
|
||||
|
|
|
@ -88,7 +88,7 @@ stdenv.mkDerivation ({
|
|||
|
||||
patches =
|
||||
[./pass-cxxcpp.patch
|
||||
./libtool-glibc.patch # some libraries don't let the proper -Btargetglibcpath pass
|
||||
# ./libtool-glibc.patch # some libraries don't let the proper -Btargetglibcpath pass
|
||||
./libstdc++-target.patch # (fixed in gcc 4.4.3) bad mixture of build/target flags
|
||||
]
|
||||
++ optional noSysDirs ./no-sys-dirs.patch;
|
||||
|
|
|
@ -1,48 +0,0 @@
|
|||
diff --git a/libgomp/configure b/libgomp/configure
|
||||
index deef673..9e4a790 100755
|
||||
--- a/libgomp/configure
|
||||
+++ b/libgomp/configure
|
||||
@@ -23848,6 +23848,11 @@ old_archive_cmds=$lt_old_archive_cmds
|
||||
# A language specific compiler.
|
||||
CC=$lt_compiler
|
||||
|
||||
+# Ugly hack to get libmudflap (and other libraries) to build.
|
||||
+# Libtool filters out \`-B' flags when linking (why?), so the \`-B' flag
|
||||
+# to Glibc gets lost. Here we forcibly add it to any invocation.
|
||||
+CC="\$CC $NIX_EXTRA_CFLAGS_TARGET $NIX_EXTRA_LDFLAGS_TARGET"
|
||||
+
|
||||
# Is the compiler the GNU compiler?
|
||||
with_gcc=$GCC
|
||||
|
||||
diff --git a/libmudflap/configure b/libmudflap/configure
|
||||
index ae1be92..4ee1e18 100755
|
||||
--- a/libmudflap/configure
|
||||
+++ b/libmudflap/configure
|
||||
@@ -15044,6 +15044,11 @@ old_archive_cmds=$lt_old_archive_cmds
|
||||
# A language specific compiler.
|
||||
CC=$lt_compiler
|
||||
|
||||
+# Ugly hack to get libmudflap (and other libraries) to build.
|
||||
+# Libtool filters out \`-B' flags when linking (why?), so the \`-B' flag
|
||||
+# to Glibc gets lost. Here we forcibly add it to any invocation.
|
||||
+CC="\$CC $NIX_EXTRA_CFLAGS_TARGET $NIX_EXTRA_LDFLAGS_TARGET"
|
||||
+
|
||||
# Is the compiler the GNU compiler?
|
||||
with_gcc=$GCC
|
||||
|
||||
diff --git a/libssp/configure b/libssp/configure
|
||||
index ee2a41f..7f3e1fd 100755
|
||||
--- a/libssp/configure
|
||||
+++ b/libssp/configure
|
||||
@@ -12926,6 +12926,11 @@ old_archive_cmds=$lt_old_archive_cmds
|
||||
# A language specific compiler.
|
||||
CC=$lt_compiler
|
||||
|
||||
+# Ugly hack to get libmudflap (and other libraries) to build.
|
||||
+# Libtool filters out \`-B' flags when linking (why?), so the \`-B' flag
|
||||
+# to Glibc gets lost. Here we forcibly add it to any invocation.
|
||||
+CC="\$CC $NIX_EXTRA_CFLAGS_TARGET $NIX_EXTRA_LDFLAGS_TARGET"
|
||||
+
|
||||
# Is the compiler the GNU compiler?
|
||||
with_gcc=$GCC
|
||||
|
Loading…
Reference in a new issue