问题已解决,编译选项加上-fPIC,链接通过。
zhliu 发布的帖子
-
sw/compiler/gcc530编译器mpiswgfortran编译主核程序出现链接错误
报错信息如下:
/usr/sw-mpp/swcc/swgcc530-tools-85/usr/bin/../lib/gcc/sw_64sw2-unknown-linux-gnu/5.3.0/../../../../sw_64sw2-unknown-linux-gnu/../../usr_sw5/bin/sw5ld: /usr/sw-mpp/swcc/swgcc530-tools-85/usr/bin/../../../swgcc530-tools-85/usr/lib/libc.a(dl-trampoline.o): change in gp: BRSGP _dl_fixup
/usr/sw-mpp/swcc/swgcc530-tools-85/usr/bin/../lib/gcc/sw_64sw2-unknown-linux-gnu/5.3.0/../../../../sw_64sw2-unknown-linux-gnu/../../usr_sw5/bin/sw5ld: /usr/sw-mpp/swcc/swgcc530-tools-85/usr/bin/../../../swgcc530-tools-85/usr/lib/libc.a(dl-trampoline.o): change in gp: BRSGP _dl_profile_fixup
/usr/sw-mpp/swcc/swgcc530-tools-85/usr/bin/../lib/gcc/sw_64sw2-unknown-linux-gnu/5.3.0/../../../../sw_64sw2-unknown-linux-gnu/../../usr_sw5/bin/sw5ld: /usr/sw-mpp/swcc/swgcc530-tools-85/usr/bin/../../../swgcc530-tools-85/usr/lib/libc.a(dl-trampoline.o): change in gp: BRSGP _dl_call_pltexit
/usr/sw-mpp/swcc/swgcc530-tools-85/usr/bin/../lib/gcc/sw_64sw2-unknown-linux-gnu/5.3.0/../../../../sw_64sw2-unknown-linux-gnu/../../usr_sw5/bin/sw5ld: /usr/sw-mpp/swcc/swgcc530-tools-85/usr/bin/../../../swgcc530-tools-85/usr/lib/libc.a(dl-trampoline.o): change in gp: BRSGP _dl_fixup
/usr/sw-mpp/swcc/swgcc530-tools-85/usr/bin/../lib/gcc/sw_64sw2-unknown-linux-gnu/5.3.0/../../../../sw_64sw2-unknown-linux-gnu/../../usr_sw5/bin/sw5ld: /usr/sw-mpp/swcc/swgcc530-tools-85/usr/bin/../../../swgcc530-tools-85/usr/lib/libc.a(dl-trampoline.o): change in gp: BRSGP _dl_profile_fixup
/usr/sw-mpp/swcc/swgcc530-tools-85/usr/bin/../lib/gcc/sw_64sw2-unknown-linux-gnu/5.3.0/../../../../sw_64sw2-unknown-linux-gnu/../../usr_sw5/bin/sw5ld: /usr/sw-mpp/swcc/swgcc530-tools-85/usr/bin/../../../swgcc530-tools-85/usr/lib/libc.a(dl-trampoline.o): change in gp: BRSGP _dl_call_pltexit
/usr/sw-mpp/swcc/swgcc530-tools-85/usr/bin/../lib/gcc/sw_64sw2-unknown-linux-gnu/5.3.0/../../../../sw_64sw2-unknown-linux-gnu/../../usr_sw5/bin/sw5ld: final link failed: 输出不可表示的节
collect2: error: ld returned 1 exit status
make: *** [../../run/gcrm.exe] 错误 1请问是什么原因呢?