I need to compile a modern version of GCC in order to compile CMake in order to compile OpenCV 3.0.0.

So I want to compile a modern and stable version of GCC for the Raspberry Pi 2b. I've read this topic: How can I install GCC 4.8 on the Raspberry Pi? . The accepted answer explains how to install some patches, which seem to be needed for compiling the GCC on Debian. It doesn't state however, if those patches are still needed, when I use a newer version of GCC.

Is the patching process still necessary when compiling GCC 6 version from ftp://ftp.fu-berlin.de/unix/languages/gcc/snapshots/LATEST-6/gcc-6-20151108.tar.bz2 or have these patches already been applied to them?

(For the future: How do I figure that out myself?)

  • Once you depart from the tested base system you are likely to be pretty much on your own. Are you sure you need the latest features? Also, this is not a Raspberry Pi question, if anything it's a Debian question.
    – joan
    Nov 9, 2015 at 11:50

1 Answer 1


I'm going to try and strongly disuade you from doing this. It is a gigantic waste of time.

4.9.3, released upstream at the end of June, and the most "modern" currently in 4.x, is available in Raspbian repos. Check apt-cache search gcc | grep "^gcc" to see what's actually available in jessie but I am sure there is a 4.9.x.

Forget about 5.x (first public release was April) and especially 6.x (no official public release) unless you have a very clear reason for doing so. Which you don't, or I think you would not be asking this kind of question.

  • I was thinking that 6 is the latest stable release and thus stable, but I don't know that for sure. Was thinking "Why not compile the latest stable, if I am going to compile gcc at all?" Thanks for the warning though. However, how would I figure out if I need to install additional patches, if I did compile it? Nov 9, 2015 at 12:59
  • "How would I figure out if I need to install additional patches?" -> You wouldn't need to do so (it will work fine without any), but you can look at the Debian source package (e.g.); I'd guess their patches are in the diff.gz (scroll to bottom). I'm actually not sure if Raspbian maintains their own source repo, but I can't imagine they'd be screwing with this. GCC for ARM certainly has a much bigger context than the pi and issues are reported and corrected upstream anyway.
    – goldilocks
    Nov 9, 2015 at 13:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.