From 89c9a8896b8b0793cdad1728c39e300bf10c5df7 Mon Sep 17 00:00:00 2001 From: Eric Litak Date: Tue, 31 May 2016 09:23:42 -0700 Subject: [PATCH] same changes to the rest. 4.5 has inf recursion still, 4.6 too old for glibc2.23 --- .../development/compilers/gcc/4.5/default.nix | 37 +++++++++++++------ pkgs/development/compilers/gcc/4.6/builder.sh | 4 +- .../development/compilers/gcc/4.6/default.nix | 33 ++++++++++++----- .../development/compilers/gcc/4.8/default.nix | 31 +++++++++++----- .../development/compilers/gcc/4.9/default.nix | 31 +++++++++++----- 5 files changed, 95 insertions(+), 41 deletions(-) diff --git a/pkgs/development/compilers/gcc/4.5/default.nix b/pkgs/development/compilers/gcc/4.5/default.nix index b1eedf7707d..d8848a979f4 100644 --- a/pkgs/development/compilers/gcc/4.5/default.nix +++ b/pkgs/development/compilers/gcc/4.5/default.nix @@ -179,11 +179,11 @@ stdenv.mkDerivation ({ sed -i "${gnu_h}" \ -es'|LIB_SPEC *"\(.*\)$|LIB_SPEC "${extraLibSpec} \1|g' - echo "setting \`NATIVE_SYSTEM_HEADER_DIR' and \`STANDARD_INCLUDE_DIR' to \`${libc}/include'..." + echo "setting \`NATIVE_SYSTEM_HEADER_DIR' and \`STANDARD_INCLUDE_DIR' to \`${libc.dev}/include'..." sed -i "${gnu_h}" \ - -es'|#define STANDARD_INCLUDE_DIR.*$|#define STANDARD_INCLUDE_DIR "${libc}/include"|g' + -es'|#define STANDARD_INCLUDE_DIR.*$|#define STANDARD_INCLUDE_DIR "${libc.dev}/include"|g' sed -i gcc/config/t-gnu \ - -es'|NATIVE_SYSTEM_HEADER_DIR.*$|NATIVE_SYSTEM_HEADER_DIR = ${libc}/include|g' + -es'|NATIVE_SYSTEM_HEADER_DIR.*$|NATIVE_SYSTEM_HEADER_DIR = ${libc.dev}/include|g' '' else if cross != null || stdenv.cc.libc != null then # On NixOS, use the right path to the dynamic linker instead of @@ -197,7 +197,7 @@ stdenv.mkDerivation ({ grep -q LIBC_DYNAMIC_LINKER "$header" || continue echo " fixing \`$header'..." sed -i "$header" \ - -e 's|define[[:blank:]]*\([UCG]\+\)LIBC_DYNAMIC_LINKER\([0-9]*\)[[:blank:]]"\([^\"]\+\)"$|define \1LIBC_DYNAMIC_LINKER\2 "${libc}\3"|g' + -e 's|define[[:blank:]]*\([UCG]\+\)LIBC_DYNAMIC_LINKER\([0-9]*\)[[:blank:]]"\([^\"]\+\)"$|define \1LIBC_DYNAMIC_LINKER\2 "${libc.out}\3"|g' done '' else null; @@ -205,10 +205,10 @@ stdenv.mkDerivation ({ inherit noSysDirs profiledCompiler staticCompiler langJava crossStageStatic libcCross crossMingw; - nativeBuildInputs = [ texinfo which ] + nativeBuildInputs = [ texinfo which gettext ] ++ optional (perl != null) perl; - buildInputs = [ gmp mpfr libmpc libelf gettext ] + buildInputs = [ gmp mpfr libmpc libelf ] ++ (optional (ppl != null) ppl) ++ (optional (cloogppl != null) cloogppl) ++ (optional (zlib != null) zlib) @@ -346,15 +346,28 @@ stdenv.mkDerivation ({ ++ optional (libpthread != null) libpthread))); EXTRA_TARGET_CFLAGS = - if cross != null && libcCross != null - then "-idirafter ${libcCross}/include" + if cross != null && libcCross != null then [ + "-idirafter ${libcCross.dev}/include" + ] + ++ optionals (! crossStageStatic) [ + "-B${libcCross.out}/lib" + ] else null; EXTRA_TARGET_LDFLAGS = - if cross != null && libcCross != null - then "-B${libcCross}/lib -Wl,-L${libcCross}/lib" + - (optionalString (libpthreadCross != null) - " -L${libpthreadCross}/lib -Wl,${libpthreadCross.TARGET_LDFLAGS}") + if cross != null && libcCross != null then [ + "-Wl,-L${libcCross.out}/lib" + ] + ++ (if crossStageStatic then [ + "-B${libcCross.out}/lib" + ] else [ + "-Wl,-rpath,${libcCross.out}/lib" + "-Wl,-rpath-link,${libcCross.out}/lib" + ]) + ++ optionals (libpthreadCross != null) [ + "-L${libpthreadCross}/lib" + "-Wl,${libpthreadCross.TARGET_LDFLAGS}" + ] else null; passthru = { inherit langC langCC langAda langFortran langVhdl diff --git a/pkgs/development/compilers/gcc/4.6/builder.sh b/pkgs/development/compilers/gcc/4.6/builder.sh index af36ec33b70..6087bb30cfb 100644 --- a/pkgs/development/compilers/gcc/4.6/builder.sh +++ b/pkgs/development/compilers/gcc/4.6/builder.sh @@ -209,7 +209,9 @@ postInstall() { # Move runtime libraries to $lib. mkdir -p $lib/lib ln -s lib $lib/lib64 - mv -v $out/lib/lib*.so $out/lib/lib*.so.*[0-9] $out/lib/*.la $lib/lib/ + moveToOutput "lib/lib*.so" "$lib" + moveToOutput "lib/lib*.so.*[0-9]" "$lib" + moveToOutput "lib/*.la" "$lib" for i in $lib/lib/*.la; do substituteInPlace $i --replace $out $lib done diff --git a/pkgs/development/compilers/gcc/4.6/default.nix b/pkgs/development/compilers/gcc/4.6/default.nix index 7003f4335c8..9f6e2954181 100644 --- a/pkgs/development/compilers/gcc/4.6/default.nix +++ b/pkgs/development/compilers/gcc/4.6/default.nix @@ -229,11 +229,11 @@ stdenv.mkDerivation ({ sed -i "${gnu_h}" \ -es'|LIB_SPEC *"\(.*\)$|LIB_SPEC "${extraLibSpec} \1|g' - echo "setting \`NATIVE_SYSTEM_HEADER_DIR' and \`STANDARD_INCLUDE_DIR' to \`${libc}/include'..." + echo "setting \`NATIVE_SYSTEM_HEADER_DIR' and \`STANDARD_INCLUDE_DIR' to \`${libc.dev}/include'..." sed -i "${gnu_h}" \ - -es'|#define STANDARD_INCLUDE_DIR.*$|#define STANDARD_INCLUDE_DIR "${libc}/include"|g' + -es'|#define STANDARD_INCLUDE_DIR.*$|#define STANDARD_INCLUDE_DIR "${libc.dev}/include"|g' sed -i gcc/config/t-gnu \ - -es'|NATIVE_SYSTEM_HEADER_DIR.*$|NATIVE_SYSTEM_HEADER_DIR = ${libc}/include|g' + -es'|NATIVE_SYSTEM_HEADER_DIR.*$|NATIVE_SYSTEM_HEADER_DIR = ${libc.dev}/include|g' '' else if cross != null || stdenv.cc.libc != null then # On NixOS, use the right path to the dynamic linker instead of @@ -247,7 +247,7 @@ stdenv.mkDerivation ({ grep -q LIBC_DYNAMIC_LINKER "$header" || continue echo " fixing \`$header'..." sed -i "$header" \ - -e 's|define[[:blank:]]*\([UCG]\+\)LIBC_DYNAMIC_LINKER\([0-9]*\)[[:blank:]]"\([^\"]\+\)"$|define \1LIBC_DYNAMIC_LINKER\2 "${libc}\3"|g' + -e 's|define[[:blank:]]*\([UCG]\+\)LIBC_DYNAMIC_LINKER\([0-9]*\)[[:blank:]]"\([^\"]\+\)"$|define \1LIBC_DYNAMIC_LINKER\2 "${libc.out}\3"|g' done '' else null; @@ -421,15 +421,28 @@ stdenv.mkDerivation ({ ++ optional (libpthread != null) libpthread))); EXTRA_TARGET_CFLAGS = - if cross != null && libcCross != null - then "-idirafter ${libcCross}/include" + if cross != null && libcCross != null then [ + "-idirafter ${libcCross.dev}/include" + ] + ++ optionals (! crossStageStatic) [ + "-B${libcCross.out}/lib" + ] else null; EXTRA_TARGET_LDFLAGS = - if cross != null && libcCross != null - then "-B${libcCross}/lib -Wl,-L${libcCross}/lib" + - (optionalString (libpthreadCross != null) - " -L${libpthreadCross}/lib -Wl,${libpthreadCross.TARGET_LDFLAGS}") + if cross != null && libcCross != null then [ + "-Wl,-L${libcCross.out}/lib" + ] + ++ (if crossStageStatic then [ + "-B${libcCross.out}/lib" + ] else [ + "-Wl,-rpath,${libcCross.out}/lib" + "-Wl,-rpath-link,${libcCross.out}/lib" + ]) + ++ optionals (libpthreadCross != null) [ + "-L${libpthreadCross}/lib" + "-Wl,${libpthreadCross.TARGET_LDFLAGS}" + ] else null; passthru = { inherit langC langCC langAda langFortran langVhdl diff --git a/pkgs/development/compilers/gcc/4.8/default.nix b/pkgs/development/compilers/gcc/4.8/default.nix index 6810b52574c..db8f6282b82 100644 --- a/pkgs/development/compilers/gcc/4.8/default.nix +++ b/pkgs/development/compilers/gcc/4.8/default.nix @@ -255,9 +255,9 @@ stdenv.mkDerivation ({ sed -i "${gnu_h}" \ -es'|LIB_SPEC *"\(.*\)$|LIB_SPEC "${extraLibSpec} \1|g' - echo "setting \`NATIVE_SYSTEM_HEADER_DIR' and \`STANDARD_INCLUDE_DIR' to \`${libc}/include'..." + echo "setting \`NATIVE_SYSTEM_HEADER_DIR' and \`STANDARD_INCLUDE_DIR' to \`${libc.dev}/include'..." sed -i "${gnu_h}" \ - -es'|#define STANDARD_INCLUDE_DIR.*$|#define STANDARD_INCLUDE_DIR "${libc}/include"|g' + -es'|#define STANDARD_INCLUDE_DIR.*$|#define STANDARD_INCLUDE_DIR "${libc.dev}/include"|g' '' else if cross != null || stdenv.cc.libc != null then # On NixOS, use the right path to the dynamic linker instead of @@ -271,7 +271,7 @@ stdenv.mkDerivation ({ grep -q LIBC_DYNAMIC_LINKER "$header" || continue echo " fixing \`$header'..." sed -i "$header" \ - -e 's|define[[:blank:]]*\([UCG]\+\)LIBC_DYNAMIC_LINKER\([0-9]*\)[[:blank:]]"\([^\"]\+\)"$|define \1LIBC_DYNAMIC_LINKER\2 "${libc}\3"|g' + -e 's|define[[:blank:]]*\([UCG]\+\)LIBC_DYNAMIC_LINKER\([0-9]*\)[[:blank:]]"\([^\"]\+\)"$|define \1LIBC_DYNAMIC_LINKER\2 "${libc.out}\3"|g' done '' else null; @@ -482,15 +482,28 @@ stdenv.mkDerivation ({ ++ optional (libpthread != null) libpthread))); EXTRA_TARGET_CFLAGS = - if cross != null && libcCross != null - then "-idirafter ${libcCross}/include" + if cross != null && libcCross != null then [ + "-idirafter ${libcCross.dev}/include" + ] + ++ optionals (! crossStageStatic) [ + "-B${libcCross.out}/lib" + ] else null; EXTRA_TARGET_LDFLAGS = - if cross != null && libcCross != null - then "-B${libcCross}/lib -Wl,-L${libcCross}/lib" + - (optionalString (libpthreadCross != null) - " -L${libpthreadCross}/lib -Wl,${libpthreadCross.TARGET_LDFLAGS}") + if cross != null && libcCross != null then [ + "-Wl,-L${libcCross.out}/lib" + ] + ++ (if crossStageStatic then [ + "-B${libcCross.out}/lib" + ] else [ + "-Wl,-rpath,${libcCross.out}/lib" + "-Wl,-rpath-link,${libcCross.out}/lib" + ]) + ++ optionals (libpthreadCross != null) [ + "-L${libpthreadCross}/lib" + "-Wl,${libpthreadCross.TARGET_LDFLAGS}" + ] else null; passthru = diff --git a/pkgs/development/compilers/gcc/4.9/default.nix b/pkgs/development/compilers/gcc/4.9/default.nix index 195a7b03eed..97bdeecb5a2 100644 --- a/pkgs/development/compilers/gcc/4.9/default.nix +++ b/pkgs/development/compilers/gcc/4.9/default.nix @@ -258,9 +258,9 @@ stdenv.mkDerivation ({ sed -i "${gnu_h}" \ -es'|LIB_SPEC *"\(.*\)$|LIB_SPEC "${extraLibSpec} \1|g' - echo "setting \`NATIVE_SYSTEM_HEADER_DIR' and \`STANDARD_INCLUDE_DIR' to \`${libc}/include'..." + echo "setting \`NATIVE_SYSTEM_HEADER_DIR' and \`STANDARD_INCLUDE_DIR' to \`${libc.dev}/include'..." sed -i "${gnu_h}" \ - -es'|#define STANDARD_INCLUDE_DIR.*$|#define STANDARD_INCLUDE_DIR "${libc}/include"|g' + -es'|#define STANDARD_INCLUDE_DIR.*$|#define STANDARD_INCLUDE_DIR "${libc.dev}/include"|g' '' else if cross != null || stdenv.cc.libc != null then # On NixOS, use the right path to the dynamic linker instead of @@ -274,7 +274,7 @@ stdenv.mkDerivation ({ grep -q LIBC_DYNAMIC_LINKER "$header" || continue echo " fixing \`$header'..." sed -i "$header" \ - -e 's|define[[:blank:]]*\([UCG]\+\)LIBC_DYNAMIC_LINKER\([0-9]*\)[[:blank:]]"\([^\"]\+\)"$|define \1LIBC_DYNAMIC_LINKER\2 "${libc}\3"|g' + -e 's|define[[:blank:]]*\([UCG]\+\)LIBC_DYNAMIC_LINKER\([0-9]*\)[[:blank:]]"\([^\"]\+\)"$|define \1LIBC_DYNAMIC_LINKER\2 "${libc.out}\3"|g' done '' else null; @@ -489,15 +489,28 @@ stdenv.mkDerivation ({ ++ optional (libpthread != null) libpthread))); EXTRA_TARGET_CFLAGS = - if cross != null && libcCross != null - then "-idirafter ${libcCross}/include" + if cross != null && libcCross != null then [ + "-idirafter ${libcCross.dev}/include" + ] + ++ optionals (! crossStageStatic) [ + "-B${libcCross.out}/lib" + ] else null; EXTRA_TARGET_LDFLAGS = - if cross != null && libcCross != null - then "-B${libcCross}/lib -Wl,-L${libcCross}/lib" + - (optionalString (libpthreadCross != null) - " -L${libpthreadCross}/lib -Wl,${libpthreadCross.TARGET_LDFLAGS}") + if cross != null && libcCross != null then [ + "-Wl,-L${libcCross.out}/lib" + ] + ++ (if crossStageStatic then [ + "-B${libcCross.out}/lib" + ] else [ + "-Wl,-rpath,${libcCross.out}/lib" + "-Wl,-rpath-link,${libcCross.out}/lib" + ]) + ++ optionals (libpthreadCross != null) [ + "-L${libpthreadCross}/lib" + "-Wl,${libpthreadCross.TARGET_LDFLAGS}" + ] else null; passthru =