Skip to content
This repository was archived by the owner on May 21, 2019. It is now read-only.

Commit fc0eb62

Browse files
committed
tsan: fix Go build
Currently fails with: gotsan.cc:7686:40: error: the address of 'int __sanitizer_pthread_attr_getstack(void*, void**, size_t*)' will always evaluate as 'true' [-Werror=address] git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@198261 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 93eba4f commit fc0eb62

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/sanitizer_common/sanitizer_linux_libcdep.cc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,24 @@
3333
#include <link.h>
3434
#endif
3535

36+
#ifndef SANITIZER_GO
3637
// This function is defined elsewhere if we intercepted pthread_attr_getstack.
3738
extern "C" SANITIZER_WEAK_ATTRIBUTE int
3839
__sanitizer_pthread_attr_getstack(void *attr, void **addr, size_t *size);
3940

4041
static int my_pthread_attr_getstack(void *attr, void **addr, size_t *size) {
42+
#
4143
if (__sanitizer_pthread_attr_getstack)
4244
return __sanitizer_pthread_attr_getstack((pthread_attr_t *)attr, addr,
4345
size);
4446

4547
return pthread_attr_getstack((pthread_attr_t *)attr, addr, size);
4648
}
49+
#endif // #ifndef SANITIZER_GO
4750

4851
namespace __sanitizer {
4952

53+
#ifndef SANITIZER_GO
5054
void GetThreadStackTopAndBottom(bool at_initialization, uptr *stack_top,
5155
uptr *stack_bottom) {
5256
static const uptr kMaxThreadStackSize = 1 << 30; // 1Gb
@@ -93,6 +97,7 @@ void GetThreadStackTopAndBottom(bool at_initialization, uptr *stack_top,
9397
*stack_top = (uptr)stackaddr + stacksize;
9498
*stack_bottom = (uptr)stackaddr;
9599
}
100+
#endif // #ifndef SANITIZER_GO
96101

97102
// Does not compile for Go because dlsym() requires -ldl
98103
#ifndef SANITIZER_GO
@@ -278,6 +283,7 @@ void GetThreadStackAndTls(bool main, uptr *stk_addr, uptr *stk_size,
278283
#endif // SANITIZER_GO
279284
}
280285

286+
#ifndef SANITIZER_GO
281287
void AdjustStackSizeLinux(void *attr_) {
282288
pthread_attr_t *attr = (pthread_attr_t *)attr_;
283289
uptr stackaddr = 0;
@@ -301,6 +307,7 @@ void AdjustStackSizeLinux(void *attr_) {
301307
}
302308
}
303309
}
310+
#endif // SANITIZER_GO
304311

305312
#if SANITIZER_ANDROID
306313
uptr GetListOfModules(LoadedModule *modules, uptr max_modules,

0 commit comments

Comments
 (0)