Skip to content

Commit 6300a03

Browse files
committed
We still need to set the install_name on macOS
* Otherwise building an executable for mkmf checks with `-rpath /path/to/libtruffleruby/dir -ltruffleruby` fails on macOS.
1 parent 54498b0 commit 6300a03

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/main/c/cext/extconf.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,10 @@ module Truffle::Platform
2323
# -DRUBY_EXPORT is added in MRI's configure.in.
2424
$CFLAGS << " -DRUBY_EXPORT"
2525

26+
if Truffle::Platform.darwin?
27+
# Set the install_name of libtruffleruby on macOS, so mkmf executables linking to it
28+
# will know they need to look at the rpath to find it.
29+
$LIBRUBYARG = "-Wl,-install_name,@rpath/libtruffleruby.dylib #{$LIBRUBYARG}"
30+
end
31+
2632
create_makefile('libtruffleruby')

0 commit comments

Comments
 (0)