Feedback

type to search

backporting more recent versions of the gcc toolchain to Debian stable

Asked by , Edited by vrkalak [ Moderator ]

I’ve sporadically tried, on and off over the last decade, to backport versions of more recent versions of gcc to Debian stable, which is what I usually run. Currently, on squeeze, I see


orwell:/home/faheem# apt-cache policy gcc-4.6 g++-4.6
gcc-4.6:
  Installed: (none)
  Candidate: 4.6.0-1
  Version table:
     4.6.0-1 0
         50 http://debian.csail.mit.edu/debian/ unstable/main i386 Packages
     4.6.0~rc1-3 0
          1 http://debian.csail.mit.edu/debian/ experimental/main i386 Packages
g++-4.6:
  Installed: (none)
  Candidate: 4.6.0-1
  Version table:
     4.6.0-1 0
         50 http://debian.csail.mit.edu/debian/ unstable/main i386 Packages
     4.6.0~rc1-3 0
          1 http://debian.csail.mit.edu/debian/ experimental/main i386 Packages

If I try to backport this to stable, I run into fairly significant problems. Has anyone been able to successfully do this? I’ve never seen such a backport, which suggests this is not easy. It’s not a big deal, but I’m just curious.
or Cancel

2 answers

0

oz123 [ Editor ]

Compiling a compiler and a tool chain is not such easy as make make install.
I have had also problems building more recent versions of g95 from sources on new debian systems.


I think linux from scratch (which I recently finished reading) gives enough tools to understand how to do it.
I will probably try soon and let you know. But you could also look and tell us if you succeeded.

Cheers, Oz

NN comments
faheem
-
: I’m mostly interested in how to do this on Debian, but if it could be done on LFS, that might give useful tips. And yes, I know it is not trivial, which is why I asked.

or Cancel
0

faheem

So, an update to this post. I just succeeded in backporting gcc 4.7 to Debian squeeze. To be clear, this was just the part of gcc which contains the C, C++ and Objective C compiler, but I only use C and C++ so I don’t care about the other stuff. So, perhaps it wasn’t that hard after all.


The version I used was gcc-4.7, version 4.7-20111231-1, which was in experimental, but has now been replaced by a different version.

I was able to satisfy all the build dependencies without difficulty, except that I had to rebuild the testing version of binutils on squeeze, as Debian kept insisting on that dependency, though I don’t see why an older version of binutils would not have worked. Another thing that is worth noting is that I had to disable the test suite, because it was causing errors. Not sure what was going on here. I did this by uncommenting this line in rules.def

    # if you don't want to run the gcc testsuite, uncomment the next line
    with_check := disabled by hand

One possible source of confusion was that I built with the squeeze version of binutils, and adjusted the control file accordingly, but was eventually forced to install 2.22 as the built packages somehow has 2.22 as a runtime dependency. I don’t know if this had anything to do with the test build failure. Anyway, I tested it a bit, and rather to my surprise everything seems to work. Here is a list of upgraded and newly installed packages

ii  binutils                            2.22-2                              GNU assembler, linker and binary utilities
ii  cpp-4.7                             4.7-20111231-1                      GNU C preprocessor
ii  g++-4.7                             4.7-20111231-1                      GNU C++ compiler
ii  gcc-4.7                             4.7-20111231-1                      GNU C compiler
ii  gcc-4.7-base                        4.7-20111231-1                      GCC, the GNU Compiler Collection (base package)
ii  libgcc1                             1:4.7-20111231-1                    GCC support library
ii  libgomp1                            4.7-20111231-1                      GCC OpenMP (GOMP) support library
ii  libitm1                             4.7-20111231-1                      GNU Transactional Memory Library
ii  libquadmath0                        4.7-20111231-1                      GCC Quad-Precision Math Library
ii  libstdc++6                          4.7-20111231-1                      GNU Standard C++ Library v3
ii  libstdc++6-4.7-dev                  4.7-20111231-1                      GNU Standard C++ Library v3 (development files)

I wonder if the backports.org people would be interested.

If you have questions about this, you can reach me at faheem at faheem dot info.
or Cancel

Your answer

You need to join Debian to complete this action, click here to do so.