Skip to content

Add handling for compilation failures of list-syscalls.c#138

Merged
hrw merged 1 commit intohrw:masterfrom
drakenclimber:fix-building-of-list-syscalls
Apr 29, 2026
Merged

Add handling for compilation failures of list-syscalls.c#138
hrw merged 1 commit intohrw:masterfrom
drakenclimber:fix-building-of-list-syscalls

Conversation

@drakenclimber
Copy link
Copy Markdown
Contributor

@drakenclimber drakenclimber commented Apr 29, 2026

Since no error checking was previously being performed on the gcc command that generates the list-syscalls executable, delete the list-syscalls.c and list-syscalls executable between architecture iterations. Also, add an "if succeeded" around the execution of ./list-syscalls to avoid an execution error. Adding these checks ensures that a previous architecture's list-syscalls isn't erroneously used for an architecture that fails to compile.

Without this patch, the previous architecture's (i386's) list-syscalls was erroneously used for x32, and thus the i386 syscalls and syscall numbers were being placed in the x32 table.

This was motivated by trying to compile x32 on a Fedora x86_64 system. The Fedora kernel currently doesn't support x32 [1]. I was unable to find a Fedora userspace package that provides stubs-x32.h, and various internet discussions mention that x32 is not supported by Fedora.

Below is the gcc error when compiling x32 on Fedora that is being suppressed:

In file included from /usr/include/features.h:535,
                 from /usr/include/bits/libc-header-start.h:33,
                 from /usr/include/stdio.h:28,
                 from list-syscalls.c:2:
/usr/include/gnu/stubs.h:13:11: fatal error: gnu/stubs-x32.h: No such file or directory
   13 | # include <gnu/stubs-x32.h>
      |           ^~~~~~~~~~~~~~~~~
compilation terminated.

[1] https://src.fedoraproject.org/rpms/kernel/blob/rawhide/f/kernel-x86_64-fedora.config#_9367

Comment thread scripts/update-tables.sh Outdated
Comment thread scripts/update-tables.sh Outdated
Comment thread scripts/update-tables.sh
@drakenclimber drakenclimber force-pushed the fix-building-of-list-syscalls branch from a3195f4 to 8398079 Compare April 29, 2026 18:22
Since no error checking was previously being performed on the gcc
command that generates the list-syscalls executable, delete the
list-syscalls.c and list-syscalls executable between architecture
iterations. Also, add an "if succeeded" around the execution of
./list-syscalls to avoid an execution error.  Adding these checks
ensures that a previous architecture's list-syscalls isn't
erroneously used for an architecture that fails to compile.

Without this patch, the previous architecture's (i386's)
list-syscalls was erroneously used for x32, and thus the i386
syscalls and syscall numbers were being placed in the x32 table.

This was motivated by trying to compile x32 on a Fedora x86_64
system.  The Fedora kernel currently doesn't support x32 [1].
I was unable to find a Fedora userspace package that provides
stubs-x32.h, and various internet discussions mention that x32
is _not_ supported by Fedora.

Below is the gcc error when compiling x32 on Fedora that is being
suppressed:

In file included from /usr/include/features.h:535,
                 from /usr/include/bits/libc-header-start.h:33,
                 from /usr/include/stdio.h:28,
                 from list-syscalls.c:2:
/usr/include/gnu/stubs.h:13:11: fatal error: gnu/stubs-x32.h: No such file or directory
   13 | # include <gnu/stubs-x32.h>
      |           ^~~~~~~~~~~~~~~~~
compilation terminated.

[1] https://src.fedoraproject.org/rpms/kernel/blob/rawhide/f/kernel-x86_64-fedora.config#_9367

Signed-off-by: Tom Hromatka (Oracle) <tom.hromatka@gmail.com>
@drakenclimber drakenclimber force-pushed the fix-building-of-list-syscalls branch from 8398079 to 57f785c Compare April 29, 2026 18:23
@hrw hrw merged commit e270362 into hrw:master Apr 29, 2026
4 checks passed
@hrw
Copy link
Copy Markdown
Owner

hrw commented Apr 29, 2026

Thanks for changes!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants