[compiler-rt] 3a05af1 - Revert "[sanitizer] Fix MAC build after D108163"
Vitaly Buka via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 16 15:46:54 PDT 2021
Author: Vitaly Buka
Date: 2021-08-16T15:46:37-07:00
New Revision: 3a05af12b3a716e2cef3a8b6e51500e3b0f1d449
URL: https://github.com/llvm/llvm-project/commit/3a05af12b3a716e2cef3a8b6e51500e3b0f1d449
DIFF: https://github.com/llvm/llvm-project/commit/3a05af12b3a716e2cef3a8b6e51500e3b0f1d449.diff
LOG: Revert "[sanitizer] Fix MAC build after D108163"
They still fail to fix Darwin builds
https://green.lab.llvm.org/green/job/clang-stage1-RA/23399/consoleFull#462858634a1ca8a51-895e-46c6-af87-ce24fa4cd561
This reverts commit ae0628f716cc05ad28adf963538a67e69d58d21d.
This reverts commit 2c6448cdc2f68f8c28fd0bd9404182b81306e6e6.
Added:
Modified:
compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h
compiler-rt/lib/sanitizer_common/sanitizer_malloc_mac.inc
compiler-rt/lib/sanitizer_common/tests/sanitizer_bitvector_test.cpp
Removed:
################################################################################
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h b/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h
index db26d9e213f22..056b00a10e2be 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h
@@ -139,13 +139,8 @@ namespace __sanitizer {
typedef unsigned long long uptr;
typedef signed long long sptr;
#else
-# if (SANITIZER_WORDSIZE == 64)
typedef unsigned long uptr;
typedef signed long sptr;
-# else
-typedef unsigned int uptr;
-typedef signed int sptr;
-# endif
#endif // defined(_WIN64)
#if defined(__x86_64__)
// Since x32 uses ILP32 data model in 64-bit hardware mode, we must use
@@ -187,17 +182,15 @@ typedef uptr OFF_T;
#endif
typedef u64 OFF64_T;
-#if (SANITIZER_WORDSIZE == 64)
+#if (SANITIZER_WORDSIZE == 64) || SANITIZER_MAC
typedef uptr operator_new_size_type;
#else
-# if defined(__s390__) && !defined(__s390x__)
+# if defined(__s390__) && !defined(__s390x__)
// Special case: 31-bit s390 has unsigned long as size_t.
typedef unsigned long operator_new_size_type;
-# elif SANITIZER_MAC
-typedef unsigned long operator_new_size_type;
-# else
+# else
typedef u32 operator_new_size_type;
-# endif
+# endif
#endif
typedef u64 tid_t;
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_malloc_mac.inc b/compiler-rt/lib/sanitizer_common/sanitizer_malloc_mac.inc
index c78f944df8b74..e3b664f68b618 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_malloc_mac.inc
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_malloc_mac.inc
@@ -186,7 +186,7 @@ size_t __sanitizer_mz_size(malloc_zone_t* zone, const void* ptr) {
extern "C"
SANITIZER_INTERFACE_ATTRIBUTE
-void *__sanitizer_mz_malloc(malloc_zone_t *zone, size_t size) {
+void *__sanitizer_mz_malloc(malloc_zone_t *zone, uptr size) {
COMMON_MALLOC_ENTER();
COMMON_MALLOC_MALLOC(size);
return p;
diff --git a/compiler-rt/lib/sanitizer_common/tests/sanitizer_bitvector_test.cpp b/compiler-rt/lib/sanitizer_common/tests/sanitizer_bitvector_test.cpp
index 385b6158300ca..670e96552c68f 100644
--- a/compiler-rt/lib/sanitizer_common/tests/sanitizer_bitvector_test.cpp
+++ b/compiler-rt/lib/sanitizer_common/tests/sanitizer_bitvector_test.cpp
@@ -71,7 +71,7 @@ void Print(const set<uptr> &s) {
#if defined(_WIN64)
fprintf(stderr, "%llu ", *it);
#else
- fprintf(stderr, "%zu ", *it);
+ fprintf(stderr, "%lu ", *it);
#endif
}
fprintf(stderr, "\n");
More information about the llvm-commits
mailing list