[LLVMdev] Targeting ARM Cortex-a9 from x86_64 with clang

Rob Stewart robstewart57 at gmail.com
Tue Nov 26 07:36:11 PST 2013


Hi, here's the canonical helloworld.c

#include<stdio.h>

int main()
{
    printf("Hello World");
    return 0;
}

In accordance with the cross-compilation LLVM documentation [1], I am
trying to target the ARM on the Zedboard [2]. It is an ARM Cortex-A9.
The machine I am compiling on is an x86_64 Fedora Linux machine, using
clang 3.3. I am failing to generate an executable, instead seeing an
error "unrecognized option '-mfpu=neon'".

$ clang -v -target armv7a-linux-eabi -mcpu=cortex-a9 -mfloat-abi=soft
-mfpu=neon helloworld.c
clang version 3.3 (tags/RELEASE_33/rc3)
Target: armv7a--linux-eabi
Thread model: posix
 "/usr/bin/clang" -cc1 -triple armv7--linux-eabi -S -disable-free
-disable-llvm-verifier -main-file-name helloworld.c -mrelocation-model
static -mdisable-fp-elim -fmath-errno -mconstructor-aliases
-fuse-init-array -target-abi aapcs -target-cpu cortex-a9 -msoft-float
-mfloat-abi soft -target-feature +soft-float -target-feature
+soft-float-abi -target-feature +neon -target-feature -neon
-target-linker-version 2.23.52.0.1 -v -resource-dir
/usr/bin/../lib/clang/3.3 -internal-isystem /usr/local/include
-internal-isystem /usr/bin/../lib/clang/3.3/include
-internal-externc-isystem /usr/include -internal-externc-isystem
/usr/lib/gcc/x86_64-redhat-linux/4.8.2/include
-fno-dwarf-directory-asm -fdebug-compilation-dir /tmp -ferror-limit 19
-fmessage-length 157 -mstackrealign -fno-signed-char
-fobjc-runtime=gcc -fobjc-default-synthesize-properties
-fdiagnostics-show-option -fcolor-diagnostics -backend-option
-vectorize-loops -o /tmp/helloworld-SVQDb9.s -x c helloworld.c
clang -cc1 version 3.3 based upon LLVM 3.3 default target
x86_64-redhat-linux-gnu
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /usr/bin/../lib/clang/3.3/include
 /usr/include
 /usr/lib/gcc/x86_64-redhat-linux/4.8.2/include
End of search list.
 "/usr/bin/as" -mfpu=neon -mfloat-abi=soft -mcpu=cortex-a9 -mfpu=neon
-o /tmp/helloworld-DFsRi6.o /tmp/helloworld-SVQDb9.s
/usr/bin/as: unrecognized option '-mfpu=neon'
clang: error: assembler command failed with exit code 1 (use -v to see
invocation)


Any ideas? Thanks!

[1] - http://clang.llvm.org/docs/CrossCompilation.html
[2] - http://elinux.org/Zedboard



More information about the llvm-dev mailing list