diff --git a/pkgs/development/compilers/gcc-4.4/update-gcc.sh b/pkgs/development/compilers/gcc-4.4/update-gcc.sh index 799e75627a5..c7afee268e2 100755 --- a/pkgs/development/compilers/gcc-4.4/update-gcc.sh +++ b/pkgs/development/compilers/gcc-4.4/update-gcc.sh @@ -36,11 +36,13 @@ do file="gcc-${component}-${version}.tar.bz2" url="${dir}/${file}" - path_and_hash="$(nix-prefetch-url "$url" 2>&1 | grep -E '^(hash|path) is')" - path="$(echo $path_and_hash | sed -e's/^.*path is \([^ ]\+\).*$/\1/g')" - hash="$(echo $path_and_hash | sed -e's/^.*hash is \([^ ]\+\).*$/\1/g')" + rm -f "${file}" - rm -f "${url}.sig" + wget "$url" + hash="$(nix-hash --flat --type sha256 "$file")" + path="$(nix-store --add-fixed sha256 "$file")" + + rm -f "${file}" "${file}.sig" wget "${url}.sig" gpg --verify "${file}.sig" "${path}" || gpg2 --verify "${file}.sig" "${path}" rm "${file}.sig" diff --git a/pkgs/development/compilers/gcc-4.6/builder.sh b/pkgs/development/compilers/gcc-4.6/builder.sh index 49e4b3e4cc7..ee4f6ede745 100644 --- a/pkgs/development/compilers/gcc-4.6/builder.sh +++ b/pkgs/development/compilers/gcc-4.6/builder.sh @@ -46,8 +46,8 @@ if test "$noSysDirs" = "1"; then export NIX_FIXINC_DUMMY=/usr/include fi - extraFlags="-g0 -O2 -I$NIX_FIXINC_DUMMY $extraFlags" - extraLDFlags="--strip-debug -L$glibc_libdir -rpath $glibc_libdir $extraLDFlags" + extraFlags="-I$NIX_FIXINC_DUMMY $extraFlags" + extraLDFlags="-L$glibc_libdir -rpath $glibc_libdir $extraLDFlags" EXTRA_FLAGS="$extraFlags" for i in $extraLDFlags; do @@ -63,7 +63,7 @@ if test "$noSysDirs" = "1"; then unset LIBRARY_PATH unset CPATH if test -z "$crossStageStatic"; then - EXTRA_TARGET_CFLAGS="-g0 -O2 -B${libcCross}/lib -idirafter ${libcCross}/include" + EXTRA_TARGET_CFLAGS="-B${libcCross}/lib -idirafter ${libcCross}/include" EXTRA_TARGET_LDFLAGS="-Wl,-L${libcCross}/lib" fi else @@ -89,8 +89,8 @@ if test "$noSysDirs" = "1"; then # The path to the Glibc binaries such as `crti.o'. 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" + extraFlags="-I$NIX_FIXINC_DUMMY_CROSS $extraFlags" + 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.6/default.nix b/pkgs/development/compilers/gcc-4.6/default.nix index 0f637a0329b..a157d328fa1 100644 --- a/pkgs/development/compilers/gcc-4.6/default.nix +++ b/pkgs/development/compilers/gcc-4.6/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; @@ -355,7 +356,7 @@ stdenv.mkDerivation ({ EXTRA_TARGET_CFLAGS = if cross != null && libcCross != null - then "-g0 -O2 -idirafter ${libcCross}/include" + then "-idirafter ${libcCross}/include" else null; EXTRA_TARGET_LDFLAGS = @@ -373,7 +374,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++, @@ -402,6 +404,10 @@ stdenv.mkDerivation ({ installTargets = "install-gcc install-target-libgcc"; } +# GCC 4.6.0 DOES support the `install-strip' target, but we'll let`stdenv' do +# the stripping by default to match stdenv-updates, for now +// optionalAttrs (!stripped) { dontStrip = true; NIX_STRIP_DEBUG = false; } + // optionalAttrs langVhdl rec { name = "ghdl-0.29";