Description
I am from IBM AIX Toolbox development team.
IBM AIX Toolbox --> https://www.ibm.com/developerworks/aix/library/aix-toolbox/alpha.html
I just tried running node (v10.15.0-aix-ppc64) in AIX after downloading it from https://nodejs.org/en/download/
And got this loader error.
./node
exec(): 0509-036 Cannot load program ./node because of the following errors:
0509-150 Dependent module libstdc++.a(libstdc++.so.6) could not be loaded.
0509-022 Cannot load module libstdc++.a(libstdc++.so.6).
0509-026 System error: A file or directory in the path name does not exist.
When i dumped the loader section, i got this.
dump -X64 -H node
node:
***Loader Section***
Loader Header Information
VERSION# #SYMtableENT #RELOCent LENidSTR
0x00000001 0x0000bba2 0x000273fc 0x00000225
#IMPfilID OFFidSTR LENstrTBL OFFstrTBL
0x00000006 0x0038d728 0x00309360 0x0038d94d
***Import File Strings***
INDEX PATH BASE MEMBER
0 /home/iojs/gcc-6.3.0-1/opt/freeware/bin/../lib/gcc/powerpc-ibm-aix6.1.0.0/6.3.0/pthread/ppc64:/home/iojs/gcc-6.3.0-1/opt/freeware/bin/../lib/gcc/powerpc-ibm-aix6.1.0.0/6.3.0/../../../pthread/ppc64:/home/iojs/gcc-6.3.0-1/opt/freeware/bin/../lib/gcc/powerpc-ibm-aix6.1.0.0/6.3.0:/home/iojs/gcc-6.3.0-1/opt/freeware/bin/../lib/gcc:/home/iojs/gcc-6.3.0-1/opt/freeware/bin/../lib/gcc/powerpc-ibm-aix6.1.0.0/6.3.0/../../..:/usr/lib:/lib
1 libperfstat.a shr_64.o
2 libstdc++.a libstdc++.so.6
3 libgcc_s.a shr.o
4 libpthreads.a shr_xpg5_64.o
5 libc.a shr_64.o
The library loading path don't have "/opt/freeware/lib" where we ship libstdc++.a & libgcc_s.a .
So now one has to export LIBPATH to "/opt/freeware/lib:/usr/lib:/lib" to make it work.
We can fix this during the build itself by adding this to LDFLAGS before the compilation
"-Wl,-blibpath:/opt/freeware/lib:/usr/lib/lib"
The AIX linker puts this path in the loader section.