This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH 1/4] ASAN for MIPS: Add __sanitizer.lock.pad initializer, shutting up a warning
- From: Hans-Peter Nilsson <hans-peter dot nilsson at axis dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: xiaoyur347 at gmail dot com, clm at codesourcery dot com, matthew dot fortune at imgtec dot com
- Date: Fri, 23 Mar 2018 03:50:28 +0100
- Subject: [PATCH 1/4] ASAN for MIPS: Add __sanitizer.lock.pad initializer, shutting up a warning
This appears to be present in compiler-rt upstream, but as part
of more intrusive changes. For gcc, the lack of this results in
a fatal warning (-Werror) at build-time.
libsanitizer:
* sanitizer_common/sanitizer_atomic_clang_other.h [_MIPS_SIM
&& _MIPS_SIM == _ABIO32] (lock): Add initializer for .pad member.
diff --git a/libsanitizer/sanitizer_common/sanitizer_atomic_clang_other.h b/libsanitizer/sanitizer_common/sanitizer_atomic_clang_other.h
index a0605bb..59e9f64 100644
--- a/libsanitizer/sanitizer_common/sanitizer_atomic_clang_other.h
+++ b/libsanitizer/sanitizer_common/sanitizer_atomic_clang_other.h
@@ -35,7 +35,7 @@ static void __spin_unlock(volatile int *lock) { __sync_lock_release(lock); }
static struct {
int lock;
char pad[32 - sizeof(int)];
-} __attribute__((aligned(32))) lock = {0};
+} __attribute__((aligned(32))) lock = {0, {0}};
template <class T>
T __mips_sync_fetch_and_add(volatile T *ptr, T val) {
--
2.1.4
brgds, H-P