GCC 4.5: Use `install-strip' instead of `-Wl,--strip-debug'; add `gcc45_debug'.

svn path=/nixpkgs/branches/stdenv-updates/; revision=26467
This commit is contained in:
Ludovic Courtès 2011-03-23 14:51:17 +00:00
parent 3e71355377
commit d887437d8e
3 changed files with 26 additions and 3 deletions

View File

@ -47,7 +47,7 @@ if test "$noSysDirs" = "1"; then
fi fi
extraFlags="-g0 -O2 -I$NIX_FIXINC_DUMMY $extraFlags" 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" EXTRA_FLAGS="$extraFlags"
for i in $extraLDFlags; do 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" glibc_libdir="$(cat $NIX_GCC_CROSS/nix-support/orig-libc)/lib"
extraFlags="-g0 -O2 -I$NIX_FIXINC_DUMMY_CROSS $extraFlags" 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" EXTRA_TARGET_CFLAGS="$extraFlags"
for i in $extraLDFlags; do for i in $extraLDFlags; do

View File

@ -26,6 +26,7 @@
, crossStageStatic ? true , crossStageStatic ? true
, gnat ? null , gnat ? null
, libpthread ? null, libpthreadCross ? null # required for GNU/Hurd , libpthread ? null, libpthreadCross ? null # required for GNU/Hurd
, stripped ? true
}: }:
assert langTreelang -> bison != null && flex != null; assert langTreelang -> bison != null && flex != null;
@ -259,6 +260,11 @@ stdenv.mkDerivation ({
targetConfig = if (cross != null) then cross.config else null; targetConfig = if (cross != null) then cross.config else null;
installTargets =
if stripped
then "install-strip"
else "install";
crossAttrs = { crossAttrs = {
AR = "${stdenv.cross.config}-ar"; AR = "${stdenv.cross.config}-ar";
LD = "${stdenv.cross.config}-ld"; LD = "${stdenv.cross.config}-ld";
@ -364,7 +370,8 @@ stdenv.mkDerivation ({
meta = { meta = {
homepage = http://gcc.gnu.org/; homepage = http://gcc.gnu.org/;
license = "GPLv3+"; # runtime support libraries are typically LGPLv3+ 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 = '' longDescription = ''
The GNU Compiler Collection includes compiler front ends for C, C++, The GNU Compiler Collection includes compiler front ends for C, C++,
@ -392,6 +399,8 @@ stdenv.mkDerivation ({
installTargets = "install-gcc install-target-libgcc"; installTargets = "install-gcc install-target-libgcc";
} }
// optionalAttrs (!stripped) { dontStrip = true; NIX_STRIP_DEBUG = false; }
// optionalAttrs langVhdl rec { // optionalAttrs langVhdl rec {
name = "ghdl-0.29"; name = "ghdl-0.29";

View File

@ -1670,6 +1670,20 @@ let
profiledCompiler = if stdenv.system == "armv5tel-linux" then false else true; 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 = gccApple =
wrapGCC ( (if stdenv.system == "i686-darwin" then import ../development/compilers/gcc-apple else import ../development/compilers/gcc-apple64) { wrapGCC ( (if stdenv.system == "i686-darwin" then import ../development/compilers/gcc-apple else import ../development/compilers/gcc-apple64) {
inherit fetchurl stdenv noSysDirs; inherit fetchurl stdenv noSysDirs;