交叉编译到 ARM:尝试执行“cc1”时出错:没有此文件或目录

交叉编译到 ARM:尝试执行“cc1”时出错:没有此文件或目录

我正在尝试为使用 arm-none-gnueabi-gcc 编译器的目标机器进行编译。但是当我尝试交叉编译时,我在 Ubuntu 机器上收到以下错误:

 arm-none-linux-gnueabi-gcc: error trying to exec 'cc1': execvp: No such file or directory

关于此编译器的背景——我从另一个 Linux 系统复制了这个编译器。

当我./configure使用此命令运行脚本时,

./configure CC=/home/osboxes/Desktop/Sourcer_G++_Lite/arm-none-linux-gnueabi/bin/arm-none-linux-gnueabi-gcc --host=arm -prefix /home/osboxes/Desktop/application 

我一开始就收到一个错误,提示:Checking whether C compiler works... no

配置.日志 -->

## --------- ##
## Platform. ##
## --------- ##

hostname = osboxes
uname -m = i686
uname -r = 3.19.0-25-generic
uname -s = Linux
uname -v = #26~14.04.1-Ubuntu SMP Fri Jul 24 21:18:00 UTC 2015

/usr/bin/uname -p = unknown
/bin/uname -X     = unknown

/bin/arch              = unknown
/usr/bin/arch -k       = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo      = unknown
/bin/machine           = unknown
/usr/bin/oslevel       = unknown
/bin/universe          = unknown

PATH: /usr/local/sbin
PATH: /usr/local/bin
PATH: /usr/sbin
PATH: /usr/bin
PATH: /sbin
PATH: /bin
PATH: /usr/games
PATH: /usr/local/games
PATH: /home/osboxes/arm-2013.05/bin
PATH: /home/osboxes/Desktop/Sourcery_G++_Lite/bin


## ----------- ##
## Core tests. ##
## ----------- ##

configure:2809: checking whether make supports nested variables
configure:2826: result: yes
configure:2921: checking for a BSD-compatible install
configure:2989: result: /usr/bin/install -c
configure:3000: checking whether build environment is sane
configure:3055: result: yes
configure:3114: checking for arm-strip
configure:3144: result: no
configure:3154: checking for strip
configure:3170: found /usr/bin/strip
configure:3181: result: strip
configure:3206: checking for a thread-safe mkdir -p
configure:3245: result: /bin/mkdir -p
configure:3252: checking for gawk
configure:3268: found /usr/bin/gawk
configure:3279: result: gawk
configure:3290: checking whether make sets $(MAKE)
configure:3312: result: yes
configure:3456: checking whether UID '1000' is supported by ustar format
configure:3459: result: yes
configure:3466: checking whether GID '1000' is supported by ustar format
configure:3469: result: yes
configure:3477: checking how to create a ustar tar archive
configure:3488: tar --version
tar (GNU tar) 1.27.1
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by John Gilmore and Jay Fenlason.
configure:3491: $? = 0
configure:3531: tardir=conftest.dir && eval tar --format=ustar -chf - "$tardir" >conftest.tar
configure:3534: $? = 0
configure:3538: tar -xf - <conftest.tar
configure:3541: $? = 0
configure:3543: cat conftest.dir/file
GrepMe
configure:3546: $? = 0
configure:3559: result: gnutar
configure:4093: checking for arm-gcc
configure:4120: result: /home/osboxes/Desktop/Sourcer_G++_Lite/bin/arm-none-linux-gnueabi-gcc
configure:4389: checking for C compiler version
configure:4398: /home/osboxes/Desktop/Sourcer_G++_Lite/bin/arm-none-linux-gnueabi-gcc --version >&5
./configure: line 4400: /home/osboxes/Desktop/Sourcer_G++_Lite/bin/arm-none-linux-gnueabi-gcc: No such file or directory
configure:4409: $? = 127
configure:4398: /home/osboxes/Desktop/Sourcer_G++_Lite/bin/arm-none-linux-gnueabi-gcc -v >&5
./configure: line 4400: /home/osboxes/Desktop/Sourcer_G++_Lite/bin/arm-none-linux-gnueabi-gcc: No such file or directory
configure:4409: $? = 127
configure:4398: /home/osboxes/Desktop/Sourcer_G++_Lite/bin/arm-none-linux-gnueabi-gcc -V >&5
./configure: line 4400: /home/osboxes/Desktop/Sourcer_G++_Lite/bin/arm-none-linux-gnueabi-gcc: No such file or directory
configure:4409: $? = 127
configure:4398: /home/osboxes/Desktop/Sourcer_G++_Lite/bin/arm-none-linux-gnueabi-gcc -qversion >&5
./configure: line 4400: /home/osboxes/Desktop/Sourcer_G++_Lite/bin/arm-none-linux-gnueabi-gcc: No such file or directory
configure:4409: $? = 127
configure:4429: checking whether the C compiler works
configure:4451: /home/osboxes/Desktop/Sourcer_G++_Lite/bin/arm-none-linux-gnueabi-gcc    conftest.c  >&5
                                                                                                                                                                                           102,1         10%
configure:4455: $? = 127
configure:4493: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "syslog-ng"
| #define PACKAGE_TARNAME "syslog-ng"
| #define PACKAGE_VERSION "3.13.1"
| #define PACKAGE_STRING "syslog-ng 3.13.1"
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define RELEASE_TYPE "stable"
| #define BROCHURE_VERSION "3"
| #define COMBINED_VERSION "3 (3.13.1)"
| #define SOURCE_REVISION ""
| /* end confdefs.h.  */
|
| int
| main ()
| {
|
|   ;
|   return 0;
| }
configure:4498: error: in `/home/osboxes/Desktop/gclibsyslog/syslog-ng-3.13.1':
configure:4500: error: C compiler cannot create executables
See `config.log' for more details

## ---------------- ##
## Cache variables. ##
## ---------------- ##

ac_cv_env_CC_set=set
ac_cv_env_CC_value=/home/osboxes/Desktop/Sourcer_G++_Lite/bin/arm-none-linux-gnueabi-gcc
ac_cv_env_CFLAGS_set=
ac_cv_env_CFLAGS_value=
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_CRITERION_CFLAGS_set=
ac_cv_env_CRITERION_CFLAGS_value=
ac_cv_env_CRITERION_LIBS_set=
ac_cv_env_CRITERION_LIBS_value=
ac_cv_env_GEOIP_CFLAGS_set=
ac_cv_env_GEOIP_CFLAGS_value=
ac_cv_env_GEOIP_LIBS_set=
ac_cv_env_GEOIP_LIBS_value=

等等等等...

我该如何解决这个问题?我该如何让我的交叉编译器正常工作?

答案1

关于此编译器的背景——我从另一个 Linux 系统复制了这个编译器。

最好安装正确的包(取决于你的平台)crossbuild-essential-armhf 或 crossbuild-essential-armel

答案2

在这种情况下,cc1 丢失或无法访问。

您可以在 gcc 可执行文件的版本下找到 cc1。例如,如果 gcc 位于 /usr/local/bin 中,那么您可以在 /usr/local/lib/.../ 下搜索以找到它。

一旦找到它,您可以尝试以下操作:“CC1=/ful/path/to/cc1 ./configure ....”

相关内容