Skip to content

Commit

Permalink
Improving the crossStripping. A cross-glibc gets broken if stripped b…
Browse files Browse the repository at this point in the history
…y the

native strip. So we now distinguish dontStrip and dontCrossStrip. I updated
the expressions for glibc-2.9 and glibc-2.11 accordingly.
I could get rid of the cross-glibc depending on the cross-gcc-stage-static.

Enabling nls in the final cross-gcc.

I still have problems on wint_t/wchar_t not working on cross build. Gettext
does not build.


svn path=/nixpkgs/branches/stdenv-updates/; revision=18562
  • Loading branch information
Lluís Batlle i Rossell committed Nov 23, 2009
1 parent 75b60ca commit c6b5264
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 6 deletions.
5 changes: 4 additions & 1 deletion pkgs/build-support/gcc-cross-wrapper/setup-hook.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,17 @@ crossStripDirs() {

if test -n "${dirs}"; then
header "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
fi
}

crossStrip () {
# In cross_renaming we may rename dontCrossStrip to dontStrip, and
# dontStrip to dontNativeStrip.
# TODO: strip _only_ ELF executables, and return || fail here...
if test -z "$dontStrip"; then
if test -z "$dontCrossStrip"; then
stripDebugList=${stripDebugList:-lib lib64 libexec bin sbin}
if test -n "$stripDebugList"; then
crossStripDirs "$stripDebugList" "${stripDebugFlags:--S}"
Expand Down
3 changes: 2 additions & 1 deletion pkgs/development/compilers/gcc-4.3/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ let
" --with-headers=${glibcCross}/include" +
" --enable-__cxa_atexit" +
" --enable-long-long" +
" --enable-threads=posix"
" --enable-threads=posix" +
" --enable-nls"
);
stageNameAddon = if (crossStageStatic) then "-stage-static" else
"-stage-final";
Expand Down
2 changes: 2 additions & 0 deletions pkgs/development/libraries/glibc-2.11/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ EOF
export CC="$crossConfig-gcc"
export AR="$crossConfig-ar"
export RANLIB="$crossConfig-ranlib"
dontStrip = 1
'';
}
else {}))
3 changes: 3 additions & 0 deletions pkgs/development/libraries/glibc-2.9/builder.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ EOF
export AR="${crossConfig}-ar"
export RANLIB="${crossConfig}-ranlib"
configureFlags="${configureFlags} --cache-file=config.cache"

# Disable the native stripping, because it breaks libc_nonshared.a
dontStrip=1
fi
}

Expand Down
8 changes: 4 additions & 4 deletions pkgs/development/libraries/glibc-2.9/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,14 @@ stdenv.mkDerivation rec {

buildNativeInputs = stdenv.lib.optionals (cross != null) [ gccCross ];

preInstall = ''
preInstall = if (cross != null) then ''
ensureDir $out/lib
ln -s ${stdenv.gcc.gcc}/lib/libgcc_s.so.1 $out/lib/libgcc_s.so.1
'';
'' else "";

postInstall = ''
postInstall = if (cross != null) then ''
rm $out/lib/libgcc_s.so.1
'';
'' else "";

# Workaround for this bug:
# http://sourceware.org/bugzilla/show_bug.cgi?id=411
Expand Down

0 comments on commit c6b5264

Please sign in to comment.