« "Trump" Puts it into Simple Terms? | Main | Automake 1.13's Parallel Harness »

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.

TrackBack

TrackBack URL for this entry:
https://www.we-be-smart.org/mt/mt-tb.cgi/787

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

About

This page contains a single entry from the blog posted on April 29, 2013 3:42 PM.

The previous post in this blog was "Trump" Puts it into Simple Terms?.

The next post in this blog is Automake 1.13's Parallel Harness.

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