diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2018-12-03 20:25:11 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2018-12-03 20:25:11 +0000 |
commit | ab25c42d05ea17fc8a3267135650dee0f42a918e (patch) | |
tree | 187ef807591432ad9384483cad84243f6d9de617 /libgo | |
parent | d89057777e7468b3089afdb64a534e38d1a13680 (diff) | |
download | gcc-ab25c42d05ea17fc8a3267135650dee0f42a918e.zip gcc-ab25c42d05ea17fc8a3267135650dee0f42a918e.tar.gz gcc-ab25c42d05ea17fc8a3267135650dee0f42a918e.tar.bz2 |
cmd/go: allow buildmode c-archive for gccgo on ppc64
In buildmodeinit, the c-archive buildmode is flagged as invalid
on linux/ppc64 for gccgo when it should be valid. This happens
because the check against the gccgo flag is done after the checks
for valid GOOS/GOARCH pairs instead of before as is done for all
other buildmode cases in this switch. This corrects the problem and
allows several of the gccgo gotools testcases to pass on linux/ppc64.
Updates #29046
Reviewed-on: https://go-review.googlesource.com/c/152137
From-SVN: r266764
Diffstat (limited to 'libgo')
-rw-r--r-- | libgo/go/cmd/go/internal/work/init.go | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/libgo/go/cmd/go/internal/work/init.go b/libgo/go/cmd/go/internal/work/init.go index de0cd42..56f1ff2 100644 --- a/libgo/go/cmd/go/internal/work/init.go +++ b/libgo/go/cmd/go/internal/work/init.go @@ -85,23 +85,24 @@ func buildModeInit() { pkgsFilter = pkgsNotMain case "c-archive": pkgsFilter = oneMainPkg - switch platform { - case "darwin/arm", "darwin/arm64": - codegenArg = "-shared" - default: - switch cfg.Goos { - case "dragonfly", "freebsd", "linux", "netbsd", "openbsd", "solaris": - if platform == "linux/ppc64" { - base.Fatalf("-buildmode=c-archive not supported on %s\n", platform) - } - // Use -shared so that the result is - // suitable for inclusion in a PIE or - // shared library. - codegenArg = "-shared" - } - } if gccgo { codegenArg = "-fPIC" + } else { + switch platform { + case "darwin/arm", "darwin/arm64": + codegenArg = "-shared" + default: + switch cfg.Goos { + case "dragonfly", "freebsd", "linux", "netbsd", "openbsd", "solaris": + if platform == "linux/ppc64" { + base.Fatalf("-buildmode=c-archive not supported on %s\n", platform) + } + // Use -shared so that the result is + // suitable for inclusion in a PIE or + // shared library. + codegenArg = "-shared" + } + } } cfg.ExeSuffix = ".a" ldBuildmode = "c-archive" |