SYS_FUNC macro fix for musl

Dmitry V. Levin ldv at altlinux.org
Mon Dec 14 21:35:56 UTC 2015


Hi,

On Mon, Dec 14, 2015 at 09:05:50PM +0100, Szabolcs Nagy wrote:
> currently the syscall_name argument of the SYS_FUNC and
> SEN macros is subject to macro expansion (because it is
> passed to other function-like macros as parameter before
> it is prefixed).
> 
> if lfs64 support is requested (_GNU_SOURCE is defined),
> musl defines lfs64 names as macros like
> 
> 	#define fstat64 fstat
> 
> (there is no easy way around this because both stat64
> function and stat64 struct tag should be redirected to
> plain stat, doing it with proper wrappers would add
> significant boilerplate to the libc).
> 
> so strace fails to build. (sys_fstat64 becomes sys_fstat)
> 
> i'd like to propose a workaround that always prefixes
> the syscall_name before anything is done with it.
> (it seems to me that the code assumes sys_ prefix anyway.)

Looks good.

> --- a/linux/ia64/syscallent.h
> +++ b/linux/ia64/syscallent.h
> @@ -31,10 +31,10 @@
>   * with 64-bit layout get redirected to printargs.
>   */
>  #undef SYS_FUNC_NAME
> -#define SYS_FUNC_NAME(syscall_name) printargs
> +#define SYS_FUNC_NAME(syscall_name) sys_printargs

You don't need this, sys_printargs is a macro defined to printargs.


-- 
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20151215/4c0bad52/attachment.bin>


More information about the Strace-devel mailing list