Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compilation due to syscall module name conflict #244

Merged
merged 2 commits into from
Dec 22, 2023
Merged

Fix compilation due to syscall module name conflict #244

merged 2 commits into from
Dec 22, 2023

Conversation

keytouch
Copy link
Contributor

Rename sys_call_table to _sys_call_table to fix compile error
sys_call_table is already declared in arch/x86/include/asm/syscall.h but of cource not exported by the kernel.

/usr/src/linux-headers-6.1.0-16-common/arch/x86/include/asm/syscall.h:21:29:
note: previous declaration of 'sys_call_table' with type 'long int (*
const[])(const struct pt_regs *)'
   21 | extern const sys_call_ptr_t sys_call_table[];

And rename syscall module name to syscall_steal because In Debian, the name syscall conflicts with the patch debian/patches/features/x86/x86-make-x32-syscall-support-conditional.patch

@jserv jserv requested a review from linD026 December 22, 2023 04:28
examples/syscall_steal.c Show resolved Hide resolved
examples/syscall_steal.c Outdated Show resolved Hide resolved
In Debian, the name syscall conflicts with this patch:
in debian kernel source tree:
debian/patches/features/x86/x86-make-x32-syscall-support-conditional.patch
mailing list url:
https://lore.kernel.org/lkml/1415245982.3398.53.camel@decadent.org.uk/T/#u
which introduces a parameter named syscall.x32. So change our name.
sys_call_table is already declared in arch/x86/include/asm/syscall.h but of
cource not exported by the kernel.
before this commit, gcc complains as follows:
/usr/src/linux-headers-6.1.0-16-common/arch/x86/include/asm/syscall.h:21:29:
note: previous declaration of 'sys_call_table' with type 'long int (*
const[])(const struct pt_regs *)'
   21 | extern const sys_call_ptr_t sys_call_table[];
@jserv jserv changed the title Rename sys_call_table to _sys_call_table to fix compile error and rename syscall module name to syscall_steal Fix compilation due to syscall module name conflict Dec 22, 2023
@jserv jserv merged commit 7f94878 into sysprog21:master Dec 22, 2023
1 check passed
@jserv
Copy link
Contributor

jserv commented Dec 22, 2023

Thank @keytouch for contributing!

@keytouch keytouch deleted the fix_syscall branch December 22, 2023 13:18
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.

3 participants