« July 2012 | Main | January 2014 »

April 2013 Archives

April 29, 2013

Building GCC 4.8 on RHEL5.8

I didn’t find this solution anywhere else on the internet, so I figured I’d post it here…

When building GCC 4.8.0 on an up-to-date RHEL 5.8 system, it died, complaining that in the file libstdc++-v3/libsupc++/unwind-cxx.h, there’s a macro (PROBE2) that cannot be expanded. It complains about things like this:

In file included from ../../../../libstdc++-v3/libsupc++/unwind-cxx.h:41:0,
                 from ../../../../libstdc++-v3/libsupc++/eh_throw.cc:26:
../../../../libstdc++-v3/libsupc++/eh_throw.cc: In function ‘void __cxxabiv1::__cxa_throw(void*, std::type_info*, void (*)(void*))’:
../../../../libstdc++-v3/libsupc++/unwind-cxx.h:45:34: error: unable to find string literal operator ‘operator"" _SDT_S’
 #define PROBE2(name, arg1, arg2) STAP_PROBE2 (libstdcxx, name, arg1, arg2)
                                  ^

The most helpful answer I could find was this one which didn’t actually HELP so much as point a good finger at the culprit: SystemTap. Never heard of it? Neither had I. Their headers are apparently not compatible with C++11, and need to be updated. Don’t have root? Heh, have fun with that.

Of course, telling GCC to ignore SystemTap is not possible, that I can tell, unless SystemTap happened to be installed in an unusual place. So, instead, we have to resort to convincing GCC that it’s not installed. Unfortunately, that can get tricky. What I ended up having to do was edit x86_64-unknown-linux-gnu/libstdc++-v3/config.h and comment-out the line that says

#define HAVE_SYS_SDT_H 1

…so that it reads this instead:

/*#define HAVE_SYS_SDT_H 1*/

It’s not a good solution, of course, because I’m coming along behind the configuration logic and changing some of the answers without ensuring that there weren’t conditional decisions made on that basis, AND since GCC builds itself several times to bootstrap into a clean, optimized product, you have to make that edit multiple (three) times. Basically, this is a horrible horrible hack around the problem. BUT, this works, is simple, and gets me a working compiler.

About April 2013

This page contains all entries posted to Kyle in April 2013. They are listed from oldest to newest.

July 2012 is the previous archive.

January 2014 is the next archive.

Many more can be found on the main index page or by looking through the archives.

Creative Commons License
This weblog is licensed under a Creative Commons License.
Powered by
Movable Type 3.34