Лязг как фронтенд к g cc aarch64, - PullRequest
0 голосов
/ 12 апреля 2020

Я надеюсь использовать clang в качестве интерфейса для ассемблера g cc и компоновщика для arm64 (armv8-a, cortex-a57). Опция -no-integrated-as поддерживает это.

clang++-7 -v -target aarch64-unknown-linux-gnueabi --sysroot /usr/xcc/aarch64-unknown-linux-gnueabi/aarch64-unknown-linux-gnueabi/sysroot -I/usr/xcc/aarch64-unknown-linux-gnueabi/aarch64-unknown-linux-gnueabi/include/c++/4.9.4/aarch64-unknown-linux-gnueabi -I/usr/xcc/aarch64-unknown-linux-gnueabi/aarch64-unknown-linux-gnueabi/include/c++/4.9.4 -no-integrated-as hello.cc

Команда работает так, как если бы цель была задана по умолчанию (x86_64-p c - linux -gnu), я ожидаю использовать aarch64-unknown-linux-gnueabi-as, но вместо этого /usr/bin/as используется.

clang version 7.0.1-8~deb9u3 (tags/RELEASE_701/final)
Target: aarch64-unknown-linux-gnueabi
Thread model: posix
InstalledDir: /usr/bin
 "/usr/lib/llvm-7/bin/clang" -cc1 -triple aarch64-unknown-linux-gnueabi -S -disable-free -disable-llvm-verifier -discard-value-names -main-file-name hello.cc -mrelocation-model static -mthread-model posix -mdisable-fp-elim -fmath-errno -masm-verbose -no-integrated-as -mconstructor-aliases -fuse-init-array -target-cpu generic -target-feature +neon -target-abi aapcs -fallow-half-arguments-and-returns -dwarf-column-info -debugger-tuning=gdb -v -resource-dir /usr/lib/llvm-7/lib/clang/7.0.1 -I /usr/xcc/aarch64-unknown-linux-gnueabi/aarch64-unknown-linux-gnueabi/include/c++/4.9.4/aarch64-unknown-linux-gnueabi -I /usr/xcc/aarch64-unknown-linux-gnueabi/aarch64-unknown-linux-gnueabi/include/c++/4.9.4 -isysroot /usr/xcc/aarch64-unknown-linux-gnueabi/aarch64-unknown-linux-gnueabi/sysroot -internal-isystem /usr/include/clang/7.0.1/include/ -internal-isystem /usr/xcc/aarch64-unknown-linux-gnueabi/aarch64-unknown-linux-gnueabi/sysroot/usr/local/include -internal-isystem /usr/lib/llvm-7/lib/clang/7.0.1/include -internal-externc-isystem /usr/xcc/aarch64-unknown-linux-gnueabi/aarch64-unknown-linux-gnueabi/sysroot/include -internal-externc-isystem /usr/xcc/aarch64-unknown-linux-gnueabi/aarch64-unknown-linux-gnueabi/sysroot/usr/include -fdeprecated-macro -fno-dwarf-directory-asm -fdebug-compilation-dir /work -ferror-limit 19 -fmessage-length 101 -fno-signed-char -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -o /tmp/hello-ab8167.s -x c++ hello.cc
clang -cc1 version 7.0.1 based upon LLVM 7.0.1 default target x86_64-pc-linux-gnu
ignoring nonexistent directory "/usr/xcc/aarch64-unknown-linux-gnueabi/aarch64-unknown-linux-gnueabi/sysroot/usr/local/include"
ignoring nonexistent directory "/usr/xcc/aarch64-unknown-linux-gnueabi/aarch64-unknown-linux-gnueabi/sysroot/include"
ignoring duplicate directory "/usr/include/clang/7.0.1/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/xcc/aarch64-unknown-linux-gnueabi/aarch64-unknown-linux-gnueabi/include/c++/4.9.4/aarch64-unknown-linux-gnueabi
 /usr/xcc/aarch64-unknown-linux-gnueabi/aarch64-unknown-linux-gnueabi/include/c++/4.9.4
 /usr/include/clang/7.0.1/include
 /usr/xcc/aarch64-unknown-linux-gnueabi/aarch64-unknown-linux-gnueabi/sysroot/usr/include
End of search list.
 "/usr/bin/as" -I /usr/xcc/aarch64-unknown-linux-gnueabi/aarch64-unknown-linux-gnueabi/include/c++/4.9.4/aarch64-unknown-linux-gnueabi -I /usr/xcc/aarch64-unknown-linux-gnueabi/aarch64-unknown-linux-gnueabi/include/c++/4.9.4 -o /tmp/hello-f066af.o /tmp/hello-ab8167.s
/tmp/hello-ab8167.s: Assembler messages:
/tmp/hello-ab8167.s:4: Error: bad expression
/tmp/hello-ab8167.s:4: Warning: division by zero
/tmp/hello-ab8167.s:4: Error: bad or irreducible absolute expression
/tmp/hello-ab8167.s:4: Error: junk at end of line, first unrecognized character is `f'
/tmp/hello-ab8167.s:9: Error: too many memory references for `sub'
/tmp/hello-ab8167.s:10: Error: no such instruction: `stp x29,x30,[sp,'
/tmp/hello-ab8167.s:11: Error: too many memory references for `add'
/tmp/hello-ab8167.s:12: Error: bad register expression
/tmp/hello-ab8167.s:13: Error: bad register expression
/tmp/hello-ab8167.s:14: Error: bad register expression
/tmp/hello-ab8167.s:15: Error: no such instruction: `adrp x8,_ZStL8__ioinit'
/tmp/hello-ab8167.s:16: Error: too many memory references for `add'
/tmp/hello-ab8167.s:17: Error: no such instruction: `adrp x9,_ZNSt8ios_base4InitD1Ev'
/tmp/hello-ab8167.s:18: Error: too many memory references for `add'
/tmp/hello-ab8167.s:19: Error: too many memory references for `mov'
/tmp/hello-ab8167.s:20: Error: no such instruction: `adrp x2,__dso_handle'
/tmp/hello-ab8167.s:21: Error: too many memory references for `add'
/tmp/hello-ab8167.s:22: Error: no such instruction: `stur x0,[x29,'
/tmp/hello-ab8167.s:23: Error: too many memory references for `mov'
/tmp/hello-ab8167.s:24: Error: invalid char '[' beginning operand 2 `[sp'
/tmp/hello-ab8167.s:25: Error: invalid char '[' beginning operand 2 `[sp'
/tmp/hello-ab8167.s:26: Error: no such instruction: `bl _ZNSt8ios_base4InitC1Ev'
/tmp/hello-ab8167.s:27: Error: no such instruction: `ldr x0,[sp,'
/tmp/hello-ab8167.s:28: Error: no such instruction: `ldur x1,[x29,'
/tmp/hello-ab8167.s:29: Error: no such instruction: `ldr x2,[sp,'
/tmp/hello-ab8167.s:30: Error: no such instruction: `bl __cxa_atexit'
/tmp/hello-ab8167.s:31: Error: no such instruction: `ldp x29,x30,[sp,'
/tmp/hello-ab8167.s:32: Error: too many memory references for `add'
/tmp/hello-ab8167.s:39: Error: junk at end of line, first unrecognized character is `/'
/tmp/hello-ab8167.s:45: Error: too many memory references for `sub'
/tmp/hello-ab8167.s:46: Error: no such instruction: `stp x29,x30,[sp,'
/tmp/hello-ab8167.s:47: Error: too many memory references for `add'
/tmp/hello-ab8167.s:48: Error: bad register expression
/tmp/hello-ab8167.s:49: Error: bad register expression
/tmp/hello-ab8167.s:50: Error: bad register expression
/tmp/hello-ab8167.s:51: Error: no such instruction: `adrp x0,_ZSt4cout'
/tmp/hello-ab8167.s:52: Error: too many memory references for `add'
/tmp/hello-ab8167.s:53: Error: no such instruction: `adrp x8,.L.str'
/tmp/hello-ab8167.s:54: Error: too many memory references for `add'
/tmp/hello-ab8167.s:55: Error: no such instruction: `orr w9,wzr,'
/tmp/hello-ab8167.s:56: Error: no such instruction: `stur wzr,[x29,'
/tmp/hello-ab8167.s:57: Error: too many memory references for `mov'
/tmp/hello-ab8167.s:58: Error: invalid char '[' beginning operand 2 `[sp'
/tmp/hello-ab8167.s:59: Error: no such instruction: `bl _ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc'
/tmp/hello-ab8167.s:60: Error: no such instruction: `ldr w9,[sp,'
/tmp/hello-ab8167.s:61: Error: too many memory references for `mov'
/tmp/hello-ab8167.s:62: Error: no such instruction: `ldp x29,x30,[sp,'
/tmp/hello-ab8167.s:63: Error: too many memory references for `add'
/tmp/hello-ab8167.s:70: Error: bad expression
/tmp/hello-ab8167.s:70: Warning: division by zero
/tmp/hello-ab8167.s:70: Error: bad or irreducible absolute expression
/tmp/hello-ab8167.s:70: Error: junk at end of line, first unrecognized character is `f'
/tmp/hello-ab8167.s:75: Error: no such instruction: `stp x29,x30,[sp,'
/tmp/hello-ab8167.s:76: Error: too many memory references for `mov'
/tmp/hello-ab8167.s:77: Error: bad register expression
/tmp/hello-ab8167.s:78: Error: bad register expression
/tmp/hello-ab8167.s:79: Error: bad register expression
/tmp/hello-ab8167.s:80: Error: no such instruction: `bl __cxx_global_var_init'
/tmp/hello-ab8167.s:81: Error: no such instruction: `ldp x29,x30,[sp],'
/tmp/hello-ab8167.s:87: Error: junk at end of line, first unrecognized character is `/'
/tmp/hello-ab8167.s:91: Error: junk at end of line, first unrecognized character is `/'
/tmp/hello-ab8167.s:99: Error: unknown pseudo-op: `.xword'
clang: error: assembler command failed with exit code 1 (use -v to see invocation)
...