From: Dmitry V. Levin Date: Mon, 18 Jun 2018 22:59:38 +0000 (+0000) Subject: Fix build on systems where libc relies on X-Git-Tag: v4.24~65 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=v4.23-11-g15003d4;p=strace Fix build on systems where libc relies on Commit v4.23~10 has broken the build with Android's libc because it relies on the UAPI headers (such as ) to define various types, rather than copying them into the libc headers (such as ) like most other Linux C libraries. * linux/linux/signal.h: Rename to linux/signal.h.in. * Makefile.am (strace_SOURCES): Remove linux/linux/signal.h. (EXTRA_DIST): Add linux/signal.h.in. (DISTCLEANFILES): Add linux/linux/signal.h. * configure.ac (AC_CACHE_CHECK): Check whether can be used along with , install linux/linux/signal.h workaround if they cannot be used together. Reported-by: Elliott Hughes Closes: https://github.com/strace/strace/issues/72 --- diff --git a/Makefile.am b/Makefile.am index 32593443..5f3f50a7 100644 --- a/Makefile.am +++ b/Makefile.am @@ -182,7 +182,6 @@ strace_SOURCES = \ ldt.c \ link.c \ linux/asm_stat.h \ - linux/linux/signal.h \ linux/x32/asm_stat.h \ linux/x86_64/asm_stat.h \ listen.c \ @@ -804,6 +803,7 @@ EXTRA_DIST = \ linux/sh64/syscallent.h \ linux/sh64/userent.h \ linux/shuffle_scno.c \ + linux/signal.h.in \ linux/signalent.h \ linux/smc_diag.h \ linux/sock_diag.h \ @@ -1042,7 +1042,7 @@ CLEANFILES = $(ioctl_redefs_h) $(ioctlent_h) $(mpers_preproc_files) \ ioctl_iocdef.h ioctl_iocdef.i \ bpf_attr_check.c native_printer_decls.h native_printer_defs.h \ printers.h sen.h sys_func.h -DISTCLEANFILES = gnu/stubs-32.h gnu/stubs-x32.h +DISTCLEANFILES = gnu/stubs-32.h gnu/stubs-x32.h linux/linux/signal.h include scno.am diff --git a/configure.ac b/configure.ac index 9dec1b23..a2170454 100644 --- a/configure.ac +++ b/configure.ac @@ -581,8 +581,22 @@ AC_CHECK_TYPES(m4_normalize([ ]),,, [#include ]) saved_CPPFLAGS="$CPPFLAGS" -CPPFLAGS="$CPPFLAGS -I$srcdir/linux" + +AC_CACHE_CHECK([whether can be used along with ], + [st_cv_linux_signal], + [AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ +#include +#include ]],[])], + [st_cv_linux_signal=yes], + [st_cv_linux_signal=no])]) +if test "x$st_cv_linux_signal" = xno; then + mkdir -p linux/linux + cp $srcdir/linux/signal.h.in linux/linux/signal.h + CPPFLAGS="$CPPFLAGS -Ilinux" +fi + AC_CHECK_TYPES([struct __aio_sigset],,, [#include ]) + CPPFLAGS="$saved_CPPFLAGS" AC_CHECK_HEADERS([linux/btrfs.h], [ diff --git a/linux/linux/signal.h b/linux/signal.h.in similarity index 100% rename from linux/linux/signal.h rename to linux/signal.h.in