[llvm-bugs] [Bug 28952] New: bx instruction generated with -march=armv4 needs --fix-v4bx with external assembler
via llvm-bugs
llvm-bugs at lists.llvm.org
Fri Aug 12 09:37:32 PDT 2016
https://llvm.org/bugs/show_bug.cgi?id=28952
Bug ID: 28952
Summary: bx instruction generated with -march=armv4 needs
--fix-v4bx with external assembler
Product: clang
Version: 3.9
Hardware: PC
OS: All
Status: NEW
Severity: normal
Priority: P
Component: LLVM Codegen
Assignee: unassignedclangbugs at nondot.org
Reporter: raj.khem at gmail.com
CC: llvm-bugs at lists.llvm.org
Classification: Unclassified
This program below
extern void (*foo_func) ();
void
foo ()
{
(*foo_func) ();
}
when compiled like below using armv4 for march, ends up wit errors when
assembling
"/mnt/oe/openembedded-core/build/tmp-glibc/sysroots/x86_64-linux/usr/bin/arm-oe-linux-gnueabi/arm-oe-linux-gnueabi-as"
-mfloat-abi=softfp -march=armv4 -o a.o /tmp/kraj01/a-0c2038.s
/tmp/kraj01/a-0c2038.s: Assembler messages:
/tmp/kraj01/a-0c2038.s:27: Error: selected processor does not support `bx r0'
in ARM mode
The reason is that when using GNU bintuils we need to pass --fix-v4bx to
assembler and linker when using -march=armv4, to support EABI
here is compile cmd to reproduce it. key options are "-no-integrated-as
-march=armv4 -mfloat-abi=softfp -O2" if I add "-Wa,--fix-v4bx" it works. So
when driver detects that -no-integrated-as + -march-armv4 is used the
--fix-v4bx should be passed unconditionally to assembler
"/mnt/oe/openembedded-core/build/tmp-glibc/sysroots/x86_64-linux/usr/bin/clang-3.9"
-cc1 -triple armv4-oe-linux-gnueabi -S -disable-free -disable-llvm-verifier
-discard-value-names -main-file-name a.c -mrelocation-model static
-mthread-model posix -mdisable-fp-elim -fmath-errno -masm-verbose
-no-integrated-as -mconstructor-aliases -target-cpu strongarm -target-feature
+soft-float-abi -target-feature +strict-align -target-abi aapcs-linux
-mfloat-abi soft -v -dwarf-column-info -debugger-tuning=gdb -coverage-file
/mnt/oe/openembedded-core/build/tmp-glibc/work/armv5e-oe-linux-gnueabi/gmp/6.1.1-r0/build/mpz/a.c
-resource-dir
/mnt/oe/openembedded-core/build/tmp-glibc/sysroots/x86_64-linux/usr/bin/../lib/clang/3.9.0
-internal-isystem /usr/local/include -internal-isystem
/mnt/oe/openembedded-core/build/tmp-glibc/sysroots/x86_64-linux/usr/bin/../lib/clang/3.9.0/include
-internal-externc-isystem /include -internal-externc-isystem /usr/include -O2
-fno-dwarf-directory-asm -fdebug-compilation-dir
/mnt/oe/openembedded-core/build/tmp-glibc/work/armv5e-oe-linux-gnueabi/gmp/6.1.1-r0/build/mpz
-ferror-limit 19 -fmessage-length 238 -fallow-half-arguments-and-returns
-fno-signed-char -fobjc-runtime=gcc -fdiagnostics-show-option
-fcolor-diagnostics -vectorize-loops -vectorize-slp -o /tmp/kraj01/a-0c2038.s
-x c a.c
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160812/b9e90c5f/attachment.html>
More information about the llvm-bugs
mailing list