[PATCH v2] libsframe: testsuite: Fix testsuite build on Solaris
Rainer Orth
ro@CeBiTec.Uni-Bielefeld.DE
Sun Aug 31 19:15:23 GMT 2025
As reported in PR libsframe/33168, the libsframe tests don't build on
Solaris. The failure is
In file included from libsframe/testsuite/libsframe.decode/be-flipping.c:28:
/usr/include/dejagnu.h:48:1: error: conflicting types for ‘wait’; have ‘void(void)’
48 | wait (void)
| ^~~~
In file included from /usr/include/stdlib.h:16,
from libsframe/testsuite/libsframe.decode/be-flipping.c:21:
/usr/include/sys/wait.h:85:14: note: previous declaration of ‘wait’ with type ‘pid_t(int *)’ {aka ‘long int(int *)’}
85 | extern pid_t wait(int *);
| ^~~~
We have a combination of two factors here:
* Solaris <stdlib.h> has
#if defined(__EXTENSIONS__) || defined(_XPG4)
#include <sys/wait.h>
#endif
and configure.ac predefines __EXTENSIONS__ due to the use of
AC_USE_SYSTEM_EXTENSIONS.
* This conflicts with <dejagnu.h>'s definition
void
wait (void)
{
...
}
While this version of wait was removed in upstream DejaGnu, the removal
only happened after the latest release, 1.6.3.
To avoid this, I've moved all testsuite includes into a new
sframe-test.h, adding a workaround for the wait conflict. I've put that
header into the toplevel include to avoid having to add various -I flags
all over the testsuite.
Tested on {i386,amd64}-pc-solaris2.11, {sparc,sparcv9}-sun-solaris2.11,
{x86_64,i686}-pc-linux-gnu, and amd64-pc-freebsd14.0.
Ok for trunk?
Rainer
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University
2025-08-31 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
include:
PR libsframe/33168
* sframe-test.h: New file.
libsframe:
PR libsframe/33168
* testsuite/sframe-test.h: New file.
* testsuite/libsframe.decode/be-flipping.c: Replace includes by
sframe-test.h.
* testsuite/libsframe.decode/frecnt-1.c: Likewise.
* testsuite/libsframe.decode/frecnt-2.c: Likewise.
* testsuite/libsframe.encode/encode-1.c: Likewise.
* testsuite/libsframe.find/findfre-1.c: Likewise.
* testsuite/libsframe.find/findfunc-1.c: Likewise.
* testsuite/libsframe.find/plt-findfre-1.c: Likewise.
* testsuite/libsframe.find/plt-findfre-2.c: Likewise.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sol2-libsframe-testsuite-dg.patch
Type: text/x-patch
Size: 7315 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20250831/75bb0bda/attachment.bin>
More information about the Binutils
mailing list