尝试在 Oracle Linux 7.3 或 7.5 上安装 Oracle 12c 32 位客户端(12.1 或 12.2)时,链接静态库时会抛出错误:
INFO: Start output from spawned process:
INFO: ----------------------------------
INFO:
INFO: /u01/app/oracle/product/12.2.0_client32/bin/genclntsh
INFO: /bin/ld: /u01/app/oracle/product/12.2.0_client32/lib/libnls12.a(lxecg2e.o): direct GOT relocation R_386_GOT32 against `lxecerr' without base register can not be used when making a shared object
/bin/ld: final link failed: Bad value
INFO: collect2: error: ld returned 1 exit status
INFO: genclntsh: Failed to link libclntshcore.so.12.1
INFO: make: *** [client_sharedlib] Error 1
不是很具体,我在 Oracle KM Doc ID 2246237.1 中仅找到一个参考。
其中的根本原因和解决方案是:
原因
SLES 12 SP2 附带 binutils 2.26,这破坏了某些共享库链接的兼容性。
解决方案 01)将 binutils 包更新至 binutils-2.26.1-9.15.1 或更高版本。
但事实上,我的服务器里有binutils-2.27-27.base.el7.x86_64。
解决方案-如下。
答案1
解决方法是降级二进制实用程序:
[email protected]:/home/jhartman$ sudo yum downgrade binutils*
Loaded plugins: ulninfo
Resolving Dependencies
--> Running transaction check
---> Package binutils.x86_64 0:2.25.1-32.base.el7_4.2 will be a downgrade
---> Package binutils.x86_64 0:2.27-27.base.el7 will be erased
---> Package binutils-devel.x86_64 0:2.25.1-32.base.el7_4.2 will be a downgrade
---> Package binutils-devel.x86_64 0:2.27-27.base.el7 will be erased
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================================================================================================================================================================================================================
Package Arch Version Repository Size
================================================================================================================================================================================================================================================================================
Downgrading:
binutils x86_64 2.25.1-32.base.el7_4.2 ol7_latest 5.4 M
binutils-devel x86_64 2.25.1-32.base.el7_4.2 ol7_latest 845 k
Transaction Summary
此后,可以编译和链接库:
oracle$ export ORACLE_HOME=/u01/app/oracle/product/12.2.0_client32
oracle$ /u01/app/oracle/product/12.2.0_client32/bin/genclntsh
oracle$
我确实相信完成安装后,binutils 可以再次升级到最新版本(但在安装 RSU 的情况下不要忘记这个问题)。
PS:我已提出 SR 3-17356002141:安装 Oracle 32 位客户端时出错(直接 GOT 重定位 R_386_GOT32 针对“ipp_zcalloc”)