From 7b78f74a6d1b219b4295f4ddc19773d480a7fecf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Wed, 15 Jun 2011 08:42:46 +0000 Subject: [PATCH] GCC 4.6: Pass `-O2' and optionally `-g' to the bootstrap compiler. svn path=/nixpkgs/trunk/; revision=27465 --- pkgs/development/compilers/gcc-4.6/builder.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pkgs/development/compilers/gcc-4.6/builder.sh b/pkgs/development/compilers/gcc-4.6/builder.sh index af42039310a3..5d295356831c 100644 --- a/pkgs/development/compilers/gcc-4.6/builder.sh +++ b/pkgs/development/compilers/gcc-4.6/builder.sh @@ -50,6 +50,17 @@ if test "$noSysDirs" = "1"; then extraFlags="-I$NIX_FIXINC_DUMMY $extraFlags" extraLDFlags="-L$glibc_libdir -rpath $glibc_libdir $extraLDFlags" + # BOOT_CFLAGS defaults to `-g -O2'; since we override it below, + # make sure to explictly add them so that files compiled with the + # bootstrap compiler are optimized and (optionally) contain + # debugging information (info "(gccinstall) Building"). + if test -n "$dontStrip"; then + extraFlags="-O2 -g $extraFlags" + else + # Don't pass `-g' at all; this saves space while building. + extraFlags="-O2 $extraFlags" + fi + EXTRA_FLAGS="$extraFlags" for i in $extraLDFlags; do EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,$i"