在RHEL6上构建GCC 5.2

Building GCC 5.2 on RHEL6

本文关键字:GCC 构建 RHEL6      更新时间:2023-10-16

由于我们的一个项目需要C++14支持,我尝试使用中描述的步骤在RHEL6实例上构建GCC5.2http://en.librehat.com/blog/build-gcc-5-dot-2-on-rhel-6/.然而,尽管这些步骤在RHEL5实例上运行良好,但在AmazonLinux上构建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

四处狩猎(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库。然而,我无法找到解决问题的方法。之前有人遇到过类似的问题吗?知道发生了什么事吗?

另一种选择是使用RH开发工具集,这是订阅的一部分。它现在支持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