Created attachment 160308 [details] go14 patch Building go14 on a FreeBSD 10.2 systme yields some -pthread warnings: os/user/lookup_unix.go:58:31: warning: unknown attribute '__gcc_struct__' ignored [-Wattributes] } __attribute__((__packed__, __gcc_struct__)) *a = v; ^ os/user/lookup_unix.go:73:31: warning: unknown attribute '__gcc_struct__' ignored [-Wattributes] } __attribute__((__packed__, __gcc_struct__)) *a = v; ^ os/user/lookup_unix.go:92:31: warning: unknown attribute '__gcc_struct__' ignored [-Wattributes] } __attribute__((__packed__, __gcc_struct__)) *a = v; ^ os/user/lookup_unix.go:106:31: warning: unknown attribute '__gcc_struct__' ignored [-Wattributes] } __attribute__((__packed__, __gcc_struct__)) *a = v; ^ 4 warnings generated. # os/user cc: warning: argument unused during compilation: '-pthread' # net net/cgo_unix.go:53:31: warning: unknown attribute '__gcc_struct__' ignored [-Wattributes] } __attribute__((__packed__, __gcc_struct__)) *a = v; ^ net/cgo_unix.go:66:31: warning: unknown attribute '__gcc_struct__' ignored [-Wattributes] } __attribute__((__packed__, __gcc_struct__)) *a = v; ^ net/cgo_unix.go:75:31: warning: unknown attribute '__gcc_struct__' ignored [-Wattributes] } __attribute__((__packed__, __gcc_struct__)) *a = v; ^ net/cgo_unix.go:86:31: warning: unknown attribute '__gcc_struct__' ignored [-Wattributes] } __attribute__((__packed__, __gcc_struct__)) *a = v; ^ net/cgo_unix.go:103:31: warning: unknown attribute '__gcc_struct__' ignored [-Wattributes] } __attribute__((__packed__, __gcc_struct__)) *a = v; ^ 5 warnings generated. It seems that go14 does not detect, that our cc is actually clang. The attached patch explicitly sets CC to clang so the go toolchain knows about it. This fixes the above warnings. It also replaces "type -t" in the shell script wiht "command -v" to remove these artifacts: # Building C bootstrap tool. cmd/dist -t: not found gcc: not found -t: not found lang/go seems to also suffer from not detecting our clang although it has code to detect it. So the CC patch should be applied there, too. Should i open an extra PR for that?
Well, we can not just overwrite CC. This variable should be configurable by the user.
I can understand that but short of modifying the upstream code i don't see a way to fix this. Looking at the go code there are a lot of places which check the compiler name for "clang", there is no central compiler switch which would make this trivial. We could do something like: .if ${COMPILER_TYPE} == clang && ${CC} == cc CC=clang .endif If anyone modifies CC the override will not take place and everything should work for them as they wanted while fixing the detection in go for the default case.
A commit references this bug: Author: jlaffaye Date: Sun Sep 27 19:54:20 UTC 2015 New revision: 398046 URL: https://svnweb.freebsd.org/changeset/ports/398046 Log: - Update to 1.4.3, fix vulnerabilities - Improve clang detection [1] - Disable CGO, it is not needed to bootstrap 1.5 PR: 202624 [1] Changes: head/lang/go14/Makefile head/lang/go14/distinfo head/lang/go14/pkg-plist
A commit references this bug: Author: junovitch Date: Mon Sep 28 22:15:20 UTC 2015 New revision: 398150 URL: https://svnweb.freebsd.org/changeset/ports/398150 Log: MFH: r398046 (partially) - Update to 1.4.3, fix vulnerabilities - Improve clang detection [1] PR: 202624 [1] Security: CVE-2015-5739 Security: CVE-2015-5740 Security: CVE-2015-5741 Security: 4464212e-4acd-11e5-934b-002590263bf5 Approved by: ports-secteam (feld) Changes: branches/2015Q3/lang/go/Makefile branches/2015Q3/lang/go/distinfo branches/2015Q3/lang/go/pkg-plist