diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2017-04-20 15:37:04 +0200 |
---|---|---|
committer | Mark Wielaard <mark@klomp.org> | 2017-04-26 00:10:52 +0200 |
commit | 9c1509abe9f3934746b04eff8d91f6f9d181f41d (patch) | |
tree | 668ed5b830860d4c077f332514f22326993af15d /backends | |
parent | 5dd27ffbb374b90741fb854de3e02708ffda643f (diff) |
Clean up linux-specific system includes
We only include them where we actually need them and only on linux.
Signed-off-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'backends')
-rw-r--r-- | backends/ChangeLog | 8 | ||||
-rw-r--r-- | backends/aarch64_initreg.c | 4 | ||||
-rw-r--r-- | backends/arm_initreg.c | 4 | ||||
-rw-r--r-- | backends/ppc_initreg.c | 4 | ||||
-rw-r--r-- | backends/s390_initreg.c | 4 | ||||
-rw-r--r-- | backends/x86_64_initreg.c | 2 |
6 files changed, 18 insertions, 8 deletions
diff --git a/backends/ChangeLog b/backends/ChangeLog index 39390cb8..c6e0e08b 100644 --- a/backends/ChangeLog +++ b/backends/ChangeLog @@ -1,3 +1,11 @@ +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. diff --git a/backends/aarch64_initreg.c b/backends/aarch64_initreg.c index 9706205e..daf6f375 100644 --- a/backends/aarch64_initreg.c +++ b/backends/aarch64_initreg.c @@ -32,7 +32,7 @@ #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> @@ -51,7 +51,7 @@ aarch64_set_initial_registers_tid (pid_t tid __attribute__ ((unused)), ebl_tid_registers_t *setfunc __attribute__ ((unused)), void *arg __attribute__ ((unused))) { -#ifndef __aarch64__ +#if !defined(__aarch64__) || !defined(__linux__) return false; #else /* __aarch64__ */ diff --git a/backends/arm_initreg.c b/backends/arm_initreg.c index a0a9be94..efcabaf6 100644 --- a/backends/arm_initreg.c +++ b/backends/arm_initreg.c @@ -30,6 +30,7 @@ # include <config.h> #endif +#ifdef __linux__ #if defined __arm__ # include <sys/types.h> # include <sys/user.h> @@ -45,6 +46,7 @@ # define user_regs_struct user_pt_regs # endif #endif +#endif #define BACKEND arm_ #include "libebl_CPU.h" @@ -54,7 +56,7 @@ arm_set_initial_registers_tid (pid_t tid __attribute__ ((unused)), 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__ diff --git a/backends/ppc_initreg.c b/backends/ppc_initreg.c index 64f53793..69d623b9 100644 --- a/backends/ppc_initreg.c +++ b/backends/ppc_initreg.c @@ -32,7 +32,7 @@ #include "system.h" #include <stdlib.h> -#ifdef __powerpc__ +#if defined(__powerpc__) && defined(__linux__) # include <sys/user.h> # include <sys/ptrace.h> #endif @@ -70,7 +70,7 @@ ppc_set_initial_registers_tid (pid_t tid __attribute__ ((unused)), ebl_tid_registers_t *setfunc __attribute__ ((unused)), void *arg __attribute__ ((unused))) { -#ifndef __powerpc__ +#if !defined(__powerpc__) || !defined(__linux__) return false; #else /* __powerpc__ */ union diff --git a/backends/s390_initreg.c b/backends/s390_initreg.c index b4c4b67c..011305ce 100644 --- a/backends/s390_initreg.c +++ b/backends/s390_initreg.c @@ -32,7 +32,7 @@ #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> @@ -46,7 +46,7 @@ s390_set_initial_registers_tid (pid_t tid __attribute__ ((unused)), 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; diff --git a/backends/x86_64_initreg.c b/backends/x86_64_initreg.c index db9216ed..50e90020 100644 --- a/backends/x86_64_initreg.c +++ b/backends/x86_64_initreg.c @@ -31,7 +31,7 @@ #endif #include <stdlib.h> -#ifdef __x86_64__ +#if defined(__x86_64__) && defined(__linux__) # include <sys/user.h> # include <sys/ptrace.h> #endif |