Skip to content

Commit 3d8721f

Browse files
richardlaumarco-ippolito
authored andcommitted
build: add version-specific library path for AIX
Add the version-specific directory containing the C/C++ runtime libraries to `-blibpath` on AIX. This will help link `node` against the correct libraries at run-time when compiled with a different version of the GNU C/C++ compiler without having to manually set a `LIBPATH` environment variable. PR-URL: #53585 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Beth Griggs <bethanyngriggs@gmail.com>
1 parent 0c91186 commit 3d8721f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

common.gypi

+4-1
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,9 @@
554554
'-Wl,-brtl',
555555
],
556556
}, { # else it's `AIX`
557+
'variables': {
558+
'gcc_major': '<!(<(python) -c "import os; import subprocess; CXX=os.environ.get(\'CXX\', \'g++\'); subprocess.run([CXX, \'-dumpversion\'])")'
559+
},
557560
# Disable the following compiler warning:
558561
#
559562
# warning: visibility attribute not supported in this
@@ -564,7 +567,7 @@
564567
# out more relevant warnings.
565568
'cflags': [ '-Wno-attributes' ],
566569
'ldflags': [
567-
'-Wl,-blibpath:/usr/lib:/lib:/opt/freeware/lib/pthread/ppc64',
570+
'-Wl,-blibpath:/usr/lib:/lib:/opt/freeware/lib/gcc/powerpc-ibm-aix7.3.0.0/>(gcc_major)/pthread/ppc64:/opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/>(gcc_major)/pthread/ppc64:/opt/freeware/lib/pthread/ppc64',
568571
],
569572
}],
570573
],

0 commit comments

Comments
 (0)