1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Revert "test/fiddle/helper.rb: remove duplication (#3863)" (#3865)

This reverts commit bd47a8d660.

`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.
This commit is contained in:
Kenta Murata 2020-12-08 21:58:08 +09:00 committed by GitHub
parent 30d4a7ad9a
commit 2427393b4d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
Notes: git 2020-12-08 21:58:38 +09:00
Merged-By: mrkn <mrkn@ruby-lang.org>

View file

@ -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,