Ubuntu下编译PHP报错ld: final link failed: nonrepresentable section on output
具体报错信息如下:
/usr/bin/ld: /data/app/openssl/lib/libcrypto.a(ecs_asn1.o): relocation R_X86_64_PC32 against symbol `ECDSA_SIG_it' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /data/app/openssl/lib/libcrypto.a(cms_lib.o): relocation R_X86_64_PC32 against symbol `CMS_ContentInfo_it' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /data/app/openssl/lib/libcrypto.a(cms_io.o): relocation R_X86_64_PC32 against symbol `CMS_ContentInfo_it' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /data/app/openssl/lib/libcrypto.a(cms_dd.o): relocation R_X86_64_PC32 against symbol `CMS_DigestedData_it' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /data/app/openssl/lib/libssl.a(s2_srvr.o): relocation R_X86_64_PC32 against symbol `ssl2_accept' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /data/app/openssl/lib/libssl.a(s2_clnt.o): relocation R_X86_64_PC32 against symbol `ssl2_connect' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /data/app/openssl/lib/libssl.a(s2_lib.o): relocation R_X86_64_PC32 against symbol `ssl2_ciphers' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /data/app/openssl/lib/libssl.a(s3_srvr.o): relocation R_X86_64_PC32 against symbol `stderr@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /data/app/openssl/lib/libssl.a(s3_clnt.o): relocation R_X86_64_PC32 against symbol `ssl3_connect' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /data/app/openssl/lib/libssl.a(s3_lib.o): relocation R_X86_64_PC32 against symbol `ssl3_ciphers' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /data/app/openssl/lib/libssl.a(t1_enc.o): relocation R_X86_64_PC32 against symbol `stderr@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /data/app/openssl/lib/libssl.a(d1_both.o): relocation R_X86_64_PC32 against symbol `stderr@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /data/app/openssl/lib/libssl.a(ssl_lib.o): relocation R_X86_64_PC32 against symbol `ssl_undefined_function' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /data/app/openssl/lib/libssl.a(d1_enc.o): relocation R_X86_64_PC32 against symbol `stderr@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /data/app/openssl/lib/libcrypto.a(txt_db.o): relocation R_X86_64_PC32 against symbol `stderr@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: nonrepresentable section on output
collect2: error: ld returned 1 exit status
make: *** [Makefile:141:libphp5.la] 错误 1
没有找到相关结果
已邀请:
2 个回复
空心菜 - 心向阳光,茁壮成长
解决方法:
如果是make ,在./configure 前面添加: CFLAGS="-fPIC" 变成: 对于cmake生成的makefile则可以在CMakeList.txt或者cmake生成的CMakeCache.txt中加上-fPIC: 参考:https://blog.csdn.net/jirryzhang/article/details/72784439
空心菜 - 心向阳光,茁壮成长
参考: https://www.jianshu.com/p/c5d8172b3b76