From 63522886ea298073d8bb6cd4a5ee835c98dce13d Mon Sep 17 00:00:00 2001 From: Sam Ruby Date: Sat, 29 Sep 2018 16:43:39 -0400 Subject: [PATCH] build: add loader path to rpath for cctest Building on Mac OS/X as follows: ``` ./configure --shared make -j4 test ``` Results in: ``` dyld: Library not loaded: @rpath/libnode.67.dylib Referenced from: /Users/rubys/git/node-shared/out/Release/cctest Reason: image not found make: *** [cctest] Abort trap: 6 ``` This change adds the loader path to the runtime path for the `cctest` executable. Backport-PR-URL: https://github.com/nodejs/node/pull/25681 PR-URL: https://github.com/nodejs/node/pull/23168 Reviewed-By: Richard Lau Reviewed-By: Refael Ackermann Reviewed-By: James M Snell --- node.gyp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/node.gyp b/node.gyp index ed20a490d9ee1d..43ba985df54111 100644 --- a/node.gyp +++ b/node.gyp @@ -956,6 +956,11 @@ ['OS=="solaris"', { 'ldflags': [ '-I<(SHARED_INTERMEDIATE_DIR)' ] }], + [ 'node_shared=="true"', { + 'xcode_settings': { + 'OTHER_LDFLAGS': [ '-Wl,-rpath,@loader_path', ], + }, + }], ], } ], # end targets