summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/fiddle/helper.rb14
1 files changed, 13 insertions, 1 deletions
diff --git a/test/fiddle/helper.rb b/test/fiddle/helper.rb
index ad43e3d678..57ded4951f 100644
--- a/test/fiddle/helper.rb
+++ b/test/fiddle/helper.rb
@@ -22,7 +22,16 @@ when /linux/
case RbConfig::SIZEOF['void*']
when 4
# 32-bit ruby
- libdir = '/lib32' if File.directory? '/lib32'
+ case RUBY_PLATFORM
+ when /armv\w+-linux/
+ # In the ARM 32-bit libc package such as libc6:armhf libc6:armel,
+ # libc.so and libm.so are installed to /lib/arm-linux-gnu*.
+ # It's not installed to /lib32.
+ dirs = Dir.glob('/lib/arm-linux-gnu*')
+ libdir = dirs[0] if dirs && File.directory?(dirs[0])
+ else
+ libdir = '/lib32' if File.directory? '/lib32'
+ end
when 8
# 64-bit ruby
libdir = '/lib64' if File.directory? '/lib64'
@@ -104,6 +113,9 @@ libm_so = nil if !libm_so || (libm_so[0] == ?/ && !File.file?(libm_so))
if !libc_so || !libm_so
ruby = EnvUtil.rubybin
+ # When the ruby binary is 32-bit and the host is 64-bit,
+ # `ldd ruby` outputs "not a dynamic executable" message.
+ # libc_so and libm_so are not set.
ldd = `ldd #{ruby}`
#puts ldd
libc_so = $& if !libc_so && %r{/\S*/libc\.so\S*} =~ ldd