什么是Linux这样GCC错误,以及如何解决呢? GCC:内部编译器错误:非法指令(程序作为) [英] What is this GCC error on Linux, and how do I solve it? gcc: internal compiler error: Illegal instruction (program as)

查看:5408
本文介绍了什么是Linux这样GCC错误,以及如何解决呢? GCC:内部编译器错误:非法指令(程序作为)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我键入 GCC的hello.c 这似乎:

gcc: internal compiler error: Illegal instruction (program as)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.6/README.Bugs> for instructions.

hello.c的仅仅是:

hello.c is just:

int main()
{
 return 0;
}

我想不出什么办法,使其更简单! (同样的事情发生的printf 在那里。)

所以:你是怎么解决这个问题?我在Raspian,对树莓派。

So: how do you fix this? I'm on Raspian, on Raspberry Pi.

GCC -v给出

Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/arm-linux-gnueabihf/4.6/lto-wrapper
Target: arm-linux-gnueabihf
Configured with: ../src/configure -v --with-pkgversion='Debian 4.6.3-14+rpi1' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.6 --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.6 --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 --disable-sjlj-exceptions --with-arch=armv6 --with-fpu=vfp --with-float=hard --enable-checking=release --build=arm-linux-gnueabihf --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf
Thread model: posix
gcc version 4.6.3 (Debian 4.6.3-14+rpi1) 

没有我没有安装它。

至于更新, sudo易于得到安装gcc

Reading package lists... Done
Building dependency tree       
Reading state information... Done
gcc is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

是的,你可以运行,它说非法指令不带参数。

我不知道什么是交换空间。

I have no idea what swap space is.

gcc的-O0 -g的hello.c 给出了同样的错误。

GCC不承认 - 启用调试

推荐答案

明白了!我卸载了GCC,安装GCC-4.7,和什么都没有。

Got it! I uninstalled gcc, installed gcc-4.7, and ... nothing.

我清空了GCC-4.6的结束和重新运行命令和apt-get安装GCC-4.7 键,什么都没有。

I cleared out the end of gcc-4.6 and re-ran sudo apt-get install gcc-4.7 and ... nothing.

我更新的binutils和......它的工作!

I updated binutils and ... it worked!

因此​​,并未以通过更新GCC,而是更直接地更新它这样做是为了我而受到影响。

So, as didn't appear to be affected by updating GCC, but updating it more directly did it for me.

(这是从2.22-7.1到2.22-8,如果这能帮助任何人。)

这篇关于什么是Linux这样GCC错误,以及如何解决呢? GCC:内部编译器错误:非法指令(程序作为)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆