[cfe-dev] Q: ARM, why -marm is ignored

valerij zaporogeci via cfe-dev cfe-dev at lists.llvm.org
Wed Jun 30 18:03:24 PDT 2021


Hi, I wanted to compile a UEFI OS loader with clang (as well) for 32
bit ARM, but, it turned out, that clang always generates Thumb only
code and sets MachineType to 1c4 (ARMv7 (or higher) Thumb mode only),
which is not what UEFI wants, it wants 1c2 (ARM or Thumb). I am
compiling, setting the target to "armv7a-unknown-windows-eabihf".
maybe there is another target, better suitable for a UEFI OSL (I wish
I could find info about all of them)? for example, as a wild guess, I
gave it "efi" instead of "windows" and it accepted it, however
generated an ELF object file. as said in the title, gcc's -marm option
(that is not reported as not recognized) gets absolutely ignored. tell
me please:
1) what target should I use to generate a UEFI compatible executable
(MachineType 1c2)?
2) is there a way to force clang generate ARM mode only code for
windows (PE) targets?


More information about the cfe-dev mailing list