Accepting request 520010 from home:thipp:branches:devel:languages:go
- add fix-sanitizer-build-against-latest-glibc.patch which fixes the sanitizer built against certain glibc versions OBS-URL: https://build.opensuse.org/request/show/520010 OBS-URL: https://build.opensuse.org/package/show/devel:languages:go/go?expand=0&rev=297
This commit is contained in:
parent
36f9e3fe6d
commit
d8d338d05d
105
fix-sanitizer-build-against-latest-glibc.patch
Normal file
105
fix-sanitizer-build-against-latest-glibc.patch
Normal file
@ -0,0 +1,105 @@
|
||||
From 8a5e425a68de4d2c80ff00a97bbcb3722a4716da Mon Sep 17 00:00:00 2001
|
||||
From: Kostya Serebryany <kcc@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];
|
@ -1,3 +1,9 @@
|
||||
-------------------------------------------------------------------
|
||||
Thu Aug 31 18:46:47 UTC 2017 - thipp@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 - asarai@suse.com
|
||||
|
||||
|
3
go.spec
3
go.spec
@ -112,6 +112,8 @@ Patch8: gcc6-go.patch
|
||||
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}
|
||||
@ -190,6 +192,7 @@ Go runtime race detector libraries. Install this package if you wish to use the
|
||||
%ifarch %{tsan_arch}
|
||||
# compiler-rt
|
||||
%setup -q -T -b 100 -n compiler-rt-g%{tsan_commit}
|
||||
%patch100 -p1
|
||||
%endif
|
||||
# go
|
||||
%setup -q -n go
|
||||
|
Loading…
Reference in New Issue
Block a user