go: fix on darwin, make go-1.7 build with clang-3.8. (#18001)
The darwin stdenv currently provides clang-3.7; however,
a) go-1.7 currently expects a compiler that supports "-fdebug-prefix-map"
arguments (which clang-3.8 supports but clang-3.7 does not) and
b) even with clang-3.8, go-1.7 misinterprets the result of its runtime probes
for support for the "-no-pie" flag, thereby failing to build runtime/cgo.
This patch resolves (a) by building go-1.7 with clang-3.8 and resolves (b) by
teaching go how to correctly probe "-no-pie" error messages from clang.
commitb9a4da47c0f08ae17c8892a98df276036f720520
authorMichael Stone <michael@laptop.org>
dateFri 26 Aug 2016, 03:36 (10 years ago)
parentdf343d4
pkgs/development/compilers/go/1.7.nix+3
@@ -98,6 +98,9 @@ stdenv.mkDerivation rec {
9898
9999 sed -i '/TestDisasmExtld/areturn' src/cmd/objdump/objdump_test.go
100100
101+ sed -i 's/unrecognized/unknown/' src/cmd/link/internal/ld/lib.go
102+ sed -i 's/unrecognized/unknown/' src/cmd/go/build.go
103+
101104 touch $TMPDIR/group $TMPDIR/hosts $TMPDIR/passwd
102105
103106 sed -i '1 a\exit 0' misc/cgo/errors/test.bash
pkgs/top-level/all-packages.nix+4−2
@@ -4738,9 +4738,11 @@ in
47384738 inherit (darwin.apple_sdk.frameworks) Security Foundation;
47394739 };
47404740
4741− go_1_7 = callPackage ../development/compilers/go/1.7.nix {
4741+ go_1_7 = callPackage ../development/compilers/go/1.7.nix ({
47424742 inherit (darwin.apple_sdk.frameworks) Security Foundation;
4743− };
4743+ } // stdenv.lib.optionalAttrs stdenv.isDarwin {
4744+ stdenv = stdenvAdapters.overrideCC pkgs.stdenv pkgs.clang_38;
4745+ });
47444746
47454747 go = self.go_1_7;
47464748