Reputation: 35
Since I needed C++14 support for one of our projects, I was trying to build GCC5.2 on my RHEL6 instance using the steps described in http://en.librehat.com/blog/build-gcc-5-dot-2-on-rhel-6/. However, though these steps work well on a RHEL5 instance, I get the following error on AmazonLinux during the step where it builds libgomp:
configure:3688: checking for C compiler default output file name
configure:3710: /home/samudra/gcc/./gcc/xgcc -B/home/samudra/gcc/./gcc/ -B/home/samudra/gcc5/x86_64-redhat-linux/bin/ -B/home/samudra/gcc5/x86_64-redhat-linux/lib/ -isystem /home/samudra/gcc5/x86_64-redhat-linux/include -isystem /home/samudra/gcc5/x86_64-redhat-linux/sys-include -g -O2 conftest.c >&5
/usr/lib/../lib64/crt1.o: In function `_start':
(.text+0x12): undefined reference to `__libc_csu_fini'
/usr/lib/../lib64/crt1.o: In function `_start':
(.text+0x19): undefined reference to `__libc_csu_init'
collect2: error: ld returned 1 exit status
configure:3714: $? = 1
configure:3751: result:
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "GNU Offloading and Multi Processing Runtime Library"
| #define PACKAGE_TARNAME "libgomp"
| #define PACKAGE_VERSION "1.0"
| #define PACKAGE_STRING "GNU Offloading and Multi Processing Runtime Library 1.0"
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL "http://www.gnu.org/software/libgomp/"
| #define PACKAGE "libgomp"
| #define VERSION "1.0"
| /* end confdefs.h. */
|
| int
| main ()
| {
|
| ;
| return 0;
| }
configure:3757: error: in `/home/samudra/gcc/x86_64-redhat-linux/libgomp':
configure:3761: error: C compiler cannot create executables
Some hunting around (http://gcc.1065356.n5.nabble.com/Build-gcc-4-8-2-error-gcc-4-8-1-x86-64-unknown-linux-gnu-libgomp-td977436.html) suggests the the compiler is unable to find the libc library. However I am unable to figure out a way to fix it. Has anyone faced a similar issue earlier? Any idea what is going on?
Upvotes: 1
Views: 779
Reputation: 546
An alternative is to use the RH Developer Toolset - part of your subscription. It now supports GCC 5.2 on RHEL 6 and 7: http://developerblog.redhat.com/2015/11/17/gcc-5-developer-toolset-4-generally-available/
And here's a bit more about it: http://developerblog.redhat.com/2015/10/16/5-things-need-know-gcc-5-developer-toolset-beta/
HTH
Upvotes: 3