diff options
author | Kenta Murata <mrkn@users.noreply.github.com> | 2020-12-08 21:58:08 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-08 21:58:08 +0900 |
commit | 2427393b4d1ea0557362b106044e3aba3da32370 (patch) | |
tree | 97e2083c169766e12180ff8a079b3949a9d5fa32 /test/fiddle/helper.rb | |
parent | 30d4a7ad9a1f629d84b9b0e22db4ba146e63fd61 (diff) | |
download | ruby-2427393b4d1ea0557362b106044e3aba3da32370.tar.gz |
Revert "test/fiddle/helper.rb: remove duplication (#3863)" (#3865)
This reverts commit bd47a8d660ab33a20c5e28d0effcc29105c434e4.
`libc_so` and `libm_so` are `nil` at line 124 because Big Sur doesn't have `/usr/lib/libSystem.B.dylib`.
The reassignment at line 127 is necessary in this case.
Diffstat (limited to 'test/fiddle/helper.rb')
-rw-r--r-- | test/fiddle/helper.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/test/fiddle/helper.rb b/test/fiddle/helper.rb index 6d533122e0..13bd3ed4ea 100644 --- a/test/fiddle/helper.rb +++ b/test/fiddle/helper.rb @@ -55,7 +55,6 @@ when /mingw/, /mswin/ crtname = RbConfig::CONFIG["RUBY_SO_NAME"][/msvc\w+/] || 'ucrtbase' libc_so = libm_so = "#{crtname}.dll" when /darwin/ - # macOS 11.0+ removed libSystem.B.dylib from /usr/lib. But It works with dlopen. libc_so = libm_so = "/usr/lib/libSystem.B.dylib" when /kfreebsd/ libc_so = "/lib/libc.so.0.1" @@ -123,6 +122,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, |