Skip to content

Commit 5b02575

Browse files
committed
[compiler-rt] Hardcode uptr/sptr typedefs on Mips/Linux
Sanitizer build on Mips/Linux faills to build due to assertion errors mismatched definitions. This is due to inconsistent definitions of `uptr` of either `unsigned long` or `unsigned int` in compiler-rt. This is caused by clang defining __UINTPTR_TYPE__ long unsigned int where as gcc defines it as unsigned int As a workaround, this hardcodes `uptr`/`sptr` in compiler-rt to `unsigned int`/`int` on Linux Mips, matching gcc. Upstream-Status: Submitted [llvm#141201] Signed-off-by: Khem Raj <raj.khem@gmail.com>
1 parent 0922e92 commit 5b02575

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@
139139
namespace __sanitizer {
140140

141141
#if defined(__UINTPTR_TYPE__)
142-
# if defined(__arm__) && defined(__linux__)
142+
# if (defined(__arm__) || _ABIO32 == 1) && defined(__linux__)
143143
// Linux Arm headers redefine __UINTPTR_TYPE__ and disagree with clang/gcc.
144144
typedef unsigned int uptr;
145145
typedef int sptr;

0 commit comments

Comments
 (0)