在RHEL6上构建GCC 5.2

时间:2015-12-04 04:50:12

标签: c++ gcc rhel

由于我需要C ++ 14支持其中一个项目,因此我尝试使用http://en.librehat.com/blog/build-gcc-5-dot-2-on-rhel-6/中描述的步骤在我的RHEL6实例上构建GCC5.2。但是,尽管这些步骤在RHEL5实例上运行良好,但在构建libgomp的步骤中,我在AmazonLinux上收到以下错误:

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

一些狩猎(http://gcc.1065356.n5.nabble.com/Build-gcc-4-8-2-error-gcc-4-8-1-x86-64-unknown-linux-gnu-libgomp-td977436.html)表明编译器无法找到libc库。但是我无法找到解决问题的方法。有没有人早些时候遇到类似的问题?知道发生了什么事吗?

1 个答案:

答案 0 :(得分:3)

另一种方法是使用RH Developer Toolset - 订阅的一部分。它现在支持RHEL 6和7上的GCC 5.2:http://developerblog.redhat.com/2015/11/17/gcc-5-developer-toolset-4-generally-available/

还有更多关于它的信息:http://developerblog.redhat.com/2015/10/16/5-things-need-know-gcc-5-developer-toolset-beta/

HTH