Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common Fix com...
details: https://anonhg.NetBSD.org/src/rev/6d4093f5d870
branches: trunk
changeset: 345651:6d4093f5d870
user: christos <christos%NetBSD.org@localhost>
date: Fri Jun 03 15:53:18 2016 +0000
description:
Fix compilation on non-x86
diffstat:
external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc | 16 ++++++++-
1 files changed, 13 insertions(+), 3 deletions(-)
diffs (47 lines):
diff -r 314781e832c0 -r 6d4093f5d870 external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc
--- a/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc Fri Jun 03 15:44:50 2016 +0000
+++ b/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc Fri Jun 03 15:53:18 2016 +0000
@@ -236,7 +236,7 @@
}
#endif // (defined(__x86_64__) || defined(__i386__)) && SANITIZER_LINUX
-#if SANITIZER_FREEBSD || SANITIZER_NETBSD
+#if SANITIZER_FREEBSD
static void **ThreadSelfSegbase() {
void **segbase = 0;
# if defined(__i386__)
@@ -254,7 +254,13 @@
uptr ThreadSelf() {
return (uptr)ThreadSelfSegbase()[2];
}
-#endif // SANITIZER_FREEBSD || SANITIZER_NETBSD
+#endif // SANITIZER_FREEBSD
+
+#if SANITIZER_NETBSD
+uptr ThreadSelf() {
+ return (uptr)pthread_self();
+}
+#endif // SANITIZER_NETBSD
static void GetTls(uptr *addr, uptr *size) {
#if SANITIZER_LINUX
@@ -267,7 +273,7 @@
*addr = 0;
*size = 0;
# endif
-#elif SANITIZER_FREEBSD || SANITIZER_NETBSD
+#elif SANITIZER_FREEBSD
void** segbase = ThreadSelfSegbase();
*addr = 0;
*size = 0;
@@ -280,6 +286,10 @@
*addr = (uptr) dtv[2];
*size = (*addr == 0) ? 0 : ((uptr) segbase[0] - (uptr) dtv[2]);
}
+#elif SANITIZER_NETBSD
+ // XXX: for now
+ *addr = 0;
+ *size = 0;
#else
# error "Unknown OS"
#endif
Home |
Main Index |
Thread Index |
Old Index