When -mretpoline is enabled with clang, a __llvm_retpoline_r11 weak symbol
is emitted in each compilation unit. This results in the Go linker
complaining when processing a package archive that contains cgo linkages,
since it finds the same weak symbol defined in multiple object files.
Relax the duplicate symbol detection such that weak symbols are permitted
to be duplicated. This makes it possible to build Go with clang again and
addresses a similar duplicate weak symbol issue that results from retguard.
Also backport an upstream commit that corrects the handling of libgcc vs
libcompiler_rt. Combined with the above fix `make regress` now passes with
both gcc and clang.
This requires three changes:
- OpenBSD clang produces __guard_local symbols that are marked as hidden,
which causes problems with the go linker. Workaround this by explicitly
making __guard_local symbols visible when reading in an ELF object.
- 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.
- The TestCgoConsistentResults test passes successfully outside of ports,
however fails under a ports build. This requires further investigation
but we can just skip the test for now.
Go 1.6 pass regress on openbsd/386 and openbsd/amd64. Also stop exporting
environ and __progname from cgo, since these symbols are no longer required
by libc.
sigreturn syscall is going away in future versions of OpenBSD and its
use for Go is already broken due to the trampoline return checks. Instead
just return directly from the signal trampoline (as we have always done
for Go openbsd/amd64).
Also fix a bug in the Go openbsd/386 linker, which results in symbols in
the dynamic symbol table being emitted with a size of zero. With a current
ld.so, this results in symbol mismatch warnings.
Unbreaks the Go port on openbsd/386, however it still fails to pass regress
due to the PT_TLS changes.
the various Sizeof*MsgHdr constants are now incorrect. This results in
various problems when attempting to parse the routing messages. Fix this
by respecting the header length returned from the kernel.
Makes regress pass again...
ok sthen@
Also preserve the timestamps of the source and compiled binaries so that
"go build" does not think installed libraries should be recompiled.
ok jasper@ sthen@
- Fix a bug in the regress tests that may result in the tests being built/run
with the installed binaries rather than the new binaries.
- Fix a bug related to 'go install' trying to rebuild non-writeable $GOROOT
packages, when used with a $GOPATH (issue 4106).
- Include the 'misc' part of the package, which contains editor
configuration files, etc.
ok jsg@, sthen@
Go is an open source programming environment that makes it easy to build
simple, reliable, and efficient software.
With assistance from sthen@
ok sthen@