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.
This commit is contained in:
Vladimír Čunát 2017-09-28 21:51:00 +02:00
parent 144914121c
commit 80c57fd96a
No known key found for this signature in database
GPG key ID: E747DF1F9575A3AA

View file

@ -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"
'';}
)