Skip to content

Conversation

@kraj
Copy link
Contributor

@kraj kraj commented May 23, 2025

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.

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.

Signed-off-by: Khem Raj <[email protected]>
@llvmbot
Copy link
Member

llvmbot commented May 23, 2025

@llvm/pr-subscribers-compiler-rt-sanitizer

Author: Khem Raj (kraj)

Changes

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.


Full diff: https://github.com/llvm/llvm-project/pull/141201.diff

1 Files Affected:

  • (modified) compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h (+1-1)
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h b/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h
index fff60c96f632f..511ee8fe49ccd 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h
@@ -139,7 +139,7 @@
 namespace __sanitizer {
 
 #if defined(__UINTPTR_TYPE__)
-#  if defined(__arm__) && defined(__linux__)
+#  if (defined(__arm__) || _ABIO32 == 1) && defined(__linux__)
 // Linux Arm headers redefine __UINTPTR_TYPE__ and disagree with clang/gcc.
 typedef unsigned int uptr;
 typedef int sptr;

kraj added a commit to kraj/llvm-project that referenced this pull request Jun 12, 2025
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 <[email protected]>
kraj added a commit to kraj/llvm-project that referenced this pull request Jun 12, 2025
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 <[email protected]>
kraj added a commit to kraj/llvm-project that referenced this pull request Nov 24, 2025
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 <[email protected]>
kraj added a commit to kraj/llvm-project that referenced this pull request Nov 24, 2025
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 <[email protected]>
kraj added a commit to kraj/llvm-project that referenced this pull request Nov 24, 2025
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 <[email protected]>
kraj added a commit to kraj/llvm-project that referenced this pull request Nov 25, 2025
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 <[email protected]>
kraj added a commit to kraj/llvm-project that referenced this pull request Nov 25, 2025
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 <[email protected]>
kraj added a commit to kraj/llvm-project that referenced this pull request Nov 25, 2025
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 <[email protected]>
kraj added a commit to kraj/llvm-project that referenced this pull request Nov 27, 2025
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 <[email protected]>
kraj added a commit to kraj/llvm-project that referenced this pull request Nov 27, 2025
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 <[email protected]>
kraj added a commit to kraj/llvm-project that referenced this pull request Nov 27, 2025
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 <[email protected]>
kraj added a commit to kraj/llvm-project that referenced this pull request Nov 27, 2025
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 <[email protected]>
kraj added a commit to kraj/llvm-project that referenced this pull request Nov 28, 2025
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 <[email protected]>
kraj added a commit to kraj/llvm-project that referenced this pull request Nov 29, 2025
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 <[email protected]>
kraj added a commit to kraj/llvm-project that referenced this pull request Nov 30, 2025
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 <[email protected]>
kraj added a commit to kraj/llvm-project that referenced this pull request Nov 30, 2025
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 <[email protected]>
kraj added a commit to kraj/llvm-project that referenced this pull request Dec 1, 2025
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 <[email protected]>
kraj added a commit to kraj/llvm-project that referenced this pull request Dec 1, 2025
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 <[email protected]>
kraj added a commit to kraj/llvm-project that referenced this pull request Dec 1, 2025
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 <[email protected]>
kraj added a commit to kraj/llvm-project that referenced this pull request Dec 1, 2025
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 <[email protected]>
kraj added a commit to kraj/llvm-project that referenced this pull request Dec 2, 2025
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 <[email protected]>
kraj added a commit to kraj/llvm-project that referenced this pull request Dec 2, 2025
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 <[email protected]>
kraj added a commit to kraj/llvm-project that referenced this pull request Dec 2, 2025
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 <[email protected]>
kraj added a commit to kraj/llvm-project that referenced this pull request Dec 3, 2025
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 <[email protected]>
kraj added a commit to kraj/llvm-project that referenced this pull request Dec 3, 2025
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 <[email protected]>
kraj added a commit to kraj/llvm-project that referenced this pull request Dec 7, 2025
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 <[email protected]>
kraj added a commit to kraj/llvm-project that referenced this pull request Dec 7, 2025
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 <[email protected]>
kraj added a commit to kraj/llvm-project that referenced this pull request Dec 8, 2025
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 <[email protected]>
kraj added a commit to kraj/llvm-project that referenced this pull request Dec 8, 2025
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 <[email protected]>
kraj added a commit to kraj/llvm-project that referenced this pull request Dec 8, 2025
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 <[email protected]>
kraj added a commit to kraj/llvm-project that referenced this pull request Dec 10, 2025
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 <[email protected]>
kraj added a commit to kraj/llvm-project that referenced this pull request Dec 10, 2025
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 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants