We only include them where we actually need them and only on linux.
Signed-off-by: Ulf Hermann <ulf.hermann@qt.io>
+2017-04-20 Ulf Hermann <ulf.hermann@qt.io>
+
+ * aarch64_initreg.c: Compile register initialization only on linux.
+ * arm_initreg.c: Likewise.
+ * ppc_initreg.c: Likewise.
+ * s390_initreg.c: Likewise.
+ * x86_64_initreg.c: Likewise.
+
2017-02-15 Mark Wielaard <mark@klomp.org>
* ppc64_init.c (ppc64_init): Add check_object_attribute HOOK.
#include "system.h"
#include <assert.h>
-#ifdef __aarch64__
+#if defined(__aarch64__) && defined(__linux__)
# include <linux/uio.h>
# include <sys/user.h>
# include <sys/ptrace.h>
ebl_tid_registers_t *setfunc __attribute__ ((unused)),
void *arg __attribute__ ((unused)))
{
-#ifndef __aarch64__
+#if !defined(__aarch64__) || !defined(__linux__)
return false;
#else /* __aarch64__ */
# include <config.h>
#endif
+#ifdef __linux__
#if defined __arm__
# include <sys/types.h>
# include <sys/user.h>
# define user_regs_struct user_pt_regs
# endif
#endif
+#endif
#define BACKEND arm_
#include "libebl_CPU.h"
ebl_tid_registers_t *setfunc __attribute__ ((unused)),
void *arg __attribute__ ((unused)))
{
-#if !defined __arm__ && !defined __aarch64__
+#if !defined(__linux__) || (!defined __arm__ && !defined __aarch64__)
return false;
#else /* __arm__ || __aarch64__ */
#if defined __arm__
#include "system.h"
#include <stdlib.h>
-#ifdef __powerpc__
+#if defined(__powerpc__) && defined(__linux__)
# include <sys/user.h>
# include <sys/ptrace.h>
#endif
ebl_tid_registers_t *setfunc __attribute__ ((unused)),
void *arg __attribute__ ((unused)))
{
-#ifndef __powerpc__
+#if !defined(__powerpc__) || !defined(__linux__)
return false;
#else /* __powerpc__ */
union
#include "system.h"
#include <assert.h>
-#ifdef __s390__
+#if defined(__s390__) && defined(__linux__)
# include <sys/user.h>
# include <asm/ptrace.h>
# include <sys/ptrace.h>
ebl_tid_registers_t *setfunc __attribute__ ((unused)),
void *arg __attribute__ ((unused)))
{
-#ifndef __s390__
+#if !defined(__s390__) || !defined(__linux__)
return false;
#else /* __s390__ */
struct user user_regs;
#endif
#include <stdlib.h>
-#ifdef __x86_64__
+#if defined(__x86_64__) && defined(__linux__)
# include <sys/user.h>
# include <sys/ptrace.h>
#endif
2017-04-20 Ulf Hermann <ulf.hermann@qt.io>
+ * dwfl_frame.c: Drop unused sys/ptrace.h include.
+ * frame_unwind.c: Likewise.
+ * linux-pid-attach.c: Include sys/ptrace.h and sys/syscall.h only on
+ linux.
+
+2017-04-20 Ulf Hermann <ulf.hermann@qt.io>
+
* linux-kernel-modules.c: Include sys/types.h before fts.h
2017-03-24 Mark Wielaard <mark@klomp.org>
not, see <http://www.gnu.org/licenses/>. */
#include "libdwflP.h"
-#include <sys/ptrace.h>
#include <unistd.h>
/* Set STATE->pc_set from STATE->regs according to the backend. Return true on
#include <stdlib.h>
#include "libdwflP.h"
#include "../libdw/dwarf.h"
-#include <sys/ptrace.h>
#include <system.h>
/* Maximum number of DWARF expression stack slots before returning an error. */
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
-#include <sys/ptrace.h>
#include <sys/wait.h>
#include <dirent.h>
-#include <sys/syscall.h>
#include <unistd.h>
#ifdef __linux__
+#include <sys/ptrace.h>
+#include <sys/syscall.h>
+
static bool
linux_proc_pid_is_stopped (pid_t pid)
{
+2017-04-20 Ulf Hermann <ulf.hermann@qt.io>
+
+ * backtrace-child.c: Include sys/ptrace.h only on linux.
+ * backtrace-dwarf.c: Likewise.
+
2017-04-05 Mark Wielaard <mark@klomp.org>
* test-subr.sh (testrun_on_self_compressed): New function.
#include <stdlib.h>
#include <signal.h>
#include <errno.h>
-#include <sys/ptrace.h>
#include <string.h>
#include <pthread.h>
#include <stdio.h>
}
#else /* __linux__ */
+#include <sys/ptrace.h>
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
#define NOINLINE_NOCLONE __attribute__ ((noinline, noclone))
#include <errno.h>
#include <error.h>
#include <unistd.h>
-#include <sys/ptrace.h>
#include <sys/types.h>
#include <sys/wait.h>
#include ELFUTILS_HEADER(dwfl)
}
#else /* __linux__ */
+#include <sys/ptrace.h>
#define main cleanup_13_main
#include "cleanup-13.c"