Currently there is no implementation of sys::getHostCPUName() for Darwin ARM targets. This patch makes it so that LLVM running on ARM makes reasonable guesses about the CPU features of the host CPU.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/Support/Host.cpp | ||
---|---|---|
1236 | Modern Apple 64-bit devices can't execute 32bit code, so that really should never happen. If it does, returning a value that matches the binary's CPU type/subtype is probably reasonable. I could break the arm 32/64-bit implementations up into separate ifdef blocks if that seems more sane to you. In that case we could return cyclone for arm 32 in the arm 64 implementation, but we would still likely want the sys call to determine if the cpu type is 64 or 32 bit. | |
1243 | Sure... Until arm64e pointer authentication lands in upstream (see @rjmccall's RFC). At which point this changes. I tried to structure the code to take that into account. |
Rebasing and updating to separate arm32 and arm64.
I beleive this is the simplest correct implementation based on the state of the in-tree Aarch64 support.
What do 64-bit devices return here? (I assume the call returns CPU_TYPE_ARM for 32-bit code regardless of the CPU?)