-
Notifications
You must be signed in to change notification settings - Fork 341
Closed
Description
Updating ffi in Fedora, I observe following issue on 32bit i686:
1) :long_double arguments and return values add two long double numbers
Failure/Error: expect(LibTest.add_f128(0.1, 0.2)).to be_within(0.01).of(0.3)
expected -0.477986771153282950419169851899937876e987 to be within 0.01 of 0.3
# ./spec/ffi/long_double_spec.rb:36:in `block (2 levels) in <top (required)>'
This is partly because the test was enabled in 4aa0a57 1.13.0. Enabling the same test for 1.12.1, it fails similar way, so it has probably never passed.
Here are compilation options (since I guess that some instruction set specifics might be involved):
gcc -I. -I/usr/include -I/usr/include/ruby/backward -I/usr/include -I. -DRUBY_EXTCONF_H=\"extconf.h\" -fPIC -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -m64 -o LongDouble.o -c LongDouble.c
And since there are already similar tests disabled on ARM:
$ ruby -rffi -e 'p FFI::Platform::LONG_DOUBLE_SIZE'
ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [i386-linux]
96
Metadata
Metadata
Assignees
Labels
No labels