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

Closed
wants to merge 1 commit into
from
@sxa555
Contributor
sxa555 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.
@mscdex mscdex added the aix label Dec 5, 2016
@mhdawson
Contributor
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.

@mhdawson

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

@sxa555
Contributor
sxa555 commented Dec 6, 2016 edited

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 :)

@mhdawson

LGTM

@gibfahn
gibfahn approved these changes Dec 9, 2016 View changes
@gibfahn
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.

@sxa555
Contributor
sxa555 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.

@sxa555
Contributor
sxa555 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 ...

@bnoordhuis

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/

node.gyp
@@ -936,6 +936,12 @@
}, {
'type': 'executable',
}],
+ ['target_arch=="ppc64"', {
+ 'ldflags': ['-Wl,-blibpath:/usr/lib:/lib:/opt/freeware/lib/pthread/ppc64'],
@bnoordhuis
bnoordhuis Dec 13, 2016 Member

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

@sxa555
sxa555 Dec 14, 2016 Contributor

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

@sxa555 sxa555 changed the title from build: Modify library search path on AIX to include /opt/freeware/lib to build: Add /opt/freeware/... to AIX library path Dec 14, 2016
@sxa555
Contributor
sxa555 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
Member
gibfahn commented Dec 14, 2016

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

@sxa555 sxa555 build: add /opt/freeware/... to AIX library path
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.
024a4bf
@gibfahn gibfahn self-assigned this Dec 23, 2016
@italoacasas
Member

@gibfahn are you going to land this ?

@gibfahn gibfahn added a commit that referenced this pull request Dec 29, 2016
@sxa555 @gibfahn sxa555 + gibfahn build: add /opt/freeware/... to AIX library path
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>
e407478
@gibfahn
Member
gibfahn commented Dec 29, 2016

Landed in e407478

@gibfahn gibfahn closed this Dec 29, 2016
@joyeecheung joyeecheung added a commit to joyeecheung/node that referenced this pull request Jan 2, 2017
@sxa555 @joyeecheung sxa555 + joyeecheung build: add /opt/freeware/... to AIX library path
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: nodejs#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>
a459e6f
@evanlucas evanlucas added a commit that referenced this pull request Jan 3, 2017
@sxa555 @evanlucas sxa555 + evanlucas build: add /opt/freeware/... to AIX library path
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>
9767e5e
@evanlucas evanlucas referenced this pull request Jan 3, 2017
Merged

v7.4.0 release proposal #10589

@evanlucas evanlucas added a commit that referenced this pull request Jan 3, 2017
@sxa555 @evanlucas sxa555 + evanlucas build: add /opt/freeware/... to AIX library path
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>
b0dcfd1
@evanlucas evanlucas added a commit that referenced this pull request Jan 4, 2017
@sxa555 @evanlucas sxa555 + evanlucas build: add /opt/freeware/... to AIX library path
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>
ad5ae92
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment