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

build: Add /opt/freeware/... to AIX library path #10128

Closed
wants to merge 1 commit into from

Conversation

sxa
Copy link
Member

@sxa sxa commented Dec 5, 2016

Checklist
  • make -j8 test (UNIX), or vcbuild test nosign (Windows) passes
  • commit message follows commit guidelines
Affected core subsystem(s)

build

Description of change

At the moment the library search path encoded into the AIX binary has the full path to whether the GNU libstdc++ and libgcc_s were installed on the machine. Unless the user has the exact same package/version as was used on the build machine, the node binary will not be able to pick them up by default, and the user will have to set the LIBPATH variable themselves to the location on their machine.

On the assumption that most people will be picking up their is of libstdc++/libgcc_s from either the Bull Freeware site or the IBM AIX toolbox, this PR adjusts the search path within the node binary to point to /opt/freeware/lib (or lib64) to find this library. The current packages from Bull Freeware/AIX toolbox symlinks those libraries into those locations, so it is far more likely to work out of the box than the current system. For reference, here is the library search path within the current node 7.2.0 binary:

/opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/4.8.5/pthread/ppc64:/opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/4.8.5/../../../pthread/ppc64:/opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/4.8.5:/opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/4.8.5/../../..:/usr/lib:/lib

This change squashes that to be /usr/lib:/lib:/opt/freeware/lib (or lib64).

Considerations for reviewers:

  1. I have added /opt/freeware/lib{64} to the end instead of the start of the search path. if someone happens to have a version of the GNU C++ libraries in /usr/lib they will be picked up in preference to any in /opt/freeware/lib64
  2. If the user has multiple versions of the GNU C++ runtimes libraries installed (unlikely you'd hope!) and an old one is linked into /opt/freeware/lib64 then it may be too old. This is the only situation in which we might be worse off - if the user has multiple versions, and has the exact version in the same place as the one encoded into the current binaries.
  3. We could add /usr/local/lib{64} as well which would be the most common location for anyone that has a self-compiled version of gcc available, but I suspect that to ease support and discourage building their own GNU C++ libraries we should leave it as-is.

@nodejs-github-bot nodejs-github-bot added the build Issues and PRs related to build files or the CI. label Dec 5, 2016
@mscdex mscdex added the aix Issues and PRs related to the AIX platform. label Dec 5, 2016
@mhdawson
Copy link
Member

mhdawson commented Dec 5, 2016

Looks like you have some stray commits in the PR. Those from Nov 23. I expect only the last one whould be in the PR.

Copy link
Member

@mhdawson mhdawson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change itself looks ok, but need to fix up commits included.

@sxa
Copy link
Member Author

sxa commented Dec 6, 2016

Done - I'd added some unlanded commits into the master branch I'd based this off. SIde effect to submitting the PR quickly before I was leaving he office for the day :)

Copy link
Member

@mhdawson mhdawson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mhdawson
Copy link
Member

mhdawson commented Dec 6, 2016

CI run to validate: https://ci.nodejs.org/job/node-test-pull-request/5267/

@gibfahn
Copy link
Member

gibfahn commented Dec 9, 2016

LGTM, this seems like a sensible default, and anything that means less fiddling with the LIBPATH sounds great.

Windows CI failure looks unrelated.

@sxa
Copy link
Member Author

sxa commented Dec 12, 2016

There's an follow-up issue with this that I'll need to address - it's not correctly picking up the threaded version of libstdc++ on all machines - please do not land yet.

@sxa
Copy link
Member Author

sxa commented Dec 13, 2016

Follow-up issue resolved - it wasn't pointing at the location of the pthread variants of the GNU C++ runtime libraries. If someone could run this through CI again that would be appreciated ...

Copy link
Member

@bnoordhuis bnoordhuis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but the status line should be <= 50 characters and the convention is to not uppercase (i.e., 'modify' instead of 'Modify'.)

CI: https://ci.nodejs.org/job/node-test-pull-request/5386/

@@ -936,6 +936,12 @@
}, {
'type': 'executable',
}],
['target_arch=="ppc64"', {
'ldflags': ['-Wl,-blibpath:/usr/lib:/lib:/opt/freeware/lib/pthread/ppc64'],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps the tiniest of nits: if you break after the [, the line fits in 80 columns.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done - made the change to both versions to make them consistent

@sxa sxa changed the title build: Modify library search path on AIX to include /opt/freeware/lib build: Add /opt/freeware/... to AIX library path Dec 14, 2016
@sxa
Copy link
Member Author

sxa commented Dec 14, 2016

@bnoordhuis The first line of the commit message was <50 characters - it was only the title of this PR that was longer in order to be a bit more descriptive - I've changed it now, but are the titles of PRs always expected to be that short too?

@gibfahn
Copy link
Member

gibfahn commented Dec 14, 2016

@sxa555 Agreed that your commit message is already <50 chars, but it is still capitalised (s/Add/add)

To ease the use of the AIX binaries, add
/opt/freeware/lib/pthread{/ppc64} into the search path encoded into the
library, so that any version the user has installed from the common download
locations will work out of the box without having to explicitly set LIBPATH
in their environment.
@jasnell
Copy link
Member

jasnell commented Dec 23, 2016

@gibfahn gibfahn self-assigned this Dec 23, 2016
@italoacasas
Copy link
Contributor

@gibfahn are you going to land this ?

gibfahn pushed a commit that referenced this pull request Dec 29, 2016
To ease the use of the AIX binaries, add
/opt/freeware/lib/pthread{/ppc64} into the search path encoded into the
library, so that any version the user has installed from the common
download locations will work out of the box without having to explicitly
set LIBPATH in their environment.

PR-URL: #10128
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
@gibfahn
Copy link
Member

gibfahn commented Dec 29, 2016

Landed in e407478

@gibfahn gibfahn closed this Dec 29, 2016
evanlucas pushed a commit that referenced this pull request Jan 3, 2017
To ease the use of the AIX binaries, add
/opt/freeware/lib/pthread{/ppc64} into the search path encoded into the
library, so that any version the user has installed from the common
download locations will work out of the box without having to explicitly
set LIBPATH in their environment.

PR-URL: #10128
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
evanlucas pushed a commit that referenced this pull request Jan 4, 2017
To ease the use of the AIX binaries, add
/opt/freeware/lib/pthread{/ppc64} into the search path encoded into the
library, so that any version the user has installed from the common
download locations will work out of the box without having to explicitly
set LIBPATH in their environment.

PR-URL: #10128
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins pushed a commit that referenced this pull request Jan 23, 2017
To ease the use of the AIX binaries, add
/opt/freeware/lib/pthread{/ppc64} into the search path encoded into the
library, so that any version the user has installed from the common
download locations will work out of the box without having to explicitly
set LIBPATH in their environment.

PR-URL: #10128
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins pushed a commit that referenced this pull request Jan 23, 2017
To ease the use of the AIX binaries, add
/opt/freeware/lib/pthread{/ppc64} into the search path encoded into the
library, so that any version the user has installed from the common
download locations will work out of the box without having to explicitly
set LIBPATH in their environment.

PR-URL: #10128
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins pushed a commit that referenced this pull request Jan 23, 2017
To ease the use of the AIX binaries, add
/opt/freeware/lib/pthread{/ppc64} into the search path encoded into the
library, so that any version the user has installed from the common
download locations will work out of the box without having to explicitly
set LIBPATH in their environment.

PR-URL: #10128
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins pushed a commit that referenced this pull request Jan 24, 2017
To ease the use of the AIX binaries, add
/opt/freeware/lib/pthread{/ppc64} into the search path encoded into the
library, so that any version the user has installed from the common
download locations will work out of the box without having to explicitly
set LIBPATH in their environment.

PR-URL: #10128
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins pushed a commit that referenced this pull request Jan 24, 2017
To ease the use of the AIX binaries, add
/opt/freeware/lib/pthread{/ppc64} into the search path encoded into the
library, so that any version the user has installed from the common
download locations will work out of the box without having to explicitly
set LIBPATH in their environment.

PR-URL: #10128
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
This was referenced Jan 24, 2017
MylesBorins pushed a commit that referenced this pull request Jan 31, 2017
To ease the use of the AIX binaries, add
/opt/freeware/lib/pthread{/ppc64} into the search path encoded into the
library, so that any version the user has installed from the common
download locations will work out of the box without having to explicitly
set LIBPATH in their environment.

PR-URL: #10128
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins pushed a commit that referenced this pull request Feb 1, 2017
To ease the use of the AIX binaries, add
/opt/freeware/lib/pthread{/ppc64} into the search path encoded into the
library, so that any version the user has installed from the common
download locations will work out of the box without having to explicitly
set LIBPATH in their environment.

PR-URL: #10128
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.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. build Issues and PRs related to build files or the CI.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants