ruby-changes:64026
From: Kenta <ko1@a...>
Date: Tue, 8 Dec 2020 21:58:28 +0900 (JST)
Subject: [ruby-changes:64026] 2427393b4d (master): Revert "test/fiddle/helper.rb: remove duplication (#3863)" (#3865)
https://git.ruby-lang.org/ruby.git/commit/?id=2427393b4d From 2427393b4d1ea0557362b106044e3aba3da32370 Mon Sep 17 00:00:00 2001 From: Kenta Murata <mrkn@u...> Date: Tue, 8 Dec 2020 21:58:08 +0900 Subject: 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. diff --git a/test/fiddle/helper.rb b/test/fiddle/helper.rb index 6d53312..13bd3ed 100644 --- a/test/fiddle/helper.rb +++ b/test/fiddle/helper.rb @@ -55,7 +55,6 @@ when /mingw/, /mswin/ https://github.com/ruby/ruby/blob/trunk/test/fiddle/helper.rb#L55 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 https://github.com/ruby/ruby/blob/trunk/test/fiddle/helper.rb#L122 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, -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/