Matthias_H
Posts: 7
Joined: Fri Sep 09, 2011 8:38 pm
Contact: Website

g++ - Internal compiler error: illegal instruction

Wed Aug 15, 2012 10:36 pm

Hi,

While trying to compile the X11/unix version of snes9x 1.53 on my Raspi, I ran into dozens of occurrences of gcc "internal error: illegal instruction". The way I understand it, even the sorriest pile of broken sourcecode should never trigger such an error, unless there's something wrong with the compiler itself and/or its libraries. Any idea how I can fix the situation?

Cheers,
Matthias

PS - Here's how I got the error (except for the wget; not sure if it is present in that distro. I actually copied the archive from a USB medium):

Code: Select all

# Connect ethernet, boot into July 15 version of Raspbian, log in as user pi. Then:
sudo apt-get install libx11-dev
wget http://files.ipherswipsite.com/snes9x/snes9x-1.53-src.tar.bz2
tar xf snes9x-1.53-src.tar.bz2
cd snes9x-1.53-src/unix
./configure
make

amigarulez
Posts: 42
Joined: Wed Jul 18, 2012 10:16 am

Re: g++ - Internal compiler error: illegal instruction

Wed Aug 15, 2012 10:50 pm

What start.elf and how much swap do you have? I ran into a similar error when compiling a large project. going to 240 + 240 swap solved my problem.
So in my case the illegal instruction was some kind of out of memory exception.

Matthias_H
Posts: 7
Joined: Fri Sep 09, 2011 8:38 pm
Contact: Website

Re: g++ - Internal compiler error: illegal instruction

Thu Aug 16, 2012 6:30 am

Going from 192+100 (or whatever the old swap size) to 224+256 didn't make the slightest difference: the compiler throws the exact same error at the exact same location... :( Will post preprocessed output tomorrow, in case someone would be willing to check...

Serac
Posts: 124
Joined: Wed Jul 18, 2012 2:49 pm

Re: g++ - Internal compiler error: illegal instruction

Thu Aug 16, 2012 12:39 pm

Grabbed the sources and tried a cross-compile on an x86-64 box for a generic arm target. Something inside filter/hq2x.cpp is causing GCC to go nuts and consume memory & swap, so I wouldn't be at all surprised if it triggers a fatal error on a Pi. Some sources suggest that it is the compiler's (cc1plus) internal stack overflowing.

One possible fix is to run the configure script with --enable-debug - This should reduce optimization to a minimum and avoid stack overflows at the expense of increased binary size.

Return to “C/C++”