From d887437d8e7efb173a4527635a5add612401283c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Wed, 23 Mar 2011 14:51:17 +0000 Subject: [PATCH] GCC 4.5: Use `install-strip' instead of `-Wl,--strip-debug'; add `gcc45_debug'. svn path=/nixpkgs/branches/stdenv-updates/; revision=26467 --- pkgs/development/compilers/gcc-4.5/builder.sh | 4 ++-- pkgs/development/compilers/gcc-4.5/default.nix | 11 ++++++++++- pkgs/top-level/all-packages.nix | 14 ++++++++++++++ 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/pkgs/development/compilers/gcc-4.5/builder.sh b/pkgs/development/compilers/gcc-4.5/builder.sh index aedd5b46b12..e684fbc951e 100644 --- a/pkgs/development/compilers/gcc-4.5/builder.sh +++ b/pkgs/development/compilers/gcc-4.5/builder.sh @@ -47,7 +47,7 @@ if test "$noSysDirs" = "1"; then fi extraFlags="-g0 -O2 -I$NIX_FIXINC_DUMMY $extraFlags" - extraLDFlags="--strip-debug -L$glibc_libdir -rpath $glibc_libdir $extraLDFlags" + extraLDFlags="-L$glibc_libdir -rpath $glibc_libdir $extraLDFlags" EXTRA_FLAGS="$extraFlags" for i in $extraLDFlags; do @@ -90,7 +90,7 @@ if test "$noSysDirs" = "1"; then glibc_libdir="$(cat $NIX_GCC_CROSS/nix-support/orig-libc)/lib" extraFlags="-g0 -O2 -I$NIX_FIXINC_DUMMY_CROSS $extraFlags" - extraLDFlags="--strip-debug -L$glibc_libdir -rpath $glibc_libdir $extraLDFlags" + extraLDFlags="-L$glibc_libdir -rpath $glibc_libdir $extraLDFlags" EXTRA_TARGET_CFLAGS="$extraFlags" for i in $extraLDFlags; do diff --git a/pkgs/development/compilers/gcc-4.5/default.nix b/pkgs/development/compilers/gcc-4.5/default.nix index 19efa57af8e..6145050e9f0 100644 --- a/pkgs/development/compilers/gcc-4.5/default.nix +++ b/pkgs/development/compilers/gcc-4.5/default.nix @@ -26,6 +26,7 @@ , crossStageStatic ? true , gnat ? null , libpthread ? null, libpthreadCross ? null # required for GNU/Hurd +, stripped ? true }: assert langTreelang -> bison != null && flex != null; @@ -259,6 +260,11 @@ stdenv.mkDerivation ({ targetConfig = if (cross != null) then cross.config else null; + installTargets = + if stripped + then "install-strip" + else "install"; + crossAttrs = { AR = "${stdenv.cross.config}-ar"; LD = "${stdenv.cross.config}-ld"; @@ -364,7 +370,8 @@ stdenv.mkDerivation ({ meta = { homepage = http://gcc.gnu.org/; license = "GPLv3+"; # runtime support libraries are typically LGPLv3+ - description = "GNU Compiler Collection, version ${version}"; + description = "GNU Compiler Collection, version ${version}" + + (if stripped then "" else " (with debugging info)"); longDescription = '' The GNU Compiler Collection includes compiler front ends for C, C++, @@ -392,6 +399,8 @@ stdenv.mkDerivation ({ installTargets = "install-gcc install-target-libgcc"; } +// optionalAttrs (!stripped) { dontStrip = true; NIX_STRIP_DEBUG = false; } + // optionalAttrs langVhdl rec { name = "ghdl-0.29"; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 1823eab018e..dd88d0e3813 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1670,6 +1670,20 @@ let profiledCompiler = if stdenv.system == "armv5tel-linux" then false else true; })); + # A non-stripped version of GCC. + gcc45_debug = lowPrio (wrapGCC (callPackage ../development/compilers/gcc-4.5 { + stripped = false; + + inherit noSysDirs; + cross = null; + libcCross = null; + binutilsCross = null; + + # bootstrapping a profiled compiler does not work in the sheevaplug: + # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43944 + profiledCompiler = if stdenv.system == "armv5tel-linux" then false else true; + })); + gccApple = wrapGCC ( (if stdenv.system == "i686-darwin" then import ../development/compilers/gcc-apple else import ../development/compilers/gcc-apple64) { inherit fetchurl stdenv noSysDirs;