| Summary: | dev-libs/libffi-3.3-r2 fails test libffi.complex/cls_align_complex_float.c on /bin/sh - dash. | ||
|---|---|---|---|
| Product: | Gentoo Linux | Reporter: | Paolo Pedroni <paolo.pedroni> |
| Component: | Current packages | Assignee: | Gentoo Toolchain Maintainers <toolchain> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | jstein |
| Priority: | Normal | Keywords: | TESTFAILURE |
| Version: | unspecified | ||
| Hardware: | All | ||
| OS: | Linux | ||
| URL: | https://github.com/libffi/libffi/pull/594 | ||
| Whiteboard: | |||
| Package list: | Runtime testing required: | --- | |
| Attachments: |
libffi-3.3-r2:20201106-101601.log.gz
libffi.log libffi.sum config.log |
||
|
Description
Paolo Pedroni
2020-11-06 10:26:43 UTC
1. Is it a failure that happens every time you run testsuite? 2. Does it fail for you without -march=amdfam10 in compiler flags? (In reply to Sergei Trofimovich from comment #1) > 1. Is it a failure that happens every time you run testsuite? Yes, every single time. > 2. Does it fail for you without -march=amdfam10 in compiler flags? No idea, but it happens also on my other system with -march=skylake (In reply to Paolo Pedroni from comment #2) > > 2. Does it fail for you without -march=amdfam10 in compiler flags? > > No idea, but it happens also on my other system with -march=skylake Can you try it? Something like: # CFLAGS="-O2 -pipe -frecord-gcc-switches -flto=7" \ CXXFLAGS="-O2 -pipe -frecord-gcc-switches -flto=7" \ LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu -Wl,--sort-common -flto=7 -fno-lto" \ emerge -v1 libffi On a coffeelake machine I tried the following and it did not exhibit failures:
# CFLAGS="-O2 -pipe -frecord-gcc-switches -flto=7 -march=skylake" CXXFLAGS="-O2 -pipe -frecord-gcc-switches -flto=7 -march=skylake" LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu -Wl,--sort-common -flto=7" MAKEOPTS='-j9 RUNTESTFLAGS="complex.exp"' PORTAGE_TMPDIR=/tmp/p ebuild /usr/portage/dev-libs/libffi/libffi-3.3-r2.ebuild clean test
Can you attach both libffi.sum and libffi.log from a $WORKDIR after test failures? Created attachment 670727 [details] libffi.log (In reply to Sergei Trofimovich from comment #3) > (In reply to Paolo Pedroni from comment #2) > Can you try it? Something like: > > # CFLAGS="-O2 -pipe -frecord-gcc-switches -flto=7" \ > CXXFLAGS="-O2 -pipe -frecord-gcc-switches -flto=7" \ > LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu > -Wl,--sort-common -flto=7 -fno-lto" \ > emerge -v1 libffi Still failing. :-/ Attaching requested files. Created attachment 670730 [details]
libffi.sum
I can confirm the same test failure on the SkyLake i5 with and without -march=skylake in CFLAGS and CXXFLAGS Aha, the log is useful. .sum file reports that test run was successful:
FAIL: libffi.complex/cls_align_complex_float.c (test for excess errors)
PASS: libffi.complex/cls_align_complex_float.c execution test
but the generated warnings were unexpected:
"""
Executing on host: x86_64-pc-linux-gnu-gcc /var/tmp/portage/dev-libs/libffi-3.3-r2/work/libffi-3.3/testsuite/libffi.complex/cls_align_complex_float.c -I/var/tmp/portage/dev-libs/libffi-3.3-r2/work/libffi-3.3-abi_x86_64.amd64/testsuite/../include -I/var/tmp/portage/dev-libs/libffi-3.3-r2/work/libffi-3.3/testsuite/../include -I/var/tmp/portage/dev-libs/libffi-3.3-r2/work/libffi-3.3-abi_x86_64.amd64/testsuite/../include/.. -L/var/tmp/portage/dev-libs/libffi-3.3-r2/work/libffi-3.3-abi_x86_64.amd64/testsuite/../.libs -lffi -lm -o ./cls_align_complex_float.exe (timeout = 300)
spawn -ignore SIGHUP x86_64-pc-linux-gnu-gcc /var/tmp/portage/dev-libs/libffi-3.3-r2/work/libffi-3.3/testsuite/libffi.complex/cls_align_complex_float.c -I/var/tmp/portage/dev-libs/libffi-3.3-r2/work/libffi-3.3-abi_x86_64.amd64/testsuite/../include -I/var/tmp/portage/dev-libs/libffi-3.3-r2/work/libffi-3.3/testsuite/../include -I/var/tmp/portage/dev-libs/libffi-3.3-r2/work/libffi-3.3-abi_x86_64.amd64/testsuite/../include/.. -L/var/tmp/portage/dev-libs/libffi-3.3-r2/work/libffi-3.3-abi_x86_64.amd64/testsuite/../.libs -lffi -lm -o ./cls_align_complex_float.exe
In file included from /var/tmp/portage/dev-libs/libffi-3.3-r2/work/libffi-3.3/testsuite/libffi.complex/cls_align_complex_float.c:10:
/var/tmp/portage/dev-libs/libffi-3.3-r2/work/libffi-3.3/testsuite/libffi.complex/cls_align_complex.inc: In function ‘cls_struct_align_fn’:
/var/tmp/portage/dev-libs/libffi-3.3-r2/work/libffi-3.3/testsuite/libffi.complex/cls_align_complex.inc:13:1: note: the ABI of passing structure with complex float member has changed in GCC 4.4
13 | {
| ^
FAIL: libffi.complex/cls_align_complex_float.c (test for excess errors)
Excess errors:
In file included from /var/tmp/portage/dev-libs/libffi-3.3-r2/work/libffi-3.3/testsuite/libffi.complex/cls_align_complex_float.c:10:
/var/tmp/portage/dev-libs/libffi-3.3-r2/work/libffi-3.3/testsuite/libffi.complex/cls_align_complex.inc: In function ‘cls_struct_align_fn’:
/var/tmp/portage/dev-libs/libffi-3.3-r2/work/libffi-3.3/testsuite/libffi.complex/cls_align_complex.inc:13:1: note: the ABI of passing structure with complex float member has changed in GCC 4.4
13 | {
| ^
"""
I think it tells us that warning 'note' not filtered out as insignificant by dejagnu. I'll check if I get the warning and will try to figure out how normally dejagnu ignores those.
For comparison my libffi.log contains extra CFLAGS your build misses: """ x86_64-pc-linux-gnu-gcc /tmp/portage/dev-libs/libffi-3.3-r2/work/libffi-3.3/testsuite/libffi.complex/cls_align_complex_float.c -W -Wall -Wno-psabi -O2 -I/tmp/portage/dev-libs/libffi-3.3-r2/work/libffi-3.3-abi_x86_64.amd64/testsuite/../include -I/tmp/portage/dev-libs/libffi-3.3-r2/work/libffi-3.3/testsuite/../include -I/tmp/portage/dev-libs/libffi-3.3-r2/work/libffi-3.3-abi_x86_64.amd64/testsuite/../include/.. -L/tmp/portage/dev-libs/libffi-3.3-r2/work/libffi-3.3-abi_x86_64.amd64/testsuite/../.libs -lffi -lm -o ./cls_align_complex_float.exe """ -Wno-psabi would inhibit the warning, but lack of -O2 is also concerning. That means the test coverage lacks optimised code. Let's see where your build decided to ignore the flags. -Wno-psabi is set in testsuite/lib/libffi.exp as:
proc run-many-tests { testcases extra_flags } {
global compiler_vendor
global env
switch $compiler_vendor {
...
"gnu" {
set common "-W -Wall -Wno-psabi"
...
}
default {
...
set optimizations { "" }
}
}
...
$compiler_vendor is set in testsuite/lib/libffi.exp as:
testsuite/lib/libffi.exp: set tmp [grep "$blddirffi/config.log" "^ax_cv_c_compiler_vendor.*$"]
regexp -- {^[^=]*=(.*)$} $tmp nil compiler_vendor
m4/ax_compiler_vendor.m4 defines compiler vendor definition is long but straightforward. I wonder what vendor was detected for you.
Can you upload 'config.log' from ${WORKDIR} as well?
Created attachment 670936 [details] config.log (In reply to Sergei Trofimovich from comment #11) > m4/ax_compiler_vendor.m4 defines compiler vendor definition is long but > straightforward. I wonder what vendor was detected for you. > > Can you upload 'config.log' from ${WORKDIR} as well? Here it is. (In reply to Paolo Pedroni from comment #12) > Here it is. Aha! Your config.log uses single-quote string quotation: ax_cv_c_compiler_vendor='gnu' Mine does not have any: ax_cv_c_compiler_vendor=gnu That explains mis-detection. That is probably because your default shell is dash. Reproduced locally on '/bin/sh -> dash'. The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b64f44870960b1d321a911135687e332ab5d8ac5 commit b64f44870960b1d321a911135687e332ab5d8ac5 Author: Sergei Trofimovich <slyfox@gentoo.org> AuthorDate: 2020-11-11 19:36:51 +0000 Commit: Sergei Trofimovich <slyfox@gentoo.org> CommitDate: 2020-11-11 19:37:12 +0000 dev-libs/libffi: fix vendor detection on 'dash' shell Reported-by: Paolo Pedroni Closes: https://bugs.gentoo.org/753299 Package-Manager: Portage-3.0.9, Repoman-3.0.2 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> .../files/libffi-3.3-compiler-vendor-quote.patch | 33 ++++++++++++++++++++++ dev-libs/libffi/libffi-3.3-r2.ebuild | 1 + 2 files changed, 34 insertions(+) Proposed fix upstream as https://github.com/libffi/libffi/pull/594. |