[compiler-rt] [compiler-rt] Simplify definition of uptr (PR #106155)
Alexander Richardson via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 10 14:25:30 PDT 2024
arichardson wrote:
Oh that is rather nasty - it sounds like Clang has the wrong __UINTPTR_TYPE__ for Android arm32? And I guess changing that could have surprising effects?
I am surprised you did not get a compiler error, the compiler-rt/lib/interception/interception_type_test.cpp file should have failed to compile (unless it happens that in that file asm/types.h is included first and redefines __UINTPTR_TYPE__.
I wonder if the workaround would be something like the following
```
#if defined(__arm) && defined(__linux__)
#include <asm/types.h>
#endif
```
Or alternatively just adding
```
#if defined(__arm) && defined(__linux__)
// Clang and the Linux Arm headers disagree on uintptr_t
typedef unsigned long uptr;
typedef unsigned long sptr;
#endif
```
https://github.com/llvm/llvm-project/pull/106155
More information about the llvm-commits
mailing list