Kan Li
Kan Li

Reputation: 8797

Tutorial on building whole toolchain on CentOS

I am working on CentOS 6 machines, which has very old GCC/GlibC version. I want to build the whole glibc, binutils, gcc toolchain with latest or at least very recent versions in order to use c++11 support in latest gcc, and ld.gold in recent binutils, and possibly improvements in recent glibc.

I want to put the whole toolchain in some separate directory, and not to influence any existing system files. I also want to build gcc with --sys-root so that when using the gcc, I don't need to specify -I/some/directory/include and -L/some/directory/lib or whatever other parameters. Also the generated executable will automatically use the new ld-linux-xxxxx program loader which will automatically find the new libc.so.

Anyone knows if there exists some tutorial on this task?

Upvotes: 5

Views: 2554

Answers (4)

geek
geek

Reputation: 57

You can download the latest toolchain from Openembedded or Yocto. And here you don't have to do any package installation to your current system. Just download the toolchain, source the environment and thats it you are ready to check the c++11 support. The location to download the toolchain: http://downloads.yoctoproject.org/releases/yocto/yocto-1.7/toolchain/ (Just select the architecture either 32bit or 64 bit based on your machine support)

Upvotes: 0

sancelot
sancelot

Reputation: 2063

The compiler is very dependent on glibc, altough you manage to build the compiler either in a chrooted system or equivalent, you will need to build also all libraries needed with the program you will build with this new compiler. The best you can do is use a fresh new system (vm or whatever) or upgrade your existing one

Upvotes: 0

sancelot
sancelot

Reputation: 2063

I do not knwo Why you need this ? If this is needed that to compile for another computer, I would suggest using a virtual machine running the same OS as target. much more easier !!

Upvotes: -1

vonbrand
vonbrand

Reputation: 11831

If you need the latest toolchain, you'd better migrate to Fedora.

If you can't/won't, the best bet is to get the pieces as source RPMs for CentOS and Fedora, unpack them and fix up the CentOS by pilfering the sources and patches from Fedora, take care it doesn't overrule the system packages, correct versions and fix to install elsewhere (don't mess up your system too much! /usr/local comes to mind). The pieces are at least binutils, gcc.

Upvotes: -1

Related Questions