Bug 2045797 - libffi: FTBFS in Fedora rawhide/f36 on ppc64le
Summary: libffi: FTBFS in Fedora rawhide/f36 on ppc64le
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: libffi
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Carlos O'Donell
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PPCTracker F36FTBFS 2046865
TreeView+ depends on / blocked
 
Reported: 2022-01-25 18:35 UTC by Fedora Release Engineering
Modified: 2022-01-31 13:37 UTC (History)
11 users (show)

Fixed In Version: libffi-3.4.2-8.fc36
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-01-31 13:37:50 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
build.log (32.00 KB, text/plain)
2022-01-25 18:35 UTC, Fedora Release Engineering
no flags Details
root.log (32.00 KB, text/plain)
2022-01-25 18:35 UTC, Fedora Release Engineering
no flags Details
state.log (960 bytes, text/plain)
2022-01-25 18:35 UTC, Fedora Release Engineering
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Github libffi libffi pull 689 0 None open powerpc64: fix handling of homogeneous float128 structs 2022-01-31 09:35:42 UTC

Description Fedora Release Engineering 2022-01-25 18:35:04 UTC
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/

Comment 1 Fedora Release Engineering 2022-01-25 18:35:07 UTC
Created attachment 1855217 [details]
build.log

file build.log too big, will only attach last 32768 bytes

Comment 2 Fedora Release Engineering 2022-01-25 18:35:08 UTC
Created attachment 1855218 [details]
root.log

file root.log too big, will only attach last 32768 bytes

Comment 3 Fedora Release Engineering 2022-01-25 18:35:10 UTC
Created attachment 1855219 [details]
state.log

Comment 4 Dan Horák 2022-01-27 11:27:18 UTC
the IEEE long double change broke it if I see right

Comment 5 Dan Horák 2022-01-27 16:11:34 UTC
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

Comment 6 Dan Horák 2022-01-28 12:46:07 UTC
When running the cls_align_longdouble_split test case under gdb, it looks to me like it would be rather miscompiled than anything else ...

Comment 7 Dan Horák 2022-01-28 20:47:14 UTC
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.

Comment 8 Dan Horák 2022-01-28 22:57:04 UTC
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)

Comment 9 Dan Horák 2022-01-31 09:35:23 UTC
fix proposed in https://github.com/libffi/libffi/pull/689

Comment 10 Dan Horák 2022-01-31 09:44:10 UTC
opened a PR in https://src.fedoraproject.org/rpms/libffi/pull-request/6


Note You need to log in before you can comment on or make changes to this bug.