[Toybox] [PATCH] strace: fix m68k build.

Rob Landley rob at landley.net
Fri Dec 3 04:16:00 PST 2021


On 12/1/21 5:23 PM, enh via Toybox wrote:
> ---
>  toys/pending/strace.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied, but the real problem is that different targets have different syscalls
in their headers, and the C() macros build break if a given syscall isn't there.

I posted about the start of automating syscall/ioctl harvesting from headers,
and have a TODO item to see if the kernel's trick can be adapted here:

#define __ARG_PLACEHOLDER_1 0,
#define __take_second_arg(__ignored, val, ...) val
#define __is_defined(x)                 ___is_defined(x)
#define ___is_defined(val)              ____is_defined(__ARG_PLACEHOLDER_##val)
#define ____is_defined(arg1_or_junk)    __take_second_arg(arg1_or_junk 1, 0)
#define IS_BUILTIN(option) __is_defined(option)

Unfortunately getting it to resolve to itself when #defined and nothing when not
defined (basically a generic macro version if #ifdef) is tricksy, and so far
hitting the headers with sed to make something to #include at build time looks
like a more promising approach...

Rob



More information about the Toybox mailing list