Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LIBPATH issue in AIX node binary #25444

Closed
ayappanec opened this issue Jan 11, 2019 · 13 comments
Closed

LIBPATH issue in AIX node binary #25444

ayappanec opened this issue Jan 11, 2019 · 13 comments
Assignees
Labels
aix Issues and PRs related to the AIX platform. regression Issues related to regressions.

Comments

@ayappanec
Copy link

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.

@bnoordhuis bnoordhuis added the aix Issues and PRs related to the AIX platform. label Jan 11, 2019
@bnoordhuis
Copy link
Member

cc @nodejs/platform-ppc (we don't have an aix team? We don't have an aix team.)

@mhdawson
Copy link
Member

@ayappanec a couple of things to confirm

  • is this additive, ie it will not affect picking up the library from wherever it would have been found without the option
  • does this handle (or at least not break) the case where there are 2 compilers installed on the machine. We have both the default and gcc 6.3 compilers installed on the same machine as we need to build
    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
Copy link
Member

@gireeshpunathil, @gdams FYI as well.

@gireeshpunathil
Copy link
Member

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
Copy link
Member

@bnoordhuis - we seem to have @nodejs/platform-aix team!

@ayappanec
Copy link
Author

@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
Copy link
Member

We can fix this during the build itself by adding this to LDFLAGS before the compilation
"-Wl,-blibpath:/opt/freeware/lib:/usr/lib/lib"

#10128 added a -blibpath: setting for AIX. It looks like #17604 refactored node.gyp to add a node_shared=="true" condition around it (where before it was set on AIX unconditionally).

@richardlau richardlau self-assigned this Jan 11, 2019
richardlau added a commit to richardlau/node-1 that referenced this issue Jan 11, 2019
nodejs#17604 refactored the gyp files
so that `-blibpath:` on AIX was only set if `node_shared=="true"`.
Restore the setting for non-shared builds.

Fixes: nodejs#25444
@richardlau
Copy link
Member

Fix in #25447.

@ayappanec
Copy link
Author

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
Copy link
Contributor

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
Copy link
Member

@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 is not additive.

It makes me worry that it replaces paths that may be required given our current install. Is that potentially the case?

@mhdawson
Copy link
Member

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.

@mhdawson
Copy link
Member

I see now that we used to have the correct option in place but is was regressed, given that I guess my concerns about breaking our existing setup/testing are not valid.

addaleax pushed a commit that referenced this issue Jan 14, 2019
#17604 refactored the gyp files
so that `-blibpath:` on AIX was only set if `node_shared=="true"`.
Restore the setting for non-shared builds.

Fixes: #25444

PR-URL: #25447
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
@richardlau richardlau added the regression Issues related to regressions. label Jan 15, 2019
BridgeAR pushed a commit to BridgeAR/node that referenced this issue Jan 16, 2019
nodejs#17604 refactored the gyp files
so that `-blibpath:` on AIX was only set if `node_shared=="true"`.
Restore the setting for non-shared builds.

Fixes: nodejs#25444

PR-URL: nodejs#25447
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
BethGriggs pushed a commit that referenced this issue Feb 13, 2019
#17604 refactored the gyp files
so that `-blibpath:` on AIX was only set if `node_shared=="true"`.
Restore the setting for non-shared builds.

Fixes: #25444

PR-URL: #25447
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
BethGriggs pushed a commit that referenced this issue Feb 19, 2019
#17604 refactored the gyp files
so that `-blibpath:` on AIX was only set if `node_shared=="true"`.
Restore the setting for non-shared builds.

Fixes: #25444

PR-URL: #25447
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
BethGriggs pushed a commit that referenced this issue Feb 20, 2019
#17604 refactored the gyp files
so that `-blibpath:` on AIX was only set if `node_shared=="true"`.
Restore the setting for non-shared builds.

Fixes: #25444

PR-URL: #25447
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
rvagg pushed a commit that referenced this issue Feb 28, 2019
#17604 refactored the gyp files
so that `-blibpath:` on AIX was only set if `node_shared=="true"`.
Restore the setting for non-shared builds.

Fixes: #25444

PR-URL: #25447
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
richardlau added a commit to richardlau/node-1 that referenced this issue Mar 6, 2019
nodejs#17604 refactored the gyp files
so that `-blibpath:` on AIX was only set if `node_shared=="true"`.
Restore the setting for non-shared builds.

Fixes: nodejs#25444

Backport-PR-URL: nodejs#25521
PR-URL: nodejs#25447
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
richardlau added a commit to richardlau/node-1 that referenced this issue Mar 12, 2019
nodejs#17604 refactored the gyp files
so that `-blibpath:` on AIX was only set if `node_shared=="true"`.
Restore the setting for non-shared builds.

Fixes: nodejs#25444

Backport-PR-URL: nodejs#26478
PR-URL: nodejs#25447
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
BethGriggs pushed a commit that referenced this issue Mar 15, 2019
#17604 refactored the gyp files
so that `-blibpath:` on AIX was only set if `node_shared=="true"`.
Restore the setting for non-shared builds.

Fixes: #25444

Backport-PR-URL: #26478
PR-URL: #25447
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
BethGriggs pushed a commit that referenced this issue Mar 19, 2019
#17604 refactored the gyp files
so that `-blibpath:` on AIX was only set if `node_shared=="true"`.
Restore the setting for non-shared builds.

Fixes: #25444

Backport-PR-URL: #25521
PR-URL: #25447
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aix Issues and PRs related to the AIX platform. regression Issues related to regressions.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants