[cfe-dev] -integrated-as ignored for assembly files?

Tim Northover t.p.northover at gmail.com
Tue Oct 16 12:43:23 PDT 2012


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.



More information about the cfe-dev mailing list