From 03fc55deeb272a4f24ba10ce6ac3fa58f13248a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Batlle=20i=20Rossell?= Date: Tue, 1 Dec 2009 10:29:22 +0000 Subject: [PATCH] Making the gcc 4.4 expression more friendly. Nevertheless it still cannot be used to cross-compile, because of some bug in 4.4.2 I think. This bug does not allow building a cross-compiler without libc: http://archives.free.net.ph/message/20091119.140407.040d3c5b.en.html Maybe we should wait for 4.4.3 or stay with 4.4.1 cross compiling. By now I will keep 4.3.4 on cross compilation. svn path=/nixpkgs/branches/stdenv-updates/; revision=18730 --- pkgs/development/compilers/gcc-4.4/builder.sh | 26 +++++++++++++------ .../development/compilers/gcc-4.4/default.nix | 1 + 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/pkgs/development/compilers/gcc-4.4/builder.sh b/pkgs/development/compilers/gcc-4.4/builder.sh index 317283c43dd3..0b4f9e89a0f2 100644 --- a/pkgs/development/compilers/gcc-4.4/builder.sh +++ b/pkgs/development/compilers/gcc-4.4/builder.sh @@ -40,16 +40,19 @@ if test "$noSysDirs" = "1"; then export NIX_FIXINC_DUMMY=/usr/include fi - # Setting $CPATH makes sure both `gcc' and `xgcc' find the C - # library headers, regarless of the language being compiled. - export CPATH="$NIX_FIXINC_DUMMY${CPATH:+:}$CPATH" + # We should not allow gcc find the headers of the native glibc + # (Here I only think of c,c++ compilers) + if test -z "$targetConfig"; then + # Setting $CPATH makes sure both `gcc' and `xgcc' find the C + # library headers, regarless of the language being compiled. + export CPATH="$NIX_FIXINC_DUMMY${CPATH:+:}$CPATH" - # Likewise, to help it find `crti.o' and similar files. - export LIBRARY_PATH="$glibc_libdir${LIBRARY_PATH:+:}$LIBRARY_PATH" - - echo "setting \$CPATH to \`$CPATH'" - echo "setting \$LIBRARY_PATH to \`$LIBRARY_PATH'" + # Likewise, to help it find `crti.o' and similar files. + export LIBRARY_PATH="$glibc_libdir${LIBRARY_PATH:+:}$LIBRARY_PATH" + echo "setting \$CPATH to \`$CPATH'" + echo "setting \$LIBRARY_PATH to \`$LIBRARY_PATH'" + fi extraCFlags="-g0 $extraCFlags" extraLDFlags="--strip-debug $extraLDFlags" @@ -110,6 +113,13 @@ if test -n "$targetConfig"; then fi preConfigure() { + if test -n "$newlibSrc"; then + tar xvf "$newlibSrc" -C .. + ln -s ../newlib-*/newlib newlib + # Patch to get armvt5el working: + sed -i -e 's/ arm)/ arm*)/' newlib/configure.host + fi + # Perform the build in a different directory. mkdir ../build cd ../build diff --git a/pkgs/development/compilers/gcc-4.4/default.nix b/pkgs/development/compilers/gcc-4.4/default.nix index c7d097d8caab..1f4feddc6f47 100644 --- a/pkgs/development/compilers/gcc-4.4/default.nix +++ b/pkgs/development/compilers/gcc-4.4/default.nix @@ -100,6 +100,7 @@ stdenv.mkDerivation ({ ++ (optional (boehmgc != null) boehmgc) ++ (optionals langJava [zip unzip]) ++ (optionals javaAwtGtk [gtk pkgconfig libart_lgpl] ++ xlibs) + ++ (optionals (cross != null) [binutilsCross]) ; configureFlags = "