Fix compiler flag handling and --print-libgcc-file-name hack, now that

clang is installed as cc. Allows regress pass again.
This commit is contained in:
jsing 2017-08-31 17:05:19 +00:00
parent 73457b1982
commit 1a0c0a8666
3 changed files with 31 additions and 11 deletions

View File

@ -1,11 +1,11 @@
# $OpenBSD: Makefile,v 1.44 2017/06/04 18:04:03 jsing Exp $
# $OpenBSD: Makefile,v 1.45 2017/08/31 17:05:19 jsing Exp $
ONLY_FOR_ARCHS = ${GO_ARCHS}
COMMENT = Go programming language
VERSION = 1.8.3
REVISION = 0
REVISION = 1
EXTRACT_SUFX = .src.tar.gz
DISTNAME = go${VERSION}
PKGNAME = go-${VERSION}

View File

@ -0,0 +1,21 @@
$OpenBSD: patch-src_cmd_go_build_go,v 1.1 2017/08/31 17:05:19 jsing Exp $
Index: src/cmd/go/build.go
--- src/cmd/go/build.go.orig
+++ src/cmd/go/build.go
@@ -3158,10 +3158,12 @@ func (b *builder) ccompilerCmd(envvar, defcmd, objdir
}
}
- if strings.Contains(a[0], "clang") {
- // disable ASCII art in clang errors, if possible
+ // disable ASCII art in clang errors, if possible
+ if b.gccSupportsFlag("-fno-caret-diagnostics") {
a = append(a, "-fno-caret-diagnostics")
- // clang is too smart about command-line arguments
+ }
+ // clang is too smart about command-line arguments
+ if b.gccSupportsFlag("-Qunused-arguments") {
a = append(a, "-Qunused-arguments")
}

View File

@ -1,23 +1,22 @@
$OpenBSD: patch-src_cmd_link_internal_ld_lib_go,v 1.4 2017/06/04 18:04:03 jsing Exp $
--- src/cmd/link/internal/ld/lib.go.orig Thu May 25 04:15:12 2017
+++ src/cmd/link/internal/ld/lib.go Mon Jun 5 01:10:09 2017
@@ -563,7 +563,14 @@ func (ctxt *Link) loadlib() {
$OpenBSD: patch-src_cmd_link_internal_ld_lib_go,v 1.5 2017/08/31 17:05:19 jsing Exp $
Index: src/cmd/link/internal/ld/lib.go
--- src/cmd/link/internal/ld/lib.go.orig
+++ src/cmd/link/internal/ld/lib.go
@@ -563,7 +563,13 @@ func (ctxt *Link) loadlib() {
}
if any {
if *flagLibGCC == "" {
- *flagLibGCC = ctxt.findLibPathCmd("--print-libgcc-file-name", "libgcc")
+ // TODO(jsing): OpenBSD clang currently fails to correctly report
+ // the compiler runtime via --print-libgcc-file-name. Workaround
+ // this issue by hardcoding it for the time being...
+ if runtime.GOOS == "openbsd" && *flagExtld == "clang" {
*flagLibGCC = ctxt.findLibPathCmd("--print-libgcc-file-name", "libgcc")
+ if runtime.GOOS == "openbsd" && *flagLibGCC == "libgcc.a" {
+ *flagLibGCC = "/usr/lib/libcompiler_rt.a"
+ } else {
+ *flagLibGCC = ctxt.findLibPathCmd("--print-libgcc-file-name", "libgcc")
+ }
}
if *flagLibGCC != "none" {
hostArchive(ctxt, *flagLibGCC)
@@ -1958,7 +1965,7 @@ func genasmsym(ctxt *Link, put func(*Link, *Symbol, st
@@ -1958,7 +1964,7 @@ func genasmsym(ctxt *Link, put func(*Link, *Symbol, st
put(ctxt, s, s.Extname, UndefinedSym, 0, nil)
case obj.STLSBSS: