Skip to content

Commit 3a05af1

Browse files
committed
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 ae0628f. This reverts commit 2c6448c.
1 parent eec3495 commit 3a05af1

File tree

3 files changed

+6
-13
lines changed

3 files changed

+6
-13
lines changed

compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -139,13 +139,8 @@ namespace __sanitizer {
139139
typedef unsigned long long uptr;
140140
typedef signed long long sptr;
141141
#else
142-
# if (SANITIZER_WORDSIZE == 64)
143142
typedef unsigned long uptr;
144143
typedef signed long sptr;
145-
# else
146-
typedef unsigned int uptr;
147-
typedef signed int sptr;
148-
# endif
149144
#endif // defined(_WIN64)
150145
#if defined(__x86_64__)
151146
// Since x32 uses ILP32 data model in 64-bit hardware mode, we must use
@@ -187,17 +182,15 @@ typedef uptr OFF_T;
187182
#endif
188183
typedef u64 OFF64_T;
189184

190-
#if (SANITIZER_WORDSIZE == 64)
185+
#if (SANITIZER_WORDSIZE == 64) || SANITIZER_MAC
191186
typedef uptr operator_new_size_type;
192187
#else
193-
# if defined(__s390__) && !defined(__s390x__)
188+
# if defined(__s390__) && !defined(__s390x__)
194189
// Special case: 31-bit s390 has unsigned long as size_t.
195190
typedef unsigned long operator_new_size_type;
196-
# elif SANITIZER_MAC
197-
typedef unsigned long operator_new_size_type;
198-
# else
191+
# else
199192
typedef u32 operator_new_size_type;
200-
# endif
193+
# endif
201194
#endif
202195

203196
typedef u64 tid_t;

compiler-rt/lib/sanitizer_common/sanitizer_malloc_mac.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ size_t __sanitizer_mz_size(malloc_zone_t* zone, const void* ptr) {
186186

187187
extern "C"
188188
SANITIZER_INTERFACE_ATTRIBUTE
189-
void *__sanitizer_mz_malloc(malloc_zone_t *zone, size_t size) {
189+
void *__sanitizer_mz_malloc(malloc_zone_t *zone, uptr size) {
190190
COMMON_MALLOC_ENTER();
191191
COMMON_MALLOC_MALLOC(size);
192192
return p;

compiler-rt/lib/sanitizer_common/tests/sanitizer_bitvector_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ void Print(const set<uptr> &s) {
7171
#if defined(_WIN64)
7272
fprintf(stderr, "%llu ", *it);
7373
#else
74-
fprintf(stderr, "%zu ", *it);
74+
fprintf(stderr, "%lu ", *it);
7575
#endif
7676
}
7777
fprintf(stderr, "\n");

0 commit comments

Comments
 (0)