ptrace: Fix build problems with glibc-2.18
PATCH 1/1 ptrace: Fix build problems with glibc-2.18
Since glibc-2.18, the struct ptrace_peeksiginfo_args is also defined in sys/ptrace.h and conflicts with the definition from the Linux kernel in linux/ptrace.h. We fix this by not including the linux/ptrace.h header if the sys/ptrace.h header defines the said struct. Fixes
https://github.com/linux-test-project/ltp/issues/6
---
Build tested on glibc-2.17 and glibc-2.18 systems
--- configure.ac | 4 ++++ include/config.h.default | 3 +++ testcases/kernel/syscalls/ptrace/ptrace.h | 4 +++- 3 files changed, 10 insertions(+), 1 deletion(-)
configure.ac +4 -0
@@ -48,6 +48,10 @@ AC_CHECK_HEADERS([ \ sys/prctl.h \ ]) +# glibc-2.18 defines ptrace_peeksiginfo_args in sys/ptrace.h which +# conflicts with the one from linux kernel in linux/ptrace.h +AC_CHECK_TYPES([struct ptrace_peeksiginfo_args],,,[#include <sys/ptrace.h>]) + # Tools knobs # Expect
include/config.h.default +3 -0
@@ -167,6 +167,9 @@ /* Define to 1 if the system has the type `struct modify_ldt_ldt_s'. */ #undef HAVE_STRUCT_MODIFY_LDT_LDT_S +/* Define to 1 if the system has the type `struct ptrace_peeksiginfo_args'. */ +#undef HAVE_STRUCT_PTRACE_PEEKSIGINFO_ARG + /* Define to 1 if `signo' is member of `struct signalfd_siginfo'. */ #undef HAVE_STRUCT_SIGNALFD_SIGINFO_SIGNO
testcases/kernel/syscalls/ptrace/ptrace.h +3 -1
@@ -19,7 +19,9 @@# include <asm/ptrace.h> #endif #ifdef HAVE_LINUX_PTRACE_H -# include <linux/ptrace.h> +# ifndef HAVE_STRUCT_PTRACE_PEEKSIGINFO_ARGS +# include <linux/ptrace.h> +# endif #endif #undef FU_ia64_fpreg#undef FU_pt_all_user_regs
Signature · 14 lines
1.8.4.3 ------------------------------------------------------------------------------ Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk _______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list
Quoted 21 lines · Markos Chandras
Since glibc-2.18, the struct
ptrace_peeksiginfo_argsis also defined insys/ptrace.hand conflicts with the definition from the Linux kernel inlinux/ptrace.h. We fix this by not including thelinux/ptrace.hheader if thesys/ptrace.hheader defines the said struct. Fixes
https://github.com/linux-test-project/ltp/issues/6Signed-off-by Markos Chandras <[email protected]>---
Build tested on glibc-2.17 and glibc-2.18 systems--- configure.ac | 4 ++++ include/config.h.default | 3 +++ testcases/kernel/syscalls/ptrace/ptrace.h | 4 +++- 3 files changed, 10 insertions(+), 1 deletion(-)configure.ac +0
-0
configure.ac AC_CHECK_HEADERS([ \ · line 53
Quoted 6 lines
configure.ac +3
-0@@ -48,6 +48,10 @@ AC_CHECK_HEADERS([ \ sys/prctl.h \ ]) +# glibc-2.18 defines ptrace_peeksiginfo_args in sys/ptrace.h which +# conflicts with the one from linux kernel in linux/ptrace.h +AC_CHECK_TYPES([struct ptrace_peeksiginfo_args],,,[#include <sys/ptrace.h>])
We generally place this like checks to m4/*.
Quoted 9 lines
configure.ac +1
-0+ # Tools knobs # Expectinclude/config.h.default +0
-0
include/config.h.default line 171
Quoted 5 lines
include/config.h.default +2
-0@@ -167,6 +167,9 @@ /* Define to 1 if the system has the type `struct modify_ldt_ldt_s'. */ #undef HAVE_STRUCT_MODIFY_LDT_LDT_S +/* Define to 1 if the system has the type `struct ptrace_peeksiginfo_args'. */ +#undef HAVE_STRUCT_PTRACE_PEEKSIGINFO_ARG
Missed an "S" here?
Thanks,
Wanlong Gao
Quoted 10 lines
include/config.h.default +1
-0+ /* Define to 1 if `signo' is member of `struct signalfd_siginfo'. */ #undef HAVE_STRUCT_SIGNALFD_SIGINFO_SIGNOtestcases/kernel/syscalls/ptrace/ptrace.h +0
-0
testcases/kernel/syscalls/ptrace/ptrace.h line 27
Quoted 10 lines
testcases/kernel/syscalls/ptrace/ptrace.h +3
-1@@ -19,7 +19,9 @@# include <asm/ptrace.h> #endif #ifdef HAVE_LINUX_PTRACE_H -# include <linux/ptrace.h> +# ifndef HAVE_STRUCT_PTRACE_PEEKSIGINFO_ARGS +# include <linux/ptrace.h> +# endif #endif #undef FU_ia64_fpreg#undef FU_pt_all_user_regs
------------------------------------------------------------------------------
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now.
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Quoted 55 lines · Wanlong Gao
Quoted 21 lines · Markos Chandras
Since glibc-2.18, the struct
ptrace_peeksiginfo_argsis also defined insys/ptrace.hand conflicts with the definition from the Linux kernel inlinux/ptrace.h. We fix this by not including thelinux/ptrace.hheader if thesys/ptrace.hheader defines the said struct. Fixes
https://github.com/linux-test-project/ltp/issues/6Signed-off-by Markos Chandras <[email protected]>---
Build tested on glibc-2.17 and glibc-2.18 systems--- configure.ac | 4 ++++ include/config.h.default | 3 +++ testcases/kernel/syscalls/ptrace/ptrace.h | 4 +++- 3 files changed, 10 insertions(+), 1 deletion(-)configure.ac +0
-0configure.ac AC_CHECK_HEADERS([ \ · line 53
Quoted 6 lines
configure.ac +3
-0@@ -48,6 +48,10 @@ AC_CHECK_HEADERS([ \ sys/prctl.h \ ]) +# glibc-2.18 defines ptrace_peeksiginfo_args in sys/ptrace.h which +# conflicts with the one from linux kernel in linux/ptrace.h +AC_CHECK_TYPES([struct ptrace_peeksiginfo_args],,,[#include <sys/ptrace.h>])We generally place this like checks to m4/*.
Quoted 9 lines
configure.ac +1
-0+ # Tools knobs # Expectinclude/config.h.default +0
-0include/config.h.default line 171
Quoted 5 lines
include/config.h.default +2
-0@@ -167,6 +167,9 @@ /* Define to 1 if the system has the type `struct modify_ldt_ldt_s'. */ #undef HAVE_STRUCT_MODIFY_LDT_LDT_S +/* Define to 1 if the system has the type `struct ptrace_peeksiginfo_args'. */ +#undef HAVE_STRUCT_PTRACE_PEEKSIGINFO_ARGMissed an "S" here?
Thanks,
Wanlong GaoQuoted 4 lines
include/config.h.default +1
-0+ /* Define to 1 if `signo' is member of `struct signalfd_siginfo'. */ #undef HAVE_STRUCT_SIGNALFD_SIGINFO_SIGNO
Quoted 17 lines
Quoted 6 lines
testcases/kernel/syscalls/ptrace/ptrace.h +0
-0testcases/kernel/syscalls/ptrace/ptrace.h line 27
Quoted 10 lines
testcases/kernel/syscalls/ptrace/ptrace.h +3
-1@@ -19,7 +19,9 @@# include <asm/ptrace.h> #endif #ifdef HAVE_LINUX_PTRACE_H -# include <linux/ptrace.h> +# ifndef HAVE_STRUCT_PTRACE_PEEKSIGINFO_ARGS +# include <linux/ptrace.h> +# endif #endif #undef FU_ia64_fpreg#undef FU_pt_all_user_regs
Thanks for the review. I will send a v2 soon
Signature · 13 lines
markos ------------------------------------------------------------------------------ Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk _______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list