参考 http://www.th7.cn/db/Oracle/201501/87086.shtml
仅仅执行sed方法,仍然有部分mk文件编译不过,报告“undefined reference to `xxxxx' ”,这种情况下 需要手动修改mk文件。
首先根据错误日志的INFO:gcc -o 找到正在编译的目标,根据这个目标名称去mk文件里查找对应的LINKELINE,在对应的LINKLINE上添加 -Wl,--no-as-needed
INFO: ellScanInit':kfkl.c:(text.unlikely+0x3081): undefined reference to `oss_initialize'kfkl.c:(text.unlikely+0x30e9): undefined reference to `oss_cell_discovery_open'kfkl.cINFO: :(text.unlikely+0x3172): undefined reference to `oss_cell_discovery_fetch'/oracle/base/dbhome_1/lib//libasmclnt12.a(kfkl.o): In function `kfklCellScanNext':kfkl.c:(text.unlikely+0x3231): undefined reference to `oss_cell_discovery_fetch'/oracle/base/dbhome_1/lib//libasmclnt12.a(kfkl.o): In function `kfklCellScanTerm':kfkl.c:(text.unlikely+0x3296): undefined reference to `oss_cell_discovery_close'collect2: ld returned 1 exit statusINFO: make: *** [/oracle/base/dbhome_1/rdbms/lib/amdu] Error 1INFO: End output from spawned process.INFO: ----------------------------------INFO: Exception thrown from action: makeException Name: MakefileExceptionException String: Error in invoking target 'all_no_orcl' of makefile '/oracle/base/dbhome_1/rdbms/lib/ins_rdbms.mk'. See '/oracle/oraInventory/logs/installActions2013-09-19_08-51-51AM.log' for details.Exception Severity: 1
Ah, the AMDU is the issue..again: we adjust the gcc parameter..
oracle$ vi /oracle/base/dbhome_1/rdbms/lib/env_rdbms.mk
Search for the lines:
AMDU_LINKLINE=$(LINK) $(S0MAIN) -Wl,--no-as-needed $(SSKFMUED) $(SKFMUPT) /$(LLIBDBTOOLS) $(LLIBCORE) $(LLIBGENERIC) $(LLIBUNLSRTL) /$(LLIBNLSRTL) $(LLIBCORE) $(LLIBSAGE) $(LLIBSKGXP) /$(LLIBNLSRTL) $(CSSCLNTLIBS_SERVER) $(LLIBASMCLNT) $(LINKTTLIBS)
Change these to:
AMDU_LINKLINE=$(LINK) $(S0MAIN) -Wl,--no-as-needed $(SSKFMUED) $(SKFMUPT) /$(LLIBDBTOOLS) $(LLIBCORE) $(LLIBGENERIC) $(LLIBUNLSRTL) /$(LLIBNLSRTL) $(LLIBCORE) $(LLIBSAGE) $(LLIBSKGXP) /$(LLIBNLSRTL) $(CSSCLNTLIBS_SERVER) $(LLIBASMCLNT) $(LINKTTLIBS)