C++11 AIX下的链接问题与G++;6.3
经过一些斗争,我必须承认我需要一些外部帮助在这个链接器的问题。否则我会死的。 我正在努力将构建从GCC4.8.5迁移到AIX7.1下的GCC6.3.0:C++11 AIX下的链接问题与G++;6.3,c++11,linker,g++,shared-libraries,aix,C++11,Linker,G++,Shared Libraries,Aix,经过一些斗争,我必须承认我需要一些外部帮助在这个链接器的问题。否则我会死的。 我正在努力将构建从GCC4.8.5迁移到AIX7.1下的GCC6.3.0: > uname -a AIX wreckmach 1 7 00F63B074C00 > oslevel 7.1.0.0 现在,所有的编译阶段都进展顺利,但在链接阶段,事情开始变得一团糟。我的编译行如下所示(我删除了目录和一些内部定义): 我的连接线是 g++ -g -ggdb3 -pthread -maix64 -Wl,-brtl
> uname -a
AIX wreckmach 1 7 00F63B074C00
> oslevel
7.1.0.0
现在,所有的编译阶段都进展顺利,但在链接阶段,事情开始变得一团糟。我的编译行如下所示(我删除了目录和一些内部定义):
我的连接线是
g++ -g -ggdb3 -pthread -maix64 -Wl,-brtl -Wl,-bhalt:5 -Wl,-bnodelcsect -Wl,-brtl,-bexpfull -shared /home/me/migration/build.AIX71_GCC_60300_64/myCppFile.cpp.1.o /home/me/migration/build.AIX71_GCC_60300_64/myOtherCppFile.cpp.1.o -o /home/me/migration/build.AIX71_GCC_60300_64/libtest.so -L/BUILD/SOFT/compilers/AIX71/GCC/60300/lib64 -lgcc_s -lstdc++ -lpthread
这为我提供了以下输出:
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
collect2: error: ld returned 8 exit status
通过添加-bnoquiet选项,我得到:
(ld): save SRE .
SAVE: Section sizes = 69976+5192+280 (0x11158+0x1448+0x118 hex)
SAVE: Size of TOC: 1352 (0x548 hex)
ld: 0711-310 ERROR: Relocation entries from the .text section have been
written to the .loader section. The following csects are in error:
CSECT or (Symbol in CSECT) Inpndx Address TY CL Source-File(Object-File)
Symbols referenced with .loader section RLDs: TY CL Inpndx Name
--------------------------------------------- -- -- ------------------------
<_myCppFile.ro_> [260] 00004080 SD RO ../src/myCppFile.cpp(./build.AIX71_GCC_60300_64/myCppFile.cpp.1.o)
ER PR [140] __gcc_unwind_dbase
SD RW [264] <_myCppFile.rw_>
<_myOtherCppFile.ro_> [107] 00002240 SD RO ../src/myOtherCppFile.cpp(./build.AIX71_GCC_60300_64/myOtherCppFile.cpp.1.o)
SD RW [111] <_myOtherCppFile.rw_>
ER PR [56] __gcc_unwind_dbase
SAVE: The return code is 4.
(ld): rc
RC: Highest return code was 4.
我错过了什么,做错了什么?
无论我使用哪个ld(system one——首选——或gnu binutils one),结果都是相同的
编辑当我创建一个虚拟库并在其上链接一个可执行文件时,一切都很顺利。除了上面引用的项目中使用的外部库之外,所有内容都使用相同的选项。我现在完全被卡住了。。。这是链接器给您的唯一输出吗?这听起来有点偏颇,之前有一些输出,“更多信息”位只是告诉您如何获取有关以前错误的更多信息。除了两行之外,没有给出更多输出。根据-bnoquiet选项,您是对的,这是一个部分输出。它从导致错误的步骤开始。如果需要的话,我可以把所有的东西都放进去,但是我发现里面没有什么有用的东西。
(ld): save SRE .
SAVE: Section sizes = 69976+5192+280 (0x11158+0x1448+0x118 hex)
SAVE: Size of TOC: 1352 (0x548 hex)
ld: 0711-310 ERROR: Relocation entries from the .text section have been
written to the .loader section. The following csects are in error:
CSECT or (Symbol in CSECT) Inpndx Address TY CL Source-File(Object-File)
Symbols referenced with .loader section RLDs: TY CL Inpndx Name
--------------------------------------------- -- -- ------------------------
<_myCppFile.ro_> [260] 00004080 SD RO ../src/myCppFile.cpp(./build.AIX71_GCC_60300_64/myCppFile.cpp.1.o)
ER PR [140] __gcc_unwind_dbase
SD RW [264] <_myCppFile.rw_>
<_myOtherCppFile.ro_> [107] 00002240 SD RO ../src/myOtherCppFile.cpp(./build.AIX71_GCC_60300_64/myOtherCppFile.cpp.1.o)
SD RW [111] <_myOtherCppFile.rw_>
ER PR [56] __gcc_unwind_dbase
SAVE: The return code is 4.
(ld): rc
RC: Highest return code was 4.
> nm -X64 /BUILD/SOFT/compilers/AIX71/GCC/60300/lib64/libgcc_s.a | grep __gcc_unwind
__gcc_unwind_dbase D 536871816
__gcc_unwind_dbase d 536871816 4
__gcc_unwind_dbase d 536876288 8
> nm -X64 /BUILD/SOFT/compilers/AIX71/GCC/60300/lib64/libstdc++.a | grep __gcc_unwind
__gcc_unwind_dbase D 536871608
__gcc_unwind_dbase d 536871608 4
__gcc_unwind_dbase d 537025144 8