collect2: ld returned 1 exit status

Below error occurs during relink while applying the patch in oracle database.

Error:- 

collect2: ld returned 1 exit status
make[1]: *** [/data02/1124home/sysman/lib/libnmemso.so] Error 1
make: *** [libnmemso] Error 2


Solution:-

To resolve the issue, execute the following steps:

Continue with the patch installation when you receive thie error and complete it.

Search for file libjava.so on the server.

For  example you find it  under the following directory

$ORACLE_HOME/jdk/jre/lib/i386  or you may use $ find $ORACLE_HOME -name "*libjava*" -exec ls -lart {} \;

In case of 64 bit Operation system amd64 instead of i386.

eg. $ORACLE_HOME/jdk/jre/lib/amd64

Backup and edit $ORACLE_HOME/sysman/lib/env_sysman.mk or $ORACLE_HOME/sysman/lib/env_emagent.mk


Change : JRE_LIB_DIR=%JRE_HOME%/bin
To     : JRE_LIB_DIR=$(ORACLE_HOME)/jdk/jre/lib/i386   << Incase of 64bit you may have to replace i386 with amd64

Issue the failed relink command:
 
% make -f ins_sysman.mk relink_sharedobj SHAREDOBJ=libnmemso

ORA-48223: Interrupt Requested - Fetch Aborted - Return Code [12751] [HM_FINDING]


Errors in file /data01/ORAHOME/log/diag/rdbms/ace/PROD/trace/PROD_m000_7649.trc:
ORA-51106: check failed to complete due to an error.  See error below

ORA-48223: Interrupt Requested - Fetch Aborted - Return Code [12751] [HM_FINDING]

à If any one facing error as above while restoring the Oracle Database. This error will appear in alert log file. Need to follow the below steps to resolve the issue.

Solution:-

[oracle@erp ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Sat Jun 9 10:30:19 2018

Copyright (c) 1982, 2013, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL>  exec dbms_hm.drop_schema;

PL/SQL procedure successfully completed.

SQL> exec dbms_hm.create_schema;

SQL> commit;

Commit complete.