2017-11-16 19 views
0

は、Ubuntuの16.04.Andのツールをコンパイルし、次のようにクロスコンパイラが働くことができることを示していますクロスコンパイルの問題

Using built-in specs. 
COLLECT_GCC=arm-linux-gnueabihf-gcc 
COLLECT_LTO_WRAPPER=/home/nju/ti-processor-linux-sdk/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/../libexec/gcc/arm-linux-gnueabihf/6.2.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.2-2016.11/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-libstdcxx-pch --disable-libmudflap --with-cloog=no --with-ppl=no --with-isl=no --disable-nls --enable-c99 --enable-gnu-indirect-function --disable-multilib --with-tune=cortex-a9 --with-arch=armv7-a --with-fpu=vfpv3-d16 --with-float=hard --with-mode=thumb --enable-multiarch --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 --enable-lto --enable-linker-build-id --enable-long-long --enable-shared --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-languages=c,c++,fortran,lto --enable-checking=release --disable-bootstrap --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.2.1 20161016 (Linaro GCC 6.2-2016.11) 

しかしとき./configure --host=arm-linux-gnueabihfを実行すると、システムはarm-linux-gnueabihfツールを検出できません。

configure: WARNING: If you wanted to set the --build type, don't use --host. 
If a cross compiler is detected then cross compile mode will be used. 
checking for a BSD-compatible install... /usr/bin/install -c 
checking whether build environment is sane... yes 
checking for arm-linux-gnueabihf-strip... no 
checking for strip... strip 
checking for a thread-safe mkdir -p... /bin/mkdir -p 
checking for gawk... no 
checking for mawk... mawk 
checking whether make sets $(MAKE)... yes 
checking for arm-linux-gnueabihf-g++... no 
checking for arm-linux-gnueabihf-c++... no 
checking for arm-linux-gnueabihf-gpp... no 
checking for arm-linux-gnueabihf-aCC... no 
checking for arm-linux-gnueabihf-CC... no 
checking for arm-linux-gnueabihf-cxx... no 
checking for arm-linux-gnueabihf-cc++... no 
checking for arm-linux-gnueabihf-cl.exe... no 
checking for arm-linux-gnueabihf-FCC... no 
checking for arm-linux-gnueabihf-KCC... no 
checking for arm-linux-gnueabihf-RCC... no 
checking for arm-linux-gnueabihf-xlC_r... no 
checking for arm-linux-gnueabihf-xlC... no 
checking for g++... g++ 
checking whether the C++ compiler works... yes 
checking for C++ compiler default output file name... a.out 
checking for suffix of executables... 
checking whether we are cross compiling... no 
checking for suffix of object files... o 
checking whether we are using the GNU C++ compiler... yes 
checking whether g++ accepts -g... yes 
checking for style of include used by make... GNU 
checking dependency style of g++... gcc3 
checking for arm-linux-gnueabihf-gcc... no 
checking for gcc... gcc 
checking whether we are using the GNU C compiler... yes 
checking whether gcc accepts -g... yes 
checking for gcc option to accept ISO C89... none needed 
checking dependency style of gcc... gcc3 
checking for pthread_rwlock_init in -lpthread... yes 
checking how to run the C preprocessor... gcc -E 
checking for grep that handles long lines and -e... /bin/grep 
checking for egrep... /bin/grep -E 
checking for ANSI C header files... yes 
checking for sys/types.h... yes 
checking for sys/stat.h... yes 
checking for stdlib.h... yes 
checking for string.h... yes 
checking for memory.h... yes 
checking for strings.h... yes 
checking for inttypes.h... yes 
checking for stdint.h... yes 
checking for unistd.h... yes 
checking fcntl.h usability... yes 
checking fcntl.h presence... yes 
checking for fcntl.h... yes 
checking for stdlib.h... (cached) yes 
checking for string.h... (cached) yes 
checking sys/ioctl.h usability... yes 
checking sys/ioctl.h presence... yes 
checking for sys/ioctl.h... yes 
checking for unistd.h... (cached) yes 
checking gtk/gtk.h usability... no 
checking gtk/gtk.h presence... no 
checking for gtk/gtk.h... no 
checking pthread.h usability... yes 
checking pthread.h presence... yes 
checking for pthread.h... yes 
checking for stdlib.h... (cached) yes 
checking for GNU libc compatible malloc... yes 
configure: creating ./config.status 
config.status: creating Makefile 
config.status: creating config.h 
config.status: config.h is unchanged 
config.status: executing depfiles commands 

この原因はどのような原因が考えられますか?どうすれば解決できますか? ありがとう

答えて

1

ツールチェーンのパスをエクスポートしましたか?あなたはそれをする必要があります。働くために。

エクスポートしたかどうかを知る方法は?

タイプecho $PATH端末にはパスが表示されます。


解決方法:ツールチェーンのパスをエクスポートします。

以下は、ツールチェーンのパスの例です。あなたは、あなたのツールチェーンの正しい道を与える必要があります。

例:

export PATH=/opt/your_toolchains/path/arm-unknown-linux-gnu/bin/:$PATH 
+0

ありがとうございます。コマンドラインに 'echo $ PATH'とタイプし、コマンドはarm-linux-gnueabihf-gccとarm-linux-gnueabihf-g ++がインストールされたtoolchainパスを返しました。 、コマンドラインはまだarm-linux-gnueabihf-g ++がないことを私に知らせます。問題を引き起こす原因は他にありますか? – Light

+0

arm-linux-gnueabihf-g ++は、あなたのツールチェーンのbinフォルダにあります。あなたが 'ld'、' gcc'、 'g ++'、 'ar'、' as'などのすべてのユーティリティをリストします。あなたのホスト 'sudo apt install g ++'にこのパッケージをインストールする必要があります。 – LethalProgrammer

1

まあ、アームのlinux-gnueabihf-gccのはconfigureスクリプトによって印刷されたリストの一部ではないように思わ、それはありませんか?しかし、のarm-linux-gnueabihf-g ++のチェックがあります。それもインストールされていますか?

+0

arm-linux-gnueabihf-g ++もインストールされています。arm-linux-gnueabihf-g ++とarm-linux-gnueabihf-gccは同じツールチェーンからのものです。 – Light

関連する問題