Hello community, here is the log from the commit of package go for openSUSE:Factory checked in at 2017-09-08 20:40:46 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/go (Old) and /work/SRC/openSUSE:Factory/.go.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "go" Fri Sep 8 20:40:46 2017 rev:80 rq:521638 version:1.8.3 Changes: -------- --- /work/SRC/openSUSE:Factory/go/go.changes 2017-08-28 09:57:00.156070616 +0200 +++ /work/SRC/openSUSE:Factory/.go.new/go.changes 2017-09-08 20:40:55.384045384 +0200 @@ -1,0 +2,21 @@ +Tue Sep 5 15:38:19 UTC 2017 - th...@suse.de + +- Fixed incorrectly ghosted files + +------------------------------------------------------------------- +Thu Aug 31 18:46:47 UTC 2017 - th...@suse.de + +- add fix-sanitizer-build-against-latest-glibc.patch which fixes + the sanitizer built against certain glibc versions + +------------------------------------------------------------------- +Wed Aug 9 07:45:47 UTC 2017 - asa...@suse.com + +- go-race: add compiler-rt TSAN binary, necessary for the race detector builds + to work. This requires building compiler-rt from source (becuase upstream Go + stores precompiled binaries in the tree, and we cannot use them). In + addition, a %check was added purely to ensure that we don't install the wrong + version of compiler-rt. boo#1052528 +- go-rpmlintrc: add some entries to address the .syso additions. + +------------------------------------------------------------------- New: ---- _service compiler-rt-g68e1532492f9b3fce0e9024f3c31411105965b11.tar.xz fix-sanitizer-build-against-latest-glibc.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ go.spec ++++++ --- /var/tmp/diff_new_pack.CWLavv/_old 2017-09-08 20:40:57.115801897 +0200 +++ /var/tmp/diff_new_pack.CWLavv/_new 2017-09-08 20:40:57.127800210 +0200 @@ -45,6 +45,16 @@ %define with_gccgo 1 %endif +# By default we don't include tsan. It's only supported on amd64. +%define tsan_arch x86_64 + +# Go has precompiled versions of LLVM's compiler-rt inside their source code. +# We cannot ship pre-compiled binaries so we have to recompile said source, +# however they vendor specific commits from upstream. This value comes from +# src/runtime/race/README (and we verify that it matches in check). +# See boo#1052528 for more details. +%define tsan_commit 68e1532492f9b3fce0e9024f3c31411105965b11 + %define go_api 1.8 # shared library support @@ -73,11 +83,13 @@ License: BSD-3-Clause Group: Development/Languages/Other Url: http://golang.org -Source0: http://golang.org/dl/go%{version}.src.tar.gz +Source: http://golang.org/dl/go%{version}.src.tar.gz Source1: go-rpmlintrc Source2: go.sh Source4: README.SUSE Source6: go.gdbinit +# We have to compile TSAN ourselves. boo#1052528 +Source100: compiler-rt-g%{tsan_commit}.tar.xz # PATCH-FIX-OPENSUSE add -s flag to 'go install' (don't rebuild/install std libs) Patch1: go-1.5-build-dont-reinstall-stdlibs.patch # PATCH-FIX-OPENSUSE re-enable build binary only packages (we are binary distro) @@ -100,6 +112,8 @@ Patch9: gcc7-go.patch # PATCH-FIX-OPENSUSE: Bump _MaxGomaxprocs to a larger number for NUMA machines. Patch10: runtime-bump-MaxGomaxprocs.patch +# PATCH-FIX-UPSTREAM (compiler-rt): Fix sanitizer build against latest glibc +Patch100: fix-sanitizer-build-against-latest-glibc.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build # boostrap %if %{with_gccgo} @@ -119,6 +133,10 @@ BuildRequires: fdupes BuildRequires: systemd Recommends: go-doc = %{version} +%ifarch %{tsan_arch} +# Needed to compile compiler-rt/TSAN. +BuildRequires: gcc-c++ +%endif #BNC#818502 debug edit tool of rpm fails on i586 builds BuildRequires: bc BuildRequires: rpm >= 4.11.1 @@ -146,6 +164,7 @@ %package doc Summary: Go documentation +License: BSD-3-Clause Group: Documentation/Other Requires: go = %{version} Provides: go-doc = %{version} @@ -153,7 +172,29 @@ %description doc Go examples and documentation. +%ifarch %{tsan_arch} +# boo#1052528 +%package race +Summary: Go runtime race detector +License: NCSA or MIT +Group: Development/Languages/Other +Url: https://compiler-rt.llvm.org/ +Requires: go = %{version} +Supplements: go +ExclusiveArch: %{tsan_arch} + +%description race +Go runtime race detector libraries. Install this package if you wish to use the +-race option, in order to detect race conditions present in your Go programs. +%endif + %prep +%ifarch %{tsan_arch} +# compiler-rt +%setup -q -T -b 100 -n compiler-rt-g%{tsan_commit} +%patch100 -p1 +%endif +# go %setup -q -n go %patch1 -p1 %patch2 -p1 @@ -199,6 +240,20 @@ %endif %build +# Remove the pre-included .sysos, to avoid shipping things we didn't compile +# (which is against the openSUSE guidelines for packaging). +find . -type f -name '*.syso' -exec rm -vf {} \; + +# First, compile LLVM's TSAN, and replace the built-in with it. We can only do +# this for amd64. +%ifarch %{tsan_arch} +pushd ../compiler-rt*/lib/tsan/go +./buildgo.sh +popd +cp ../compiler-rt*/lib/tsan/go/race_linux_%{go_arch}.syso src/runtime/race/race_linux_%{go_arch}.syso +%endif + +# Now, compile Go. %if %{with_gccgo} export GOROOT_BOOTSTRAP=%{_prefix} %else @@ -212,8 +267,8 @@ HOST_EXTRA_CFLAGS="%{optflags} -Wno-error" ./make.bash cd ../ -%ifarch x86_64 -# Install race detection version of std libraries (amd64 only) +%ifarch %{tsan_arch} +# Install TSAN-friendly version of the std libraries. bin/go install -race std %endif @@ -221,6 +276,12 @@ bin/go install -buildmode=shared -linkshared std %endif +%check +%ifarch %{tsan_arch} +# Make sure that we have the right TSAN checked out. +grep "%{tsan_commit}" src/runtime/race/README +%endif + %install export GOROOT="%{buildroot}%{_libdir}/go/%{go_api}" install -Dm644 %{SOURCE2} $GOROOT/bin/profile.d/go.sh @@ -238,7 +299,7 @@ # source files for go install, godoc, etc install -d %{buildroot}%{_datadir}/go/%{go_api} -for ext in *.{go,c,h,s,S,py}; do +for ext in *.{go,c,h,s,S,py,syso}; do find src -name ${ext} -exec install -Dm644 \{\} %{buildroot}%{_datadir}/go/%{go_api}/\{\} \; done mkdir -p $GOROOT/src @@ -306,8 +367,8 @@ %{_libdir}/go/%{go_api} %{_datadir}/go %{_datadir}/go/%{go_api} -%ghost %{_sysconfdir}/profile.d/go.sh -%ghost %{_sysconfdir}/gdbinit.d/go.gdb +%config %{_sysconfdir}/profile.d/go.sh +%config %{_sysconfdir}/gdbinit.d/go.gdb %ghost %{_sysconfdir}/alternatives/go %ghost %{_sysconfdir}/alternatives/gofmt %ghost %{_sysconfdir}/alternatives/go.sh @@ -323,6 +384,11 @@ %doc %{_docdir}/go/%{go_api}/README.SUSE %doc %{_docdir}/go/%{go_api}/go%{go_api}.txt +# We don't include TSAN in the main Go package. +%ifarch %{tsan_arch} +%exclude %{_datadir}/go/%{go_api}/src/runtime/race/race_linux_%{go_arch}.syso +%endif + %files doc %defattr(-,root,root,-) %doc %{_docdir}/go/%{go_api}/codewalk @@ -335,4 +401,10 @@ %doc %{_docdir}/go/%{go_api}/*.css %doc %{_docdir}/go/%{go_api}/*.png +%ifarch %{tsan_arch} +%files race +%defattr(-,root,root,-) +%{_datadir}/go/%{go_api}/src/runtime/race/race_linux_%{go_arch}.syso +%endif + %changelog ++++++ _service ++++++ <services> <service name="tar_scm" mode="disabled"> <param name="url">https://git.llvm.org/git/compiler-rt.git</param> <param name="scm">git</param> <param name="exclude">.git</param> <!-- [boo#1052528] Always make sure this is kept up to date with src/runtime/race/README. --> <param name="versionformat">g%H</param> <param name="revision">68e1532492f9b3fce0e9024f3c31411105965b11</param> </service> <service name="recompress" mode="disabled"> <param name="file">compiler-rt-*.tar</param> <param name="compression">xz</param> </service> </services> ++++++ fix-sanitizer-build-against-latest-glibc.patch ++++++ >From 8a5e425a68de4d2c80ff00a97bbcb3722a4716da Mon Sep 17 00:00:00 2001 From: Kostya Serebryany <k...@google.com> Date: Thu, 13 Jul 2017 21:59:01 +0000 Subject: [PATCH] Fix sanitizer build against latest glibc Summary: libsanitizer doesn't build against latest glibc anymore, see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81066 for details. One of the changes is that stack_t changed from typedef struct sigaltstack { ... } stack_t; to typedef struct { ... } stack_t; for conformance reasons. And the other change is that the glibc internal __need_res_state macro is now ignored, so when doing ``` #define __need_res_state #include <resolv.h> ``` the effect is now the same as just ``` #include <resolv.h> ``` and thus one doesn't get just the ``` struct __res_state { ... }; ``` definition, but newly also the ``` extern struct __res_state *__res_state(void) __attribute__ ((__const__)); ``` prototype. So __res_state is no longer a type, but a function. Reviewers: kcc, ygribov Reviewed By: kcc Subscribers: kubamracek Differential Revision: https://reviews.llvm.org/D35246 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@307969 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/sanitizer_common/sanitizer_linux.cc | 3 +-- lib/sanitizer_common/sanitizer_linux.h | 4 +--- lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc | 2 +- lib/tsan/rtl/tsan_platform_linux.cc | 2 +- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/lib/sanitizer_common/sanitizer_linux.cc b/lib/sanitizer_common/sanitizer_linux.cc index a79a2a155..8c3c1e5d6 100644 --- a/lib/sanitizer_common/sanitizer_linux.cc +++ b/lib/sanitizer_common/sanitizer_linux.cc @@ -629,8 +629,7 @@ uptr internal_prctl(int option, uptr arg2, uptr arg3, uptr arg4, uptr arg5) { } #endif -uptr internal_sigaltstack(const struct sigaltstack *ss, - struct sigaltstack *oss) { +uptr internal_sigaltstack(const void *ss, void *oss) { return internal_syscall(SYSCALL(sigaltstack), (uptr)ss, (uptr)oss); } diff --git a/lib/sanitizer_common/sanitizer_linux.h b/lib/sanitizer_common/sanitizer_linux.h index ee336f7dd..11cad6b80 100644 --- a/lib/sanitizer_common/sanitizer_linux.h +++ b/lib/sanitizer_common/sanitizer_linux.h @@ -21,7 +21,6 @@ #include "sanitizer_platform_limits_posix.h" struct link_map; // Opaque type returned by dlopen(). -struct sigaltstack; namespace __sanitizer { // Dirent structure for getdents(). Note that this structure is different from @@ -30,8 +29,7 @@ struct linux_dirent; // Syscall wrappers. uptr internal_getdents(fd_t fd, struct linux_dirent *dirp, unsigned int count); -uptr internal_sigaltstack(const struct sigaltstack* ss, - struct sigaltstack* oss); +uptr internal_sigaltstack(const void* ss, void* oss); uptr internal_sigprocmask(int how, __sanitizer_sigset_t *set, __sanitizer_sigset_t *oldset); diff --git a/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc b/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc index 03f73ae88..d7fa5f645 100644 --- a/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc +++ b/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc @@ -287,7 +287,7 @@ static int TracerThread(void* argument) { // Alternate stack for signal handling. InternalScopedBuffer<char> handler_stack_memory(kHandlerStackSize); - struct sigaltstack handler_stack; + stack_t handler_stack; internal_memset(&handler_stack, 0, sizeof(handler_stack)); handler_stack.ss_sp = handler_stack_memory.data(); handler_stack.ss_size = kHandlerStackSize; diff --git a/lib/tsan/rtl/tsan_platform_linux.cc b/lib/tsan/rtl/tsan_platform_linux.cc index 0ba01babe..ead1e5704 100644 --- a/lib/tsan/rtl/tsan_platform_linux.cc +++ b/lib/tsan/rtl/tsan_platform_linux.cc @@ -286,7 +286,7 @@ void InitializePlatform() { int ExtractResolvFDs(void *state, int *fds, int nfd) { #if SANITIZER_LINUX && !SANITIZER_ANDROID int cnt = 0; - __res_state *statp = (__res_state*)state; + struct __res_state *statp = (struct __res_state*)state; for (int i = 0; i < MAXNS && cnt < nfd; i++) { if (statp->_u._ext.nsaddrs[i] && statp->_u._ext.nssocks[i] != -1) fds[cnt++] = statp->_u._ext.nssocks[i]; ++++++ go-rpmlintrc ++++++ --- /var/tmp/diff_new_pack.CWLavv/_old 2017-09-08 20:40:57.315773781 +0200 +++ /var/tmp/diff_new_pack.CWLavv/_new 2017-09-08 20:40:57.315773781 +0200 @@ -1,2 +1,8 @@ addFilter("binaryinfo-readelf-failed") # go binaries are suposedly ELF-compliant addFilter("statically-linked-binary") # go doesn't yet support dynamic linking + +# .syso files are special. Note that while they are architecture-dependent, +# they are named to avoid conflicts (and we make sure of that in the RPM +# through go_arch). +addFilter("unstripped-binary-or-object.*\.syso$") +addFilter("arch-dependent-file-in-usr-share.*\.syso$")