您尚未登录。

楼主 #1 2019-07-28 17:45:15

chendong
会员
注册时间: 2019-07-22
已发帖子: 90
积分: 91

编译器报故障,求帮助。

交叉编译现在还是有点蒙圈,哪位解答一下。谢谢
我下载了gcc-linaro-6.3.1-2017.02-x86_64_arm-linux-gnueabihf.tar,解压到了/opt目录下
sinlinx@ubuntu://opt/gcc-linaro-6.3.1-2017.02-x86_64_arm-linux-gnueabihf$ ls
arm-linux-gnueabihf  bin  gcc-linaro-6.3.1-2017.02-linux-manifest.txt  include  lib  libexec  share
然后设置PATH:
export PATH=/opt/gcc-linaro-6.3.1-2017.02-x86_64_arm-linux-gnueabihf/bin:$PATH
重启,用arm-linux-gnueabihf-gcc -v 查看
sinlinx@ubuntu://opt/gcc-linaro-6.3.1-2017.02-x86_64_arm-linux-gnueabihf$ arm-linux-gnueabihf-gcc -v
Using built-in specs.
COLLECT_GCC=arm-linux-gnueabihf-gcc
COLLECT_LTO_WRAPPER=/opt/gcc-linaro-6.3.1-2017.02-x86_64_arm-linux-gnueabihf/bin/../libexec/gcc/arm-linux-gnueabihf/6.3.1/lto-wrapper
Target: arm-linux-gnueabihf
Configured with: /home/tcwg-buildslave/workspace/tcwg-make-release/label/docker-trusty-amd64-tcwg-build/target/arm-linux-gnueabihf/snapshots/gcc-linaro-6.3-2017.02/configure SHELL=/bin/bash --with-mpc=/home/tcwg-buildslave/workspace/tcwg-make-release/label/docker-trusty-amd64-tcwg-build/target/arm-linux-gnueabihf/_build/builds/destdir/x86_64-unknown-linux-gnu --with-mpfr=/home/tcwg-buildslave/workspace/tcwg-make-release/label/docker-trusty-amd64-tcwg-build/target/arm-linux-gnueabihf/_build/builds/destdir/x86_64-unknown-linux-gnu --with-gmp=/home/tcwg-buildslave/workspace/tcwg-make-release/label/docker-trusty-amd64-tcwg-build/target/arm-linux-gnueabihf/_build/builds/destdir/x86_64-unknown-linux-gnu --with-gnu-as --with-gnu-ld --disable-libmudflap --enable-lto --enable-objc-gc --enable-shared --without-included-gettext --enable-nls --disable-sjlj-exceptions --enable-gnu-unique-object --enable-linker-build-id --disable-libstdcxx-pch --enable-c99 --enable-clocale=gnu --enable-libstdcxx-debug --enable-long-long --with-cloog=no --with-ppl=no --with-isl=no --disable-multilib --with-float=hard --with-mode=thumb --with-tune=cortex-a9 --with-arch=armv7-a --with-fpu=vfpv3-d16 --enable-threads=posix --enable-multiarch --enable-libstdcxx-time=yes --enable-gnu-indirect-function --with-build-sysroot=/home/tcwg-buildslave/workspace/tcwg-make-release/label/docker-trusty-amd64-tcwg-build/target/arm-linux-gnueabihf/_build/sysroots/arm-linux-gnueabihf --with-sysroot=/home/tcwg-buildslave/workspace/tcwg-make-release/label/docker-trusty-amd64-tcwg-build/target/arm-linux-gnueabihf/_build/builds/destdir/x86_64-unknown-linux-gnu/arm-linux-gnueabihf/libc --enable-checking=release --disable-bootstrap --enable-languages=c,c++,fortran,lto --build=x86_64-unknown-linux-gnu --host=x86_64-unknown-linux-gnu --target=arm-linux-gnueabihf --prefix=/home/tcwg-buildslave/workspace/tcwg-make-release/label/docker-trusty-amd64-tcwg-build/target/arm-linux-gnueabihf/_build/builds/destdir/x86_64-unknown-linux-gnu
Thread model: posix
gcc version 6.3.1 20170109 (Linaro GCC 6.3-2017.02)
看着没啥问题啊。然后我写可一个hello.c文件测试一下。提示连接不到库,这该怎么设置,晕了。
arm-linux-gnueabihf-gcc -W -o hello hello.c
/opt/gcc-linaro-6.3.1-2017.02-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/6.3.1/../../../../arm-linux-gnueabihf/bin/ld: cannot find /lib/libc.so.6
/opt/gcc-linaro-6.3.1-2017.02-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/6.3.1/../../../../arm-linux-gnueabihf/bin/ld: cannot find /usr/lib/libc_nonshared.a
/opt/gcc-linaro-6.3.1-2017.02-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/6.3.1/../../../../arm-linux-gnueabihf/bin/ld: cannot find /lib/ld-linux-armhf.so.3
collect2: error: ld returned 1 exit status

最近编辑记录 chendong (2019-07-28 17:46:32)

离线

#2 2019-07-28 17:59:21

晕哥
管理员
注册时间: 2017-09-06
已发帖子: 9,342
积分: 9202

离线

楼主 #3 2019-07-28 18:18:58

chendong
会员
注册时间: 2019-07-22
已发帖子: 90
积分: 91

Re: 编译器报故障,求帮助。

64bit ,发现用root 编译没问题。晕菜。这个礼拜在一直pjsip 搞死了。咋sip 用configure 出现这个提示
./configure --prefix=/home/sinlinx/SIN-V3s/pjsip/pj-out --host=arm-linux-gnueabihf --disable-video --disable-ffmpeg --disable-v4l2 --disable-openh264 --disable-libyuv --disable-libwebrtc
checking build system type... x86_64-unknown-linux-gnu
checking host system type... arm-unknown-linux-gnueabihf
checking target system type... arm-unknown-linux-gnueabihf
checking for arm-linux-gnueabihf-gcc... arm-linux-gnueabihf-gcc
checking whether the C compiler works... no
aconfigure: error: in `//home/sinlinx/SIN-V3s/pjsip/pjproject-2.8':
aconfigure: error: C compiler cannot create executables
See `config.log' for more details

不能创建这个,我还特意用root 配置。谢谢。

离线

#4 2019-07-28 18:24:09

晕哥
管理员
注册时间: 2017-09-06
已发帖子: 9,342
积分: 9202

Re: 编译器报故障,求帮助。

C compiler cannot create executables

C编译器不能创建可执行文件?


root 编译没问题, 那就先 sudo su 试一试了.





离线

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn