BUG: compilation error on Fedora 38
Compilation of tests/syscall_socketcall fails with the following error:
make[2]: Entering directory '/mnt/tests/CoreOS/audit/Sanity/audit-rules-smoke/audit-testsuite/tests/syscall_socketcall'
cc -g -O0 -Wall -D_GNU_SOURCE -m32 -o conn conn.c
In file included from /usr/include/features.h:527,
from /usr/include/unistd.h:25,
from conn.c:1:
/usr/include/gnu/stubs.h:6:11: fatal error: gnu/stubs-32.h: No such file or directory
6 | # include <gnu/stubs-32.h>
| ^~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [Makefile:8: conn] Error 1
make[2]: Leaving directory '/mnt/tests/CoreOS/audit/Sanity/audit-rules-smoke/audit-testsuite/tests/syscall_socketcall'
In gnu/stubs.h, I have:
/* This file is automatically generated.
This file selects the right generated file of `__stub_FUNCTION' macros
based on the architecture being compiled for. */
#if !defined __x86_64__
# include <gnu/stubs-32.h>
#endif
#if defined __x86_64__ && defined __LP64__
# include <gnu/stubs-64.h>
#endif
#if defined __x86_64__ && defined __ILP32__
# include <gnu/stubs-x32.h>
#endif
The <gnu/stubs-32.h> lib is included if __x86_64__ is not defined. However, this is not available. The reason why x86_64 is undefined, is because we are passing -m32 to the compiler in https://github.com/linux-audit/audit-testsuite/blob/main/tests/syscall_socketcall/Makefile#L8 .
Removing -m32 helps with the compilation, but I think it's there for a reason. Introduced in https://github.com/linux-audit/audit-testsuite/commit/e276b30a63c335f73155cdaac614b700d5f17cea . Any suggestion is appreciated.
Everything compiles fine on my Rawhide (currently F41) based system. On my Rawhide system the stubs-32.h header file is provided by the glibc-devel-2.39.9000-26.fc41.i686 package:
% rpm -qf /usr/include/gnu/stubs-32.h
glibc-devel-2.39.9000-26.fc41.i686
It is worth noting that Fedora 38 has now reached end-of-life status, but if I look at Fedora 39 it appears that i686 builds are still available.
- https://packages.fedoraproject.org/pkgs/glibc/glibc-devel
- https://koji.fedoraproject.org/koji/buildinfo?buildID=2440557