PerlFFI / FFI-Platypus

Write Perl bindings to non-Perl libraries with FFI. No XS required.
89 stars 23 forks source link

t/gh323.t fails on s390x platform: Caught exception in subtest: variadic functions are not supported by some combination of your libffi/compiler/platypus at /builddir/build/BUILD/FFI-Platypus-1.50/blib/lib/FFI/Platypus.pm line 323 #342

Closed ppisar closed 3 years ago

ppisar commented 3 years ago

The new t/gh323.t test passes for me on all architectures except for s390x (a 64-bit big endian):

# Failed test 'api => 0'
# at t/gh323.t line 36.
# Caught exception in subtest: variadic functions are not supported by some combination of your libffi/compiler/platypus at /builddir/build/BUILD/FFI-Platypus-1.50/blib/lib/FFI/Platypus.pm line 323.
# Failed test 'api => 1'
# at t/gh323.t line 36.
# Caught exception in subtest: variadic functions are not supported by some combination of your libffi/compiler/platypus at /builddir/build/BUILD/FFI-Platypus-1.50/blib/lib/FFI/Platypus.pm line 323.
# Failed test 'api => 2'
# at t/gh323.t line 36.
# Caught exception in subtest: variadic functions are not supported by some combination of your libffi/compiler/platypus at /builddir/build/BUILD/FFI-Platypus-1.50/blib/lib/FFI/Platypus.pm line 323.
t/gh323.t ................................ 
Dubious, test returned 3 (wstat 768, 0x300)
Failed 3/3 subtests 

I have GCC 11.1.1, libffi 3.1 and perl 5.34.0. I also got the same results with libffi 3.4.2.

A selftest reports "PR probe.variadic=0". Would it be possible to skip the test on systems with probe.variadic=0? Actually I have no idea wehter FFI supports variadic arguments on that platform.

plicease commented 3 years ago

Fixed in 1.05.

libffi without variadic support is a supported configuration so skipping the test is the correct approach. I am not sure about the question re: variadic support on s390x. Since I have no way to develop/test on that platform it is a question for libffi or your own testing. I am happy to adjust the probe if there is an error in the probe.

plicease commented 3 years ago

This is the standalone variadic test for what its worth: https://github.com/PerlFFI/FFI-Platypus/blob/main/inc/probe/variadic.c