IBM Support

IBM AIX: IBM Semeru Java libc++.a dependency on AIX

Question & Answer


Question

IBM Semeru "java -version" fails with libc++ related errors.


Answer


IBM open source Java, IBM Semeru, Java builds require IBM XL C++ Runtime 16.1 or higher/latest versions installed.
This is required for all IBM OpenJ9 builds.
XL C++ Runtime required on AIX

Starting with the XL C/C++ for AIX V16.1 release, the XL C++ Runtime package includes a new library called  libc++.a :
What is libc++.rte and should I install it as part of the C++ Runtime installation?

The new libc++.a ships as part of the new libc++.rte fileset.

# lslpp -w /usr/lib/libc++.a
  File                                                   Fileset               Type
  ----------------------------------------------------------------------------
  /usr/lib/libc++.a                           libc++.rte            Symlink


The dependency on libc++.a causes “java -version” command to fail in two scenarios.

1)   Runtime loading of the libjvm.so shared object

The IBM Semeru “java -version” command fails when trying to load the runtime linked libjvm.so shared object either when the libc++.rte fileset is not installed or the “/usr/lib/libc++.a“ library is not found.

# /opt/ibm/ibm-semeru-certified-11-jre/bin/java -version
failed to open </opt/ibm/ibm-semeru-certified-11-jre/lib/default/libjvm.so> - reason: <Could not load module /opt/ibm/ibm-semeru-certified-11-jre/lib/default/libjvm.so.
        Dependent module libc++.a(shr_64.o) could not be loaded.
Could not load module libc++.a(shr_64.o).
System error: No such file or directory
Could not load module /opt/ibm/ibm-semeru-certified-11-jre/lib/default/libjvm.so.
        Dependent module /opt/ibm/ibm-semeru-certified-11-jre/lib/default/libjvm.so could not be loaded.>
Failed to find VM – aborting

The dump command for libjvm.so  shows symbol “strcmp” is in shared object “shr_64.o”, which is an archive member of libc++.a library archive.  Hence, the libjvm.so dependency on the libc++.a library.

# dump -Tv -X64 /opt/ibm/ibm-semeru-certified-11-jre/lib/default/libjvm.so | grep -I libc
                                  ***Loader Section***
                       ***Loader Symbol Table Information***
[Index]      Value         Scn        IMEX  Sclass   Type           IMPid                     Name
……..
[74]    0x00000000    undef      IMP     DS    EXTref      libc++.a(shr_64.o)       strcmp
[84]    0x00000000    undef      IMP     DS    EXTref     libC.a(shrcore_64.o)   loadAndInit
…….


Checking for libc++.a path in  libc++.rte shows the symbolic links and actual file location:

# lslpp -f libc++.rte | grep -i libc++.a
      /usr/lib/libc++.a -> /usr/lpp/xlC/lib/libc++.a
      /usr/lpp/xlC/lib/aix61/libc++.a
 
# ls -l /usr/lpp/xlC/lib/libc++.a
lrwxrwxrwx    1 root     system           14 Oct 15 2023  /usr/lpp/xlC/lib/libc++.a -> aix61/libc++.a

So, the libc++.a library exists at:

# ls -l /usr/lpp/xlC/lib/aix61 | grep -i libc++
-r--r--r--    1 bin      bin         7440144 Aug 11 2022  libc++.a


Install of libc++.rte fileset can be confirmed with:

# lslpp -hc | grep -i libc++.rte
/usr/lib/objrepos:libc++.rte:16.1.0.10::COMMIT:COMPLETE:01/09/24:20;35;22




2.  Upgrade of  XL C/C++ Runtime from version v16.x to v17.x

The libc++.rte  gets upgraded either when  XL C/C++ v17.1 is installed or  AIX is upgraded to AIX 7.3 TL2.

The  “java -version” command for older levels of IBM Semeru Java fails with different libc++.abi related errors.
 
# /opt/ibm/ jdk-17.0.4.1+1/bin/java -version
openjdk version "17.0.4.1" 2022-08-12
IBM Semeru Runtime Open Edition 17.0.4.1 (build 17.0.4.1+1)
Eclipse OpenJ9 VM 17.0.4.1 (build openj9-0.33.1, JRE 17 AIX ppc64-64-Bit Compressed References 20220811_240 (JIT enabled, AOT enabled)
OpenJ9   - 1d9d16830
OMR      - b58aa2708
JCL      - 1f4d354e654 based on jdk-17.0.4.1+1)
libc++abi: terminating
or
libc++abi: terminating due to uncaught exception of type TR::CompilationInterrupted: Compilation Interrupted
or
libc++abi: terminating due to uncaught exception of type J9::JITShutdown: JIT Shutdown

etc.



IBM Semeru older release levels of java versions builds are compiled with 16.1 compiler.  When these builds are run against the upgraded 17.x XLC runtime, it results in failure due to incompatibility.  The Open XL V17.1 C/C++ ships with the new libc++.a, which includes two new archive libraries, libunwind.a and  libc++abi.a. That causes incompatibility with XL V16.1 C/C++ libc++.a.
IJ36340: V16.1 XLCLANG++ HITS LIBCXXABI TERMINATE WITH V17 RUNTIME

XL C++ Runtime 17.1 :

# dump -H /usr/lpp/xlC/lib/libc++.a
….
                        ***Import File Strings***
INDEX  PATH                          BASE                MEMBER
0      /usr/lib:/lib
1                                    libunwind.a         libunwind.so.1
2                                    libc++abi.a         libc++abi.so.1
3                                    librtl.a            shr.o
……


XL C++ Runtime 16.1:

# dump -H /usr/lpp/xlC/lib/libc++.a
….
                        ***Import File Strings***
INDEX  PATH                          BASE                MEMBER
0      /usr/vacpp/lib:/usr/lib:/lib
1                                    libpthread.a        shr_comm.o
2                                    libpthread.a        shr_xpg5.o
3                                    libc.a              shr.o
4                                    libC.a              shrcore.o
5                                    libc++.a            cxxabi.o
……


The lslpp command at AIX 7.3 also shows the two new libc++ rte filesets.

AIX OS level 7300-02-01-2346 :
# lslpp -l | grep "C++ Runtime"
  libc++.rte                17.1.1.4  COMMITTED  IBM XL C++ Runtime for AIX 7.1
  libc++abi.rte             17.1.1.4  COMMITTED  IBM XL C++ Runtime for AIX 7.2
  libunwind.rte             17.1.1.4  COMMITTED  IBM XL C++ Runtime for AIX 7.2
  xlC.aix61.rte            16.1.0.10  COMMITTED  IBM XL C++ Runtime for AIX 6.1
  xlC.msg.en_US.rte        16.1.0.10  COMMITTED  IBM XL C++ Runtime
  xlC.rte                  16.1.0.10  COMMITTED  IBM XL C++ Runtime for AIX

AIX OS level 7200-05-06-2320:

# lslpp -l | grep "C++ Runtime"
  libc++.rte               16.1.0.10  COMMITTED  IBM XL C++ Runtime for AIX 7.1
  xlC.aix61.rte            16.1.0.10  COMMITTED  IBM XL C++ Runtime for AIX 6.1
  xlC.msg.en_US.rte        16.1.0.10  COMMITTED  IBM XL C++ Runtime
  xlC.rte                  16.1.0.10  COMMITTED  IBM XL C++ Runtime for AIX
  xlC.sup.aix50.rte          9.0.0.1  COMMITTED  XL C/C++ Runtime for AIX 5.2



Problem is resolved either of the two ways:

a) Downgrade the C++ Runtime level from 17.1.x.x to 16.1.x.x.
  • Uninstall the 17.1.x.x C++ Runtime:
  # installp -ug libc++.rte libc++.adt.include libc++abi.rte libunwind.rte
  • Install the 16.1.x.x libc++.rte from:

b) Upgrade IBM Semeru Java version to the latest release levels as they are compiled with recent XL C/C++ compiler.




[{"Type":"MASTER","Line of Business":{"code":"LOB08","label":"Cognitive Systems"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SWG10","label":"AIX"},"ARM Category":[{"code":"a8m50000000L0G1AAK","label":"Java"}],"ARM Case Number":"TS016648886","Platform":[{"code":"PF002","label":"AIX"}],"Version":"All Versions"}]

Document Information

More support for:
AIX

Component:
Java

Software version:
All Versions

Operating system(s):
AIX

Document number:
7159223

Modified date:
07 December 2024

UID

ibm17159223

Manage My Notification Subscriptions