From 80c57fd96a8f4aa9b7ef69a01f50f4c264c49f7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Thu, 28 Sep 2017 21:51:00 +0200 Subject: [PATCH] gcj, gccgo: port fixes for 4.9 to 6 Tested that pdftk builds on linux again, and gccgo6 builds hello-world. The default gcc doesn't rebuild. --- pkgs/development/compilers/gcc/6/default.nix | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/pkgs/development/compilers/gcc/6/default.nix b/pkgs/development/compilers/gcc/6/default.nix index 2c8a9696e693..47cb93c19953 100644 --- a/pkgs/development/compilers/gcc/6/default.nix +++ b/pkgs/development/compilers/gcc/6/default.nix @@ -217,7 +217,8 @@ stdenv.mkDerivation ({ inherit patches; - outputs = [ "out" "lib" "man" "info" ]; + outputs = if langJava || langGo then ["out" "man" "info"] + else [ "out" "lib" "man" "info" ]; setOutputFlags = false; NIX_NO_SELF_RPATH = true; @@ -323,7 +324,11 @@ stdenv.mkDerivation ({ export LDFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $LDFLAGS_FOR_TARGET" export CXXFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $CXXFLAGS_FOR_TARGET" export CFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $CFLAGS_FOR_TARGET" - ''; + '' + + stdenv.lib.optionalString (langJava || langGo) '' + export lib=$out; + '' + ; dontDisableStatic = true; @@ -565,4 +570,10 @@ stdenv.mkDerivation ({ // optionalAttrs (!stripped || targetPlatform != hostPlatform) { dontStrip = true; } // optionalAttrs (enableMultilib) { dontMoveLib64 = true; } + +// optionalAttrs (langJava) { + postFixup = '' + target="$(echo "$out/libexec/gcc"/*/*/ecj*)" + patchelf --set-rpath "$(patchelf --print-rpath "$target"):$out/lib" "$target" + '';} )