summaryrefslogtreecommitdiff
path: root/test/fiddle/helper.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/fiddle/helper.rb')
-rw-r--r--test/fiddle/helper.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/test/fiddle/helper.rb b/test/fiddle/helper.rb
index 57ded49..73f6f78 100644
--- a/test/fiddle/helper.rb
+++ b/test/fiddle/helper.rb
@@ -43,8 +43,7 @@ when /mingw/, /mswin/
crtname = RbConfig::CONFIG["RUBY_SO_NAME"][/msvc\w+/] || 'ucrtbase'
libc_so = libm_so = "#{crtname}.dll"
when /darwin/
- libc_so = "/usr/lib/libc.dylib"
- libm_so = "/usr/lib/libm.dylib"
+ libc_so = libm_so = "/usr/lib/libSystem.B.dylib"
when /kfreebsd/
libc_so = "/lib/libc.so.0.1"
libm_so = "/lib/libm.so.1"
@@ -111,6 +110,11 @@ end
libc_so = nil if !libc_so || (libc_so[0] == ?/ && !File.file?(libc_so))
libm_so = nil if !libm_so || (libm_so[0] == ?/ && !File.file?(libm_so))
+# macOS 11.0+ removed libSystem.B.dylib from /usr/lib. But It works with dlopen.
+if RUBY_PLATFORM =~ /darwin/
+ libc_so = libm_so = "/usr/lib/libSystem.B.dylib"
+end
+
if !libc_so || !libm_so
ruby = EnvUtil.rubybin
# When the ruby binary is 32-bit and the host is 64-bit,