Author: viric
Date: Mon Aug 9 21:37:31 2010
New Revision: 23073
URL: https://svn.nixos.org/websvn/nix/?rev=23073&sc=1
Log:
Breaking dependencies on the cross-built gcc through the gcc-cross-wrapper.
Modified:
nixpkgs/branches/stdenv-updates/pkgs/build-support/gcc-cross-wrapper/builder.sh
nixpkgs/branches/stdenv-updates/pkgs/build-support/gcc-cross-wrapper/default.nix
nixpkgs/branches/stdenv-updates/pkgs/build-support/gcc-cross-wrapper/gcc-wrapper.sh
nixpkgs/branches/stdenv-updates/pkgs/build-support/gcc-cross-wrapper/setup-hook.sh
nixpkgs/branches/stdenv-updates/pkgs/development/libraries/openssl/default.nix
Modified:
nixpkgs/branches/stdenv-updates/pkgs/build-support/gcc-cross-wrapper/builder.sh
==============================================================================
---
nixpkgs/branches/stdenv-updates/pkgs/build-support/gcc-cross-wrapper/builder.sh
Mon Aug 9 21:21:30 2010 (r23072)
+++
nixpkgs/branches/stdenv-updates/pkgs/build-support/gcc-cross-wrapper/builder.sh
Mon Aug 9 21:37:31 2010 (r23073)
@@ -8,13 +8,20 @@
cflagsCompile="-B$out/bin/"
if test -z "$nativeLibc"; then
- cflagsCompile="$cflagsCompile -B$libc/lib/ -isystem $libc/include"
+ cflagsCompile="$cflagsCompile -B$gccLibs/lib -B$libc/lib/ -isystem
$libc/include"
ldflags="$ldflags -L$libc/lib"
# Get the proper dynamic linker for glibc and uclibc.
dlinker=`eval 'echo $libc/lib/ld*.so.?'`
- if [ -n "$dlinker" ]; then
+ if [ -n "$dynamicLinker" ]; then
ldflagsBefore="-dynamic-linker $dlinker"
fi
+ # This trick is to avoid dependencies on the cross-toolchain gcc
+ # for libgcc, libstdc++, ...
+ # -L is for libtool's .la files, and -rpath for the usual fixupPhase
+ # shrinking rpaths.
+ if [ -n "$gccLibs" ]; then
+ ldflagsBefore="$ldflagsBefore -rpath $gccLibs/lib"
+ fi
# The same as above, but put into files, useful for the gcc builder.
dynamicLinker="$libc/lib/$dynamicLinker"
@@ -31,16 +38,13 @@
# The dynamic linker is passed in `ldflagsBefore' to allow
# explicit overrides of the dynamic linker by callers to gcc/ld
# (the *last* value counts, so ours should come first).
- echo "-dynamic-linker $dynamicLinker" >
$out/nix-support/libc-ldflags-before
+ echo "$ldflagsBefore" > $out/nix-support/libc-ldflags-before
fi
if test -n "$nativeTools"; then
gccPath="$nativePrefix/bin"
ldPath="$nativePrefix/bin"
else
- if test -n "$gccLibs"; then
- ldflags="$ldflags -L$gccLibs/lib -L$gccLibs/lib64"
- fi
ldflags="$ldflags -L$gcc/lib -L$gcc/lib64"
gccPath="$gcc/bin"
ldPath="$binutils/$crossConfig/bin"
Modified:
nixpkgs/branches/stdenv-updates/pkgs/build-support/gcc-cross-wrapper/default.nix
==============================================================================
---
nixpkgs/branches/stdenv-updates/pkgs/build-support/gcc-cross-wrapper/default.nix
Mon Aug 9 21:21:30 2010 (r23072)
+++
nixpkgs/branches/stdenv-updates/pkgs/build-support/gcc-cross-wrapper/default.nix
Mon Aug 9 21:37:31 2010 (r23073)
@@ -19,11 +19,14 @@
name = chosenName + "-libs";
phases = [ "installPhase" ];
installPhase = ''
+ echo $out
ensureDir $out
- cp -Rd ${gcc}/lib $out/lib
- if [ -d ${gcc}/lib64 ]; then
- cp -Rd ${gcc}/lib64 $out/lib64
- fi
+ cp -Rd ${gcc}/${cross.config}/lib $out/lib
+ chmod -R +w $out/lib
+ for a in $out/lib/*.la; do
+ sed -i -e s,${gcc}/${cross.config}/lib,$out/lib,g $a
+ done
+ rm -f $out/lib/*.py
'';
};
in
Modified:
nixpkgs/branches/stdenv-updates/pkgs/build-support/gcc-cross-wrapper/gcc-wrapper.sh
==============================================================================
---
nixpkgs/branches/stdenv-updates/pkgs/build-support/gcc-cross-wrapper/gcc-wrapper.sh
Mon Aug 9 21:21:30 2010 (r23072)
+++
nixpkgs/branches/stdenv-updates/pkgs/build-support/gcc-cross-wrapper/gcc-wrapper.sh
Mon Aug 9 21:37:31 2010 (r23073)
@@ -75,14 +75,18 @@
# Add the flags that should be passed to the linker (and prevent
# `ld-wrapper' from adding NIX_CROSS_LDFLAGS again).
for i in $NIX_CROSS_LDFLAGS_BEFORE; do
- extraBefore=(${extrabefo...@]} "-Wl,$i")
+ if test "${i:0:3}" = "-L/"; then
+ extraBefore=(${extrabefo...@]} "$i")
+ else
+ extraBefore=(${extrabefo...@]} "-Wl,$i")
+ fi
done
for i in $NIX_CROSS_LDFLAGS; do
- if test "${i:0:3}" = "-L/"; then
- extraAfter=(${extraaft...@]} "$i")
- else
- extraAfter=(${extraaft...@]} "-Wl,$i")
- fi
+ if test "${i:0:3}" = "-L/"; then
+ extraAfter=(${extraaft...@]} "$i")
+ else
+ extraAfter=(${extraaft...@]} "-Wl,$i")
+ fi
done
export NIX_CROSS_LDFLAGS_SET=1
Modified:
nixpkgs/branches/stdenv-updates/pkgs/build-support/gcc-cross-wrapper/setup-hook.sh
==============================================================================
---
nixpkgs/branches/stdenv-updates/pkgs/build-support/gcc-cross-wrapper/setup-hook.sh
Mon Aug 9 21:21:30 2010 (r23072)
+++
nixpkgs/branches/stdenv-updates/pkgs/build-support/gcc-cross-wrapper/setup-hook.sh
Mon Aug 9 21:37:31 2010 (r23073)
@@ -1,6 +1,8 @@
NIX_CROSS_CFLAGS_COMPILE=""
NIX_CROSS_LDFLAGS=""
+set -x
+
crossAddCVars () {
if test -d $1/include; then
export NIX_CROSS_CFLAGS_COMPILE="$NIX_CROSS_CFLAGS_COMPILE
-I$1/include"
@@ -26,7 +28,7 @@
dirs=${dirsNew}
if test -n "${dirs}"; then
- header "stripping (with flags $stripFlags) in $dirs"
+ header "cross stripping (with flags $stripFlags) in $dirs"
# libc_nonshared.a should never be stripped, or builds will break.
find $dirs -type f -print0 | xargs -0 ${xargsFlags:--r}
$crossConfig-strip $stripFlags || true
stopNest
@@ -80,3 +82,5 @@
export NIX_CROSS_LDFLAGS="-rpath $out/lib64 -rpath-link $out/lib
$NIX_CROSS_LDFLAGS"
fi
fi
+
+set +x
Modified:
nixpkgs/branches/stdenv-updates/pkgs/development/libraries/openssl/default.nix
==============================================================================
---
nixpkgs/branches/stdenv-updates/pkgs/development/libraries/openssl/default.nix
Mon Aug 9 21:21:30 2010 (r23072)
+++
nixpkgs/branches/stdenv-updates/pkgs/development/libraries/openssl/default.nix
Mon Aug 9 21:37:31 2010 (r23073)
@@ -30,6 +30,12 @@
# It's configure does not like --build or --host
export configureFlags="--libdir=lib
--cross-compile-prefix=${stdenv.cross.config}- shared ${opensslCrossSystem}"
'';
+
+ # Openssl installs readonly files, which otherwise we can't strip.
+ # This could at some stdenv hash change be put out of crossAttrs, too
+ postInstall = ''
+ chmod -R +w $out
+ '';
configureScript = "./Configure";
};
_______________________________________________
nix-commits mailing list
[email protected]
http://mail.cs.uu.nl/mailman/listinfo/nix-commits