Repository navigation
LIBPATH issue in AIX node binary #25444
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.
Activity
bnoordhuis commentedon Jan 11, 2019
cc @nodejs/platform-ppc (we don't have an aix team? We don't have an aix team.)
mhdawson commentedon Jan 11, 2019
@ayappanec a couple of things to confirm
different versions with different gcc levels. Due to some issues with getting them both working we have
gcc 6.3 installed in a different location than norma. Want to be sure that it adding this would not cause
that configuration any issues.
mhdawson commentedon Jan 11, 2019
@gireeshpunathil, @gdams FYI as well.
gireeshpunathil commentedon Jan 11, 2019
I guess we expect the production systems to have only one c++ runtime, that too in the default path ('/lib:/usr/lib').
So hard-coding expectations to a non-standard path may cause unwanted issues for users?
On the other hand, as @mhdawson pointed out, our dev systems are configured with non-standard path for accommodating multiple toolchains, to build and test multiple versions of node that link against different runtimes.
@ayappanec - does that sound reasonable to you?
gireeshpunathil commentedon Jan 11, 2019
@bnoordhuis - we seem to have @nodejs/platform-aix team!
ayappanec commentedon Jan 11, 2019
@mhdawson
It is not additive.
This will affect if they are installed in different paths.
You guys use the gcc from AIX Toolbox ? or from other sources ?
What are the different gcc versions you are using to build nodejs ?
We (AIX Toolbox) always ship the libraries in /opt/freeware/lib. It never gets into /usr/lib. /lib is basically a symbolic link to /usr/lib.
richardlau commentedon Jan 11, 2019
#10128 added a
-blibpath:setting for AIX. It looks like #17604 refactorednode.gypto add anode_shared=="true"condition around it (where before it was set on AIX unconditionally).build: set `-blibpath:` for AIX
richardlau commentedon Jan 11, 2019
Fix in #25447.
ayappanec commentedon Jan 11, 2019
Saw the PR. Now it will work with AIX Toolbox libgcc & libstdc++. Great
@richardlau Thanks for the quick response and fix.
It will be very great if this fix goes to LTS release soon.
sam-github commentedon Jan 11, 2019
Usually things need to sit a bit in current before releasing in LTS, but for this kind of very specific bug fix in the build options, maybe it can be accelerated? @BethGriggs, any prediction on when this could be in an LTS release?
mhdawson commentedon Jan 11, 2019
@ayappanec I'm still concerned that this might break our existing setup/testing. I probably just need a bit more info.
When you say:
It makes me worry that it replaces paths that may be required given our current install. Is that potentially the case?
mhdawson commentedon Jan 11, 2019
For some context. Our machines were installed long ago and required a combination of packages from Bull Freeware and the AIX Toolbox. As we install new machines (we hare working on getting a new machine in place) we will try to use a better config as we understand work since then on the AIX Toolbox has improved things. After much discussion with some members of the AIX compiler team, we have the alternate compiler (6.3) installed in: /home/iojs/gcc-6.3.0-1 as you can see from the paths in what you have in the original post.
1 remaining item
build: set `-blibpath:` for AIX
build: set `-blibpath:` for AIX
build: set `-blibpath:` for AIX
build: set `-blibpath:` for AIX
build: set `-blibpath:` for AIX
build: set `-blibpath:` for AIX
build: set `-blibpath:` for AIX
build: set `-blibpath:` for AIX
build: set `-blibpath:` for AIX
build: set `-blibpath:` for AIX
build: set `-blibpath:` for AIX