Skip to content

Commit d589d15

Browse files
committed
Set FFI::Platform::GNU_LIBC like MRI on GNU Linux
* This avoids trying /lib64/libc.so (a loader script) which results in an NFI exception (which is rescued in FFI::Library).
1 parent 2b2a7f8 commit d589d15

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/truffle/ffi.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ module Platform
2727
# so we need to break the cycle.
2828
ADDRESS_SIZE = 64
2929
LONG_SIZE = 64
30+
31+
if ::Truffle::Platform.linux?
32+
# Set it so FFI::Library finds the right file directly, like on MRI,
33+
# and does not need to try and fail to load the /lib64/libc.so loader script.
34+
GNU_LIBC = 'libc.so.6'
35+
end
3036
end
3137

3238
TypeDefs = {}

0 commit comments

Comments
 (0)