[llvm-dev] clang compile c source file for ARM

Valiant wang via llvm-dev llvm-dev at lists.llvm.org
Wed Mar 2 03:27:50 PST 2016


I have tried to use many target types to compile hello.c for ARM on
ubuntu_x86 with clang v3.4 but all failed,anyone knows the correct types? I
can`t get any type information on llvm document.
I tried the following commands:

clang -target arm hello.c ,

clang -target armv7 hello.c ,

clang -target armv7-a hello.c,

clang -target arm-eabi hello.c


$ clang -target arm-none-eabi hello.c/tmp/hello-c8aebe.s: Assembler
messages:/tmp/hello-c8aebe.s:1: Error: unknown pseudo-op: `.syntax'
/tmp/hello-c8aebe.s:2: Error: unknown pseudo-op: `.cpu'
/tmp/hello-c8aebe.s:3: Error: unknown pseudo-op:
`.eabi_attribute'/tmp/hello-c8aebe.s:4: Error: unknown pseudo-op:
`.eabi_attribute'
/tmp/hello-c8aebe.s:5: Error: unknown pseudo-op: `.eabi_attribute'
/tmp/hello-c8aebe.s:6: Error: unknown pseudo-op:
`.eabi_attribute'/tmp/hello-c8aebe.s:7: Error: unknown pseudo-op:
`.eabi_attribute'
/tmp/hello-c8aebe.s:8: Error: unknown pseudo-op: `.eabi_attribute'
/tmp/hello-c8aebe.s:9: Error: unknown pseudo-op:
`.eabi_attribute'/tmp/hello-c8aebe.s:16: Error: invalid char '{'
beginning operand 1 `{r11'
/tmp/hello-c8aebe.s:17: Error: too many memory references for `mov'
/tmp/hello-c8aebe.s:18: Error: too many memory references for
`sub'/tmp/hello-c8aebe.s:19: Error: expecting operand after ','; got
nothing/tmp/hello-c8aebe.s:20: Error: invalid char '[' beginning
operand 2 `[r11'
/tmp/hello-c8aebe.s:21: Error: no such instruction: `ldr r1,.LCPI0_0'
/tmp/hello-c8aebe.s:22: Error: invalid char '[' beginning operand 2
`[sp'/tmp/hello-c8aebe.s:23: Error: too many memory references for
`mov'
/tmp/hello-c8aebe.s:24: Error: no such instruction: `bl printf'
/tmp/hello-c8aebe.s:25: Error: no such instruction: `ldr
r1,[sp,'/tmp/hello-c8aebe.s:26: Error: invalid char '[' beginning
operand 2 `[sp'
/tmp/hello-c8aebe.s:27: Error: too many memory references for `mov'
/tmp/hello-c8aebe.s:28: Error: too many memory references for
`mov'/tmp/hello-c8aebe.s:29: Error: invalid char '{' beginning operand
1 `{r11'
/tmp/hello-c8aebe.s:30: Error: no such instruction: `bx lr'
clang: error: assembler (via gcc) command failed with exit code 1 (use
-v to see invocation)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160302/58ee6231/attachment-0001.html>


More information about the llvm-dev mailing list