summaryrefslogtreecommitdiff
path: root/test/fiddle/helper.rb
diff options
context:
space:
mode:
authornagachika <nagachika@ruby-lang.org>2020-10-01 21:15:38 +0900
committernagachika <nagachika@ruby-lang.org>2020-10-01 21:15:38 +0900
commit5445e0435260b449decf2ac16f9d09bae3cafe72 (patch)
tree0ef6d6cdffce085b3711419d73a269c117508e99 /test/fiddle/helper.rb
parentb35bfa6abb7760e4323a4341dff840f59ddcfde1 (diff)
merge revision(s) 0168094da28c146062db22e69cbd9316418310f9,cdef17096c03099f17ecf0af51f43faa0944f96d,b7d86e330c76b4f9615511307e1c40f4f2937c83:v2_7_2
Use libSystem.dylib instead of libm.dylib and libc.dylib Because macOS 11.0(Big Sur) was removed libc and libm from `/usr/lib`. libSystem.dylib is also symlink. Use libSystem.B.dylib Workaroud for macOS Big Sur(11.0)
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,