尝试执行“ cc1”时出现GCC错误


12

我正在笔记本电脑上运行Raspberry Pi的Linux内核(运行debian 7)(遵循Raspberry Pi Kernel Compilation中的说明);但是当编译时

make ARCH=arm CROSS_COMPILE=${CCPREFIX}

我收到以下消息:

  CHK     include/linux/version.h
  CHK     include/generated/utsrelease.h
make[1]: `include/generated/mach-types.h' is up to date.
  CC      kernel/bounds.s
gcc: error trying to exec 'cc1': execvp: No such file or directory
make[1]: *** [kernel/bounds.s] Error 1
make: *** [prepare0] Error 2

我发现问题是找不到cc1或未gcc正确安装cc1 (所以我重新安装了gcc,apt-get --reinstall install gcc但是没有运气)。

gcc -v 给出:

Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/i486-linux-gnu/4.7/lto-wrapper
Target: i486-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.7.2-5' --with-bugurl=file:///usr/share/doc/gcc-4.7/README.Bugs --enable-languages=c,c++,go,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.7 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.7 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --enable-objc-gc --enable-targets=all --with-arch-32=i586 --with-tune=generic --enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu --target=i486-linux-gnu
Thread model: posix
gcc version 4.7.2 (Debian 4.7.2-5)

gcc -print-prog-name=cc1 给出:

/usr/lib/gcc/i486-linux-gnu/4.7/cc1

gcc -print-search-dirs 给出:

install: /usr/lib/gcc/i486-linux-gnu/4.7/
programs: =/usr/lib/gcc/i486-linux-gnu/4.7/:/usr/lib/gcc/i486-linux-gnu/4.7/:/usr/lib/gcc/i486-linux-gnu/:/usr/lib/gcc/i486-linux-gnu/4.7/:/usr/lib/gcc/i486-linux-gnu/:/usr/lib/gcc/i486-linux-gnu/4.7/../../../../i486-linux-gnu/bin/i486-linux-gnu/4.7/:/usr/lib/gcc/i486-linux-gnu/4.7/../../../../i486-linux-gnu/bin/i386-linux-gnu/:/usr/lib/gcc/i486-linux-gnu/4.7/../../../../i486-linux-gnu/bin/
libraries: =/usr/lib/gcc/i486-linux-gnu/4.7/:/usr/lib/gcc/i486-linux-gnu/4.7/../../../../i486-linux-gnu/lib/i486-linux-gnu/4.7/:/usr/lib/gcc/i486-linux-gnu/4.7/../../../../i486-linux-gnu/lib/i386-linux-gnu/:/usr/lib/gcc/i486-linux-gnu/4.7/../../../../i486-linux-gnu/lib/../lib/:/usr/lib/gcc/i486-linux-gnu/4.7/../../../i486-linux-gnu/4.7/:/usr/lib/gcc/i486-linux-gnu/4.7/../../../i386-linux-gnu/:/usr/lib/gcc/i486-linux-gnu/4.7/../../../../lib/:/lib/i486-linux-gnu/4.7/:/lib/i386-linux-gnu/:/lib/../lib/:/usr/lib/i486-linux-gnu/4.7/:/usr/lib/i386-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/i486-linux-gnu/4.7/../../../../i486-linux-gnu/lib/:/usr/lib/gcc/i486-linux-gnu/4.7/../../../:/lib/:/usr/lib/

find / -type f -name cc1给出:

/opt/tools/arm-bcm2708/arm-bcm2708-linux-gnueabi/libexec/gcc/arm-bcm2708-linux-gnueabi/4.7.1/cc1
/opt/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/libexec/gcc/arm-linux-gnueabihf/4.7.2/cc1
/opt/tools/arm-bcm2708/arm-bcm2708hardfp-linux-gnueabi/libexec/gcc/arm-bcm2708hardfp-linux-gnueabi/4.7.1/cc1
/usr/lib/gcc/i486-linux-gnu/4.6/cc1
/usr/lib/gcc/i486-linux-gnu/4.7/cc1

运行dpkg -S cc1给出:

libopencc1:i386: /usr/share/doc/libopencc1/changelog.Debian.gz
g++-4.7: /usr/lib/gcc/i486-linux-gnu/4.7/cc1plus
cpp-4.6: /usr/lib/gcc/i486-linux-gnu/4.6/cc1
libopencc1:i386: /usr/share/doc/libopencc1
cpp-4.7: /usr/lib/gcc/i486-linux-gnu/4.7/cc1
libopencc1:i386: /usr/share/doc/libopencc1/copyright
libgcc1:i386: /usr/share/lintian/overrides/libgcc1
ncurses-term: /usr/share/terminfo/x/xterm+pcc1
libgcc1:i386: /usr/share/doc/libgcc1

有任何想法吗?


尝试安装必需的软件包,在ubuntu上报告了相同的问题,请看这里ubuntuforums.org/showthread.php?t=540528
vfbsilva 2013年

@vfbsilva已经尝试过了,但是没有运气(也看到了那个线程)
bulkmoustache 2013年

我可能倾向于尝试通过strace运行make,以了解发生了什么。strace make
slm

我尝试使用strace运行,但是我不确定在哪里查找问题...
bulkmoustache 2013年

什么CCPREFIX啊 您安装了什么交叉编译器,以及在哪里安装?
吉尔(Gilles)“所以,别再邪恶了”

Answers:


4

似乎您对本机编译器和交叉编译器感到困惑,不是吗?

您尝试使用本机编译器的命令:

gcc -v
gcc -print-prog-name=cc1

你应该试试

${CCPREFIX}gcc -v
${CCPREFIX}gcc -print-prog-name=cc1

阅读您的评论我认为您将gcc交叉编译器安装为/ home / jorge / tools / arm-bcm2708 / arm-bcm2708-linux-gnueabi / bin / arm-bcm2708-linux-g‌nueabi-gcc。如果是这种情况,您应该尝试

make ARCH=arm \
CROSS_COMPILE=/home/jorge/tools/arm-bcm2708/arm-bcm2708-linux-gnueabi/bin/arm-bcm2708-linux-g‌​nueabi-
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.