Skip to contentSkip to conversation

fix compiling error on ia64 platform (ltp-full-20091130)

PATCH In review Caspar Zhang 2 participants 2 messages Dec 11, 2009 1 message not in the archive

lore
Share & tools
lore
#1 lore raw

PATCH 1/1 fix compiling error on ia64 platform (ltp-full-20091130)

In reply to a message not in the archive

Hi all,

Here are two patches to fix compiling error in ia64,
I tested only in version ltp-full-20091130, please check your own version. They are for work well on my system. See the attachment.

Thanks,
Caspar

On ia64 machines, the compilation can't pass. The error messages:
In file included from /usr/include/asm/ptrace.h:58,

                 from ../../syscalls/ptrace/ptrace.h:17,
                 from vfork.c:44:
/usr/include/asm/fpu.h:57: error: redefinition of ‘struct ia64_fpreg’
In file included from ../../syscalls/ptrace/ptrace.h:17,
                 from vfork.c:44:

/usr/include/asm/ptrace.h:208: error: redefinition of ‘struct pt_all_user_regs’ make[5]: *** [vfork] Error 1

After investigating, I found in ia64 platform, the file asm/ptrace.h conflicts with sys/ptrace.h and linux/ptrace.h, so I did some tricks on ptrace.h in testcase/kernel/syscall/ptrace: if it is in a ia64 machine, don't include
<asm/ptrace.h>. I think it's an ugly fix because it may not meet the dev's
need, but it works on my system.

testcases/kernel/syscalls/ptrace/ptrace.h +4 -0
diff -Naur a/testcases/kernel/syscalls/ptrace/ptrace.h b/testcases/kernel/syscalls/ptrace/ptrace.h
@@ -13,9 +13,13 @@
 #ifdef HAVE_SYS_REG_H
 # include <sys/reg.h>
 #endif
+/* fix compile error on ia64,
+ * FIXME: it's an ugly fix may not meet the developer's needs */
+#if ! defined(__ia64__)
 #if defined(HAVE_ASM_PTRACE_H)
 # include <asm/ptrace.h>
 #endif
+#endif
 /* ia64's a real pain.. */
 #if defined(__ia64__)
 #undef FU_ia64_fpreg

on some system without HAVE_STRUCT_PT_REGS and HAVE_STRUCT_USER_REGS_STRUCT defined, ptrace04.c will not pass the compiling due to the missing of cleanup() function.

testcases/kernel/syscalls/ptrace/ptrace04.c +17 -0
diff -Naur a/testcases/kernel/syscalls/ptrace/ptrace04.c b/testcases/kernel/syscalls/ptrace/ptrace04.c
@@ -46,6 +46,23 @@
 
 int TST_TOTAL = 2;
 
+/*
+ *cleanup() -  performs all ONE TIME cleanup for this test at
+ *		completion or premature exit.
+ */
+void cleanup()
+{
+
+	/*
+	 * print timing stats if that option was specified.
+	 * print errno log if that option was specified.
+	 */
+	TEST_CLEANUP;
+
+	/* exit with return code appropriate for results */
+	tst_exit();
+}				/* End cleanup() */
+
 void compare_registers(unsigned char poison)
 {
 #ifdef HAVE_STRUCT_PTRACE_REGS

------------------------------------------------------------------------------
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev

_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#2 lore raw
Quoted 4 lines · On Friday 11 December 2009 06:30:01 Caspar Zhang wrote:

Here are two patches to fix compiling error in ia64,
I tested only in version ltp-full-20091130, please check your own version. They are for work well on my system. See the attachment.

the ia64 change is incorrect. there's ia64 ifdef hacks in there already which are to be used.

the ppc64 issue is not ppc64 or ptrace specific. garrett has a different fix in the pipeline for that.
-mike

------------------------------------------------------------------------------
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev

_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list