-integrated-as ignored for assembly files?

I’m attempting to compile ARM assembly files using the integrated assembler, but am seeing clang ignore the ‘-integrated-as’ flag and go to the external ‘as’ for compilation (or -ccc-gcc-name if present). A bug?

Thanks,
Greg

or missing feature. Is this ELF or Mach-O?

ELF. And if I try to use llvm-mc directly, it chokes on ‘.eabi_attribute’. Is there a way to query llvm-mc for available ‘-triple’ values? I notice that if I just make one up like ‘armv7-bogus’, it just silently ignores it.

Thanks,
Greg

ELF. And if I try to use llvm-mc directly, it chokes on '.eabi_attribute'.
Is there a way to query llvm-mc for available '-triple' values? I notice
that if I just make one up like 'armv7-bogus', it just silently ignores it.

I don't think there is a way to query it. Unfortunately MC is missing
support for parsing ELF ARM assembly.

Thanks,
Greg

Cheers,
Rafael

Hi Greg,

ELF. And if I try to use llvm-mc directly, it chokes on '.eabi_attribute'.

Well, for me clang shows the behaviour you're describing with a
bare-metal triple (e.g. arm-none-eabi) but really does try to use the
integrated-assembler for a linux triple (arm-none-linux-gnueabi for
example). It still fails when it hits .eabi_attribute, of course.

I can't speak for anyone else, but I'd have no problem with making
"clang -integrated-as" accept GNU style assembly for bare-metal ELF
targets too.

As for .eabi_attribute directives themselves, they're described in the
ARM ELF ABI (same place as mapping symbols) and the Addenda document
(try searching for "ARM aeabi attributes" or "ARM ABI Addenda").

But it's fairly clearly unimplemented in LLVM for assembling (see
AsmParser/ARMAsmParser.cpp:parseDirectiveEabiAttr). AsmPrinter.cpp
seems to take a stab at emitting the directives it thinks should be
present when outputting assembly; I'm suspicious of the code deciding
what to emit (and can't actually get it to trigger either!) but can't
see anything obviously wrong with it.

Where to go from here rather depends on your goals. Stripping out the
.eabi_attribute directives is dodgy, but mostly from a
quality-of-implementation perspective. If you're careful with the
linker commands you run and libraries you have available, you
shouldn't hit the compatibility issues they were designed to avoid.
Otherwise, there's either GAS or implementing attributes in LLVM more
thoroughly.

I'm not sure I've been much help here.

Tim.