libffi failed to build from source in Fedora rawhide/f36 https://koji.fedoraproject.org/koji/taskinfo?taskID=81787005 For details on the mass rebuild see: https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild Please fix libffi at your earliest convenience and set the bug's status to ASSIGNED when you start fixing it. If the bug remains in NEW state for 8 weeks, libffi will be orphaned. Before branching of Fedora 37, libffi will be retired, if it still fails to build. For more details on the FTBFS policy, please visit: https://docs.fedoraproject.org/en-US/fesco/Fails_to_build_from_source_Fails_to_install/
Created attachment 1855217 [details] build.log file build.log too big, will only attach last 32768 bytes
Created attachment 1855218 [details] root.log file root.log too big, will only attach last 32768 bytes
Created attachment 1855219 [details] state.log
the IEEE long double change broke it if I see right
this is the output for the failed tests: Executing on host: gcc ../../testsuite/libffi.closures/cls_align_longdouble_split.c -W -Wall -Wno-psabi -O0 -I/home/sharkcz/libffi/libffi-3.4.2/powerpc64le-redhat-linux-gnu/testsuite/../ include -I../../testsuite/../include -I/home/sharkcz/libffi/libffi-3.4.2/powerpc64le-redhat-linux-gnu/testsuite/../include/.. -L/home/sharkcz/libffi/libffi-3.4.2/powerpc64le-redhat-linux-gn u/testsuite/../.libs -lffi -lm -o ./cls_align_longdouble_split.exe (timeout = 300) spawn -ignore SIGHUP gcc ../../testsuite/libffi.closures/cls_align_longdouble_split.c -W -Wall -Wno-psabi -O0 -I/home/sharkcz/libffi/libffi-3.4.2/powerpc64le-redhat-linux-gnu/testsuite/../in clude -I../../testsuite/../include -I/home/sharkcz/libffi/libffi-3.4.2/powerpc64le-redhat-linux-gnu/testsuite/../include/.. -L/home/sharkcz/libffi/libffi-3.4.2/powerpc64le-redhat-linux-gnu/t estsuite/../.libs -lffi -lm -o ./cls_align_longdouble_split.exe PASS: libffi.closures/cls_align_longdouble_split.c -W -Wall -Wno-psabi -O0 (test for excess errors) Setting LD_LIBRARY_PATH to .::/home/sharkcz/libffi/libffi-3.4.2/powerpc64le-redhat-linux-gnu/testsuite/../.libs:.::/home/sharkcz/libffi/libffi-3.4.2/powerpc64le-redhat-linux-gnu/testsuite/.. /.libs Execution timeout is: 300 spawn [open ...] 1 1 1 1 1 1 1 8 8 8 8 8 8 9: 9 9 9 9 9 9 10 res: 9 9 9 9 9 9 10 1 2 3 4 5 6 7 8 9 10 11 12 13 14: 9 11 13 15 17 19 21 res: 9 11 13 15 17 19 21 PASS: libffi.closures/cls_align_longdouble_split.c -W -Wall -Wno-psabi -O0 execution test FAIL: libffi.closures/cls_align_longdouble_split.c -W -Wall -Wno-psabi -O0 output pattern test Output was: 1 1 1 1 1 1 1 8 8 8 8 8 8 9: 9 9 9 9 9 9 10 res: 9 9 9 9 9 9 10 1 2 3 4 5 6 7 8 9 10 11 12 13 14: 9 11 13 15 17 19 21 res: 9 11 13 15 17 19 21 Should match: 1 2 3 4 5 6 7 8 9 10 11 12 13 14: 9 11 13 15 17 19 21^M? res: 9 11 13 15 17 19 21^M? 1 2 3 4 5 6 7 8 9 10 11 12 13 14: 9 11 13 15 17 19 21^M? res: 9 11 13 15 17 19 21 Executing on host: gcc ../../testsuite/libffi.closures/cls_align_longdouble_split.c -W -Wall -Wno-psabi -O2 -I/home/sharkcz/libffi/libffi-3.4.2/powerpc64le-redhat-linux-gnu/testsuite/../include -I../../testsuite/../include -I/home/sharkcz/libffi/libffi-3.4.2/powerpc64le-redhat-linux-gnu/testsuite/../include/.. -L/home/sharkcz/libffi/libffi-3.4.2/powerpc64le-redhat-linux-gnu/testsuite/../.libs -lffi -lm -o ./cls_align_longdouble_split.exe (timeout = 300) spawn -ignore SIGHUP gcc ../../testsuite/libffi.closures/cls_align_longdouble_split.c -W -Wall -Wno-psabi -O2 -I/home/sharkcz/libffi/libffi-3.4.2/powerpc64le-redhat-linux-gnu/testsuite/../include -I../../testsuite/../include -I/home/sharkcz/libffi/libffi-3.4.2/powerpc64le-redhat-linux-gnu/testsuite/../include/.. -L/home/sharkcz/libffi/libffi-3.4.2/powerpc64le-redhat-linux-gnu/testsuite/../.libs -lffi -lm -o ./cls_align_longdouble_split.exe PASS: libffi.closures/cls_align_longdouble_split.c -W -Wall -Wno-psabi -O2 (test for excess errors) Setting LD_LIBRARY_PATH to .::/home/sharkcz/libffi/libffi-3.4.2/powerpc64le-redhat-linux-gnu/testsuite/../.libs:.::/home/sharkcz/libffi/libffi-3.4.2/powerpc64le-redhat-linux-gnu/testsuite/../.libs Execution timeout is: 300 spawn [open ...] 1 1 1 1 1 1 1 8 8 8 8 8 8 9: 9 9 9 9 9 9 10 res: 9 9 9 9 9 9 10 1 2 3 4 5 6 7 8 9 10 11 12 13 14: 9 11 13 15 17 19 21 res: 9 11 13 15 17 19 21 PASS: libffi.closures/cls_align_longdouble_split.c -W -Wall -Wno-psabi -O2 execution test FAIL: libffi.closures/cls_align_longdouble_split.c -W -Wall -Wno-psabi -O2 output pattern test Output was: 1 1 1 1 1 1 1 8 8 8 8 8 8 9: 9 9 9 9 9 9 10 res: 9 9 9 9 9 9 10 1 2 3 4 5 6 7 8 9 10 11 12 13 14: 9 11 13 15 17 19 21 res: 9 11 13 15 17 19 21 Should match: 1 2 3 4 5 6 7 8 9 10 11 12 13 14: 9 11 13 15 17 19 21^M? res: 9 11 13 15 17 19 21^M? 1 2 3 4 5 6 7 8 9 10 11 12 13 14: 9 11 13 15 17 19 21^M? res: 9 11 13 15 17 19 21
When running the cls_align_longdouble_split test case under gdb, it looks to me like it would be rather miscompiled than anything else ...
After further investigation it looks to me that handling of homogeneous structs in ffi_prep_args64() is wrong, around https://github.com/libffi/libffi/blob/master/src/powerpc/ffi_linux64.c#L663 It corresponds to the test results, the only difference between the cls_align_longdouble_split and cls_align_longdouble_split2 tests is that the second uses a non-homogeneous struct (long doubles + double), while the first is all long doubles.
I think I got it, it was copying always only the first member into the vector register space diff -up libffi-3.4.2/src/powerpc/ffi_linux64.c.orig libffi-3.4.2/src/powerpc/ffi_linux64.c --- libffi-3.4.2/src/powerpc/ffi_linux64.c.orig 2022-01-28 22:48:02.196808564 +0000 +++ libffi-3.4.2/src/powerpc/ffi_linux64.c 2022-01-28 22:48:07.076869642 +0000 @@ -680,7 +680,7 @@ ffi_prep_args64 (extended_cif *ecif, uns { if (vecarg_count < NUM_VEC_ARG_REGISTERS64 && i < nfixedargs) - memcpy (vec_base.f128++, arg.f128, sizeof (float128)); + memcpy (vec_base.f128++, arg.f128++, sizeof (float128)); else memcpy (next_arg.f128, arg.f128++, sizeof (float128)); if (++next_arg.f128 == gpr_end.f128)
fix proposed in https://github.com/libffi/libffi/pull/689
opened a PR in https://src.fedoraproject.org/rpms/libffi/pull-request/6