WhyCan Forum

本站无需注册,无需积分,无需回复可下载所有资料,如果真的喜欢小站,请您注册之后请至少回复一个帖子激活Id,谢谢支持! 站长QQ: 516333132 (挖坑网/填坑网) admin@whycan.cn

您尚未登录。

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

chendong
会员
注册时间: 2019-07-22
累计积分: 34

编译器报故障,求帮助。

交叉编译现在还是有点蒙圈,哪位解答一下。谢谢
我下载了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

晕哥
Administrator
注册时间: 2017-09-06
累计积分: 7,180

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

离线

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

chendong
会员
注册时间: 2019-07-22
累计积分: 34

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

晕哥
Administrator
注册时间: 2017-09-06
累计积分: 7,180

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

C compiler cannot create executables

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


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

离线

页脚