Linux

Oracle 12c 32 位客戶端和針對“lxecerr”的直接 GOT 重定位 R_386_GOT32

  • August 14, 2018

嘗試在 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

32 位客戶端錯誤

不是很具體,我在 Oracle KM Doc ID 2246237.1 中只找到了一個參考。

根本原因和解決方案是:

原因

SLES 12 SP2 附帶 binutils 2.26,它破壞了某些共享庫連結的兼容性。

解決方案

  1. 將 binutils 包更新到 binutils-2.26.1-9.15.1 或更高版本。

但事實上,我的伺服器中確實有binutils-2.27-27.base.el7.x86_64

解決方案 - 下面。

解決方法是降級binutils:

jhartman@sms.jhartman.pl:/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’)

引用自:https://serverfault.com/questions/926317