]> granicus.if.org Git - strace/commit
Fix build for no-MMU targets
authorBaruch Siach <baruch@tkos.co.il>
Tue, 8 Jan 2019 16:36:20 +0000 (18:36 +0200)
committerDmitry V. Levin <ldv@altlinux.org>
Tue, 8 Jan 2019 02:27:18 +0000 (02:27 +0000)
commitf414d9e3bae40e4eb6426a6d414f0ec2265e93ae
treee93a925c1cbb894432a2938758478d4ed5a232d4
parent04512207ac4859630b5f67c994fc77d24d81661b
Fix build for no-MMU targets

Commit 7488ce9e23f1 "Check whether PTRACE_GET_SYSCALL_INFO is supported
by the kernel" added a fork() call in test_ptrace_get_syscall_info()
which is included in the main strace executable code.  Although the
test_ptrace_get_syscall_info() routine is not called on no-MMU targets,
the compiler can't optimize it out because it is a global symbol.
So build for no-MMU targets currently fails:

strace-ptrace_syscall_info.o: In function `test_ptrace_get_syscall_info':
ptrace_syscall_info.c:(.text+0x1c): undefined reference to `fork'

* ptrace_syscall_info.c (test_ptrace_get_syscall_info): Make
the definition depend on HAVE_FORK.
* strace.c (init): Call test_ptrace_get_syscall_info unconditionally.
* NEWS: Mention this fix.

Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>
Fixes: v4.26~50 "Check whether PTRACE_GET_SYSCALL_INFO is supported by the kernel"
NEWS
ptrace_syscall_info.c
strace.c