[libc-commits] [libc] [libc][cmake] pass -mthumb for thumb triples (PR #96550)
via libc-commits
libc-commits at lists.llvm.org
Mon Jun 24 15:53:56 PDT 2024
enh-google wrote:
> > why do you? bionic doesn't compile any of its syscall stubs as thumb. why should you?
>
> When I last tried to build llvm-libc via the existing Android.bp files, I got an error that the syscall stubs didn't support `-mthumb`. So it seems that the default implicit compiler flags on android set `-mthumb`.
yes, the global default is thumb, because -- by default, anyway -- why wouldn't we let the compiler use thumb instructions? you can override it with
```
instruction_set: "arm",
```
in your .bp file. (we do this for all of libm, for example. except for the bits that come from external/arm-optimized-routines, though i assume that's just another "it's ILP32; nobody cares" oversight.)
> I don't personally care, but it seems that llvm-libc for Android is being built in thumb mode, so I thought it was important. Should I be setting `-marm` for all of llvm-libc in the Android.bp file (for 32b arm), or just the syscalls?
up to you. (given that the main _alleged_ reason for using the `arm` override is performance, i'd be happy to argue that it makes sense for all of libc.)
> > ILP32 will be completely dead to us soon anyway.)
>
> So I've been hearing for years.
aye, it takes a very long time to ratchet these things down. the number of niches where you can still ship a 32-bit device is increasingly limited though.
https://github.com/llvm/llvm-project/pull/96550
More information about the libc-commits
mailing list