現在用gcc: gcc-linaro-7.5.0-2019.12-x86_64_aarch64-elf
gdb: gdb-8.3.1
編譯失敗: aarch64-elf-gcc test.c
會提示crt0.o找不到。
想請教下能正常編譯嗎?如果編譯引數如何配置gdb的 confgiure,
謝謝!
uj5u.com熱心網友回復:
肯定能編譯啊,感覺你的意思就是在交叉編譯uj5u.com熱心網友回復:
是交叉編譯但編譯不成功
uj5u.com熱心網友回復:
1. 你的交叉工具鏈是否是完整的?2. gdb-8.3.1你是如何配置的?貼下你的配置。
uj5u.com熱心網友回復:
export PATH=/home/gmb/code/gdb/gcc-linaro-7.5.0-2019.12-x86_64_aarch64-elf/bin:$PATH
export CC="aarch64-elf-gcc --sysroot=/home/gmb/code/gdb/sysroot-newlib-linaro-2019.12-aarch64-elf"
../configure --prefix=`pwd` \
CFLAGS="-O2 -v --static --specs=rdimon.specs -Wl,--start-group -lgcc -lc -lm -lrdimon -Wl,--end-group " \
CXXFLAGS="-O2 -v --static --specs=rdimon.specs -Wl,--start-group -lgcc -lc -lm -lrdimon -Wl,--end-group" \
--host=aarch64-elf \
--target=aarch64-elf
編譯報:
rm -f util.o
checking whether ln -s works... yes
checking the maximum length of command line arguments... Compiler executable checksum: e1In file included from ../../ readline/rltty.c:44:0:
../../readline/rltty.h:40:12: fatal error: sgtty.h: No such file or directory
# include <sgtty.h>
^~~~~~~~~
compilation terminated.
03f8fc478a9c99c0382ec249Using built-in specs.
uj5u.com熱心網友回復:
配置在上面
不同機器上報的錯不一樣。。
uj5u.com熱心網友回復:
你這個是缺包。沒有glibc-devuj5u.com熱心網友回復:
/usr/include/ 就有這個檔案的。如果包含這個路徑就會報其他的錯 。。。。
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/63265.html
標籤:應用程序開發區
上一篇:Linux中的重定向符
下一篇:Ubuntu 下怎么編譯C語言
