Skip to content

LIBPATH issue in AIX node binary #25444

Description

@ayappanec

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

  1. added
    aixIssues and PRs related to the AIX platform.
    on Jan 11, 2019
  2. bnoordhuis commented on Jan 11, 2019

    @bnoordhuis
    Member

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

  3. mhdawson commented on Jan 11, 2019

    @mhdawson
    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.
  4. mhdawson commented on Jan 11, 2019

    @mhdawson
    Member

    @gireeshpunathil, @gdams FYI as well.

  5. gireeshpunathil commented on Jan 11, 2019

    @gireeshpunathil
    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?

  6. gireeshpunathil commented on Jan 11, 2019

    @gireeshpunathil
    Member

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

  7. ayappanec commented on Jan 11, 2019

    @ayappanec
    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.

  8. richardlau commented on Jan 11, 2019

    @richardlau
    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).

  9. self-assigned this
    on Jan 11, 2019
  10. added a commit that references this issue on Jan 11, 2019
  11. richardlau commented on Jan 11, 2019

    @richardlau
    Member

    Fix in #25447.

  12. ayappanec commented on Jan 11, 2019

    @ayappanec
    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.

  13. sam-github commented on Jan 11, 2019

    @sam-github
    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?

  14. mhdawson commented on Jan 11, 2019

    @mhdawson
    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?

  15. mhdawson commented on Jan 11, 2019

    @mhdawson
    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.

  16. 1 remaining item

  17. added a commit that references this issue on Jan 14, 2019
  18. added a commit that references this issue on Jan 16, 2019
  19. added a commit that references this issue on Feb 28, 2019
  20. added a commit that references this issue on Jul 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

aixIssues and PRs related to the AIX platform.regressionIssues related to regressions.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions