Description
Bugzilla Link | 29017 |
Version | trunk |
OS | Linux |
Reporter | LLVM Bugzilla Contributor |
CC | @compnerd,@echristo,@ismail,@kraj |
Extended Description
Currently, the DwarfCFIException class writes the sections that the CFI emits (via a .cfi_sections directive) within its endModule() method, after all the other CFI info has already been output. This renders the resulting .s files impossible for gnu as to process, since by the rules gnu as uses for the .cfi* directives the last .cfi_sections directive must precede the first .cfi_startproc directive (see 7.10.1 @ https://sourceware.org/binutils/docs/as/CFI-directives.html). This rule has been enforced in gas since Feb 2016 (commit bd5608dcc6a76876db06b1af1852252a4282aa2f), after the 2.26 release, and I've been able to reproduce it for aarch64 and sparc, like this:
cd binutils-build
../binutils-x86/configure --target=aarch64-linux && make
cd ../t
cat t.c
int main()
{
}
../clang-build/bin/clang 1.c -S -O0 -ggdb -target aarch64
../binutils-build/gas/as-new 1.s
t.s: Assembler messages:
t.s:142: Error: inconsistent uses of .cfi_sections
This problem has also been reported at http://lists.llvm.org/pipermail/llvm-dev/2016-August/103519.html.