Hello community, here is the log from the commit of package go1.6 for openSUSE:Factory checked in at 2018-01-19 11:53:11 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/go1.6 (Old) and /work/SRC/openSUSE:Factory/.go1.6.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "go1.6" Fri Jan 19 11:53:11 2018 rev:5 rq:566416 version:1.6.4 Changes: -------- --- /work/SRC/openSUSE:Factory/go1.6/go1.6.changes 2017-10-23 16:53:39.951634473 +0200 +++ /work/SRC/openSUSE:Factory/.go1.6.new/go1.6.changes 2018-01-19 11:53:24.963064602 +0100 @@ -41,0 +42,16 @@ +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-g389d49d4943780efbfcd2a434f4462b6d0f23c44.tar.xz fix-sanitizer-build-against-latest-glibc.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ go1.6.spec ++++++ --- /var/tmp/diff_new_pack.pCltwK/_old 2018-01-19 11:53:25.959017663 +0100 +++ /var/tmp/diff_new_pack.pCltwK/_new 2018-01-19 11:53:25.959017663 +0100 @@ -1,7 +1,7 @@ # # spec file for package go1.6 # -# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -14,6 +14,7 @@ # Please submit bugfixes or comments via http://bugs.opensuse.org/ # +# nodebuginfo # The fallback boostrap method via go1.4 does not work for Factory because @@ -58,6 +59,16 @@ %define with_shared 0 %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 389d49d4943780efbfcd2a434f4462b6d0f23c44 + %define _name go Name: go1.6 @@ -72,6 +83,8 @@ 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) @@ -104,6 +117,8 @@ Patch13: net-smtp-fix-PlainAuth-to-refuse-to-send-passwords-to-non-TLS-servers.patch # PATCH-FIX-UPSTREAM cmd/go: reject update of VCS inside VCS Patch14: cmd-go-reject-update-of-VCS-inside-VCS.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} @@ -121,6 +136,10 @@ %if 0%{?suse_version} >= 1100 BuildRequires: fdupes 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 %if 0%{?suse_version} > 1230 BuildRequires: rpm >= 4.11.1 @@ -151,6 +170,7 @@ %package doc Summary: Go documentation +License: BSD-3-Clause Group: Documentation/Other Requires: go = %{version} Provides: go-doc = %{version} @@ -158,7 +178,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 @@ -204,6 +246,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 @@ -217,8 +273,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 @@ -226,6 +282,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 @@ -243,7 +305,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 @@ -330,6 +392,11 @@ %doc %{_docdir}/go/%{go_api}/README.md %doc %{_docdir}/go/%{go_api}/README.SUSE +# 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 @@ -342,4 +409,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">389d49d4943780efbfcd2a434f4462b6d0f23c44</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 @@ -548,8 +548,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); void internal_sigfillset(__sanitizer_sigset_t *set); 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 @@ -269,7 +269,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 @@ -285,7 +286,7 @@ void InitializePlatform() { int ExtractResolvFDs(void *state, int *fds, int nfd) { #if SANITIZER_LINUX 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.pCltwK/_old 2018-01-19 11:53:26.087011632 +0100 +++ /var/tmp/diff_new_pack.pCltwK/_new 2018-01-19 11:53:26.087011632 +0100 @@ -1,2 +1,9 @@ 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$") +addFilter("W: position-independent-executable-suggested")