build: Add include check on syscall.h
PATCH 1/1 build: Add include check on syscall.h
The LTTng tracing backend includes the system's "syscall.h", but QEMU replaces it with its own for linux-user builds. This results in a double include on some targets (when LTTng is enabled).
--- linux-user/aarch64/syscall.h | 5 +++++ linux-user/alpha/syscall.h | 5 +++++ linux-user/arm/syscall.h | 4 ++++ linux-user/i386/syscall.h | 5 +++++ linux-user/m68k/syscall.h | 4 ++++ linux-user/mips/syscall.h | 4 ++++ linux-user/mips64/syscall.h | 4 ++++ linux-user/openrisc/syscall.h | 5 +++++ linux-user/ppc/syscall.h | 5 +++++ linux-user/s390x/syscall.h | 5 +++++ linux-user/sh4/syscall.h | 5 +++++ linux-user/sparc/syscall.h | 5 +++++ linux-user/sparc64/syscall.h | 5 +++++ linux-user/x86_64/syscall.h | 5 +++++ 14 files changed, 66 insertions(+)
linux-user/aarch64/syscall.h +5 -0
@@ -1,3 +1,6 @@ +#ifndef SYSCALL_H +#define SYSCALL_H + struct target_pt_regs { uint64_t regs[31]; uint64_t sp;
@@ -11,3 +14,5 @@ struct target_pt_regs {#define TARGET_MINSIGSTKSZ 2048#define TARGET_MLOCKALL_MCL_CURRENT 1#define TARGET_MLOCKALL_MCL_FUTURE 2 + +#endif /* SYSCALL_H */
linux-user/alpha/syscall.h +5 -0
@@ -1,3 +1,6 @@ +#ifndef SYSCALL_H +#define SYSCALL_H +/* default linux values for the selectors */ #define __USER_DS (1)
@@ -255,3 +258,5 @@ struct target_pt_regs {#define TARGET_MINSIGSTKSZ 4096#define TARGET_MLOCKALL_MCL_CURRENT 0x2000#define TARGET_MLOCKALL_MCL_FUTURE 0x4000 + +#endif /* SYSCALL_H */
linux-user/arm/syscall.h +4 -0
@@ -1,3 +1,5 @@ +#ifndef SYSCALL_H +#define SYSCALL_H /* this struct defines the way the registers are stored on the stack during a system call. */
@@ -48,3 +50,5 @@ struct target_pt_regs {#define TARGET_MINSIGSTKSZ 2048#define TARGET_MLOCKALL_MCL_CURRENT 1#define TARGET_MLOCKALL_MCL_FUTURE 2 + +#endif /* SYSCALL_H */
linux-user/i386/syscall.h +5 -0
@@ -1,3 +1,6 @@ +#ifndef SYSCALL_H +#define SYSCALL_H +/* default linux values for the selectors */ #define __USER_CS (0x23)#define __USER_DS (0x2B)
@@ -150,3 +153,5 @@ struct target_vm86plus_struct {#define TARGET_MINSIGSTKSZ 2048#define TARGET_MLOCKALL_MCL_CURRENT 1#define TARGET_MLOCKALL_MCL_FUTURE 2 + +#endif /* SYSCALL_H */
linux-user/m68k/syscall.h +4 -0
@@ -1,3 +1,5 @@ +#ifndef SYSCALL_H +#define SYSCALL_H /* this struct defines the way the registers are stored on the stack during a system call. */
@@ -23,3 +25,5 @@ struct target_pt_regs {#define TARGET_MLOCKALL_MCL_FUTURE 2void do_m68k_simcall (CPUM68KState *,int ); + +#endif /* SYSCALL_H */
linux-user/mips/syscall.h +4 -0
@@ -1,3 +1,5 @@ +#ifndef SYSCALL_H +#define SYSCALL_H /* this struct defines the way the registers are stored on the stack during a system call. */
@@ -231,3 +233,5 @@ struct target_pt_regs {#define TARGET_MINSIGSTKSZ 2048#define TARGET_MLOCKALL_MCL_CURRENT 1#define TARGET_MLOCKALL_MCL_FUTURE 2 + +#endif /* SYSCALL_H */
linux-user/mips64/syscall.h +4 -0
@@ -1,3 +1,5 @@ +#ifndef SYSCALL_H +#define SYSCALL_H /* this struct defines the way the registers are stored on the stack during a system call. */
@@ -228,3 +230,5 @@ struct target_pt_regs {#define TARGET_MINSIGSTKSZ 2048#define TARGET_MLOCKALL_MCL_CURRENT 1#define TARGET_MLOCKALL_MCL_FUTURE 2 + +#endif /* SYSCALL_H */
linux-user/openrisc/syscall.h +5 -0
@@ -1,3 +1,6 @@ +#ifndef SYSCALL_H +#define SYSCALL_H + struct target_pt_regs { union { struct {
@@ -27,3 +30,5 @@ struct target_pt_regs {#define TARGET_MINSIGSTKSZ 2048#define TARGET_MLOCKALL_MCL_CURRENT 1#define TARGET_MLOCKALL_MCL_FUTURE 2 + +#endif /* SYSCALL_H */
linux-user/ppc/syscall.h +5 -0
@@ -17,6 +17,9 @@* License along with this library; if not, see <http://www.gnu.org/licenses/>. */ +#ifndef SYSCALL_H +#define SYSCALL_H +/* XXX: ABSOLUTELY BUGGY: * for now, this is quite just a cut-and-paste from i386 target... */
@@ -73,3 +76,5 @@ struct target_revectored_struct {#define TARGET_MINSIGSTKSZ 2048#define TARGET_MLOCKALL_MCL_CURRENT 0x2000#define TARGET_MLOCKALL_MCL_FUTURE 0x4000 + +#endif /* SYSCALL_H */
linux-user/s390x/syscall.h +5 -0
@@ -1,3 +1,6 @@ +#ifndef SYSCALL_H +#define SYSCALL_H + /* this typedef defines how a Program Status Word looks like */ typedef struct { abi_ulong mask;
@@ -27,3 +30,5 @@ struct target_pt_regs {#define TARGET_MINSIGSTKSZ 2048#define TARGET_MLOCKALL_MCL_CURRENT 1#define TARGET_MLOCKALL_MCL_FUTURE 2 + +#endif /* SYSCALL_H */
linux-user/sh4/syscall.h +5 -0
@@ -1,3 +1,6 @@ +#ifndef SYSCALL_H +#define SYSCALL_H + struct target_pt_regs { unsigned long regs[16]; unsigned long pc;
@@ -15,3 +18,5 @@ struct target_pt_regs {#define TARGET_MINSIGSTKSZ 2048#define TARGET_MLOCKALL_MCL_CURRENT 1#define TARGET_MLOCKALL_MCL_FUTURE 2 + +#endif /* SYSCALL_H */
linux-user/sparc/syscall.h +5 -0
@@ -1,3 +1,6 @@ +#ifndef SYSCALL_H +#define SYSCALL_H + struct target_pt_regs { abi_ulong psr; abi_ulong pc;
@@ -18,3 +21,5 @@ struct target_pt_regs {#define TARGET_MINSIGSTKSZ 4096#define TARGET_MLOCKALL_MCL_CURRENT 0x2000#define TARGET_MLOCKALL_MCL_FUTURE 0x4000 + +#endif /* SYSCALL_H */
linux-user/sparc64/syscall.h +5 -0
@@ -1,3 +1,6 @@ +#ifndef SYSCALL_H +#define SYSCALL_H + struct target_pt_regs { abi_ulong u_regs[16]; abi_ulong tstate;
@@ -19,3 +22,5 @@ struct target_pt_regs {#define TARGET_MINSIGSTKSZ 4096#define TARGET_MLOCKALL_MCL_CURRENT 0x2000#define TARGET_MLOCKALL_MCL_FUTURE 0x4000 + +#endif /* SYSCALL_H */
linux-user/x86_64/syscall.h +5 -0
@@ -1,3 +1,6 @@ +#ifndef SYSCALL_H +#define SYSCALL_H +#define __USER_CS (0x33)#define __USER_DS (0x2B)
@@ -100,3 +103,5 @@ struct target_msqid64_ds {#define TARGET_MINSIGSTKSZ 2048#define TARGET_MLOCKALL_MCL_CURRENT 1#define TARGET_MLOCKALL_MCL_FUTURE 2 + +#endif /* SYSCALL_H */
Quoted 5 lines · Lluís Vilanova
The LTTng tracing backend includes the system's "
syscall.h", but QEMU replaces it with its own for linux-user builds. This results in a double include on some targets (when LTTng is enabled).Signed-off-by Lluís Vilanova <[email protected]>
Adding include guards is fine, but it sounds to me like what we should actually do to fix this confusion is rename all the linux-user local headers to target_syscall.h.
thanks
-- PMM
Quoted 10 lines · Peter Maydell
Quoted 5 lines · Lluís Vilanova
The LTTng tracing backend includes the system's "
syscall.h", but QEMU replaces it with its own for linux-user builds. This results in a double include on some targets (when LTTng is enabled).Signed-off-by Lluís Vilanova <[email protected]>Adding include guards is fine, but it sounds to me like what we should actually do to fix this confusion is rename all the linux-user local headers to
target_syscall.h.
Hmmm, I didn't know if using the same name was on purpose or not. If the intention was *not* to override the system's syscall.h, then a rename is the proper solution.
Can you or someone else confirm this?
Thanks,
Lluis
Quoted 8 lines · Lluís Vilanova
Quoted 3 lines · Peter Maydell
Adding include guards is fine, but it sounds to me like what we should actually do to fix this confusion is rename all the linux-user local headers to
target_syscall.h.Hmmm, I didn't know if using the same name was on purpose or not. If the intention was *not* to override the system's
syscall.h, then a rename is the proper solution.
Yes, the intention is absolutely not to override any system header (the constants defined are only relevant to the guest, and if the header got included and overrode the host's syscall.h then nothing would work and it probably wouldn't even compile). It just ended up with the same name by accident.
thanks
-- PMM
Quoted 11 lines · Peter Maydell
Quoted 8 lines · Lluís Vilanova
Quoted 3 lines · Peter Maydell
Adding include guards is fine, but it sounds to me like what we should actually do to fix this confusion is rename all the linux-user local headers to
target_syscall.h.Hmmm, I didn't know if using the same name was on purpose or not. If the intention was *not* to override the system's
syscall.h, then a rename is the proper solution.
Quoted 5 lines
Yes, the intention is absolutely not to override any system header (the constants defined are only relevant to the guest, and if the header got included and overrode the host's
syscall.hthen nothing would work and it probably wouldn't even compile). It just ended up with the same name by accident.
Aha, then I'll resend with the filles renamed.
Cheers,
Lluis