Skip to contentSkip to conversation

Fix eventfd2_03 build failure on powerpc architecture

PATCH In review Lucio 2 participants 2 messages Jul 1, 2009 – Jul 6, 2009

lore
Share & tools
lore

Lucio

author
#0 lore raw

PATCH 1/1 Fix eventfd2_03 build failure on powerpc architecture

Hi,

I've found a failure when building ltp-full-20090630 on powerpc:

eventfd2_03.c:48:2: error: #error Cannot detect your architecture! eventfd2_03.c: In function ‘eventfd2’:
eventfd2_03.c:54: error: ‘__NR_eventfd2’ undeclared (first use in this function) eventfd2_03.c:54: error: (Each undeclared identifier is reported only once eventfd2_03.c:54: error: for each function it appears in.)
eventfd2_03.c: In function ‘main’:
eventfd2_03.c:129: warning: implicit declaration of function ‘waitpid’ make[4]: *** [eventfd2_03] Error 1
make[4]: Leaving directory `/root/ltp-full-20090630/testcases/kernel/syscalls/eventfd2' make[3]: *** [all] Error 2
make[3]: Leaving directory `/root/ltp-full-20090630/testcases/kernel/syscalls' make[2]: *** [all] Error 2
make[2]: Leaving directory `/root/ltp-full-20090630/testcases/kernel' make[1]: *** [all] Error 2
make[1]: Leaving directory `/root/ltp-full-20090630/testcases'
make: *** [all] Error 2

This patch fixes the failure, the test program identifier and adds a kernel version check.

Signed-off-by Lucio Correia <[email protected]>

testcases/kernel/include/powerpc64.in +2 -1
diff -Nurp ltp-full-20090630/testcases/kernel/include/powerpc64.in ltp-full-20090630.new/testcases/kernel/include/powerpc64.in
@@ -20,6 +20,7 @@ __NR_symlinkat (__NR_openat + 9)
 __NR_readlinkat (__NR_openat + 10)
 __NR_fchmodat  (__NR_openat + 11)
 __NR_faccessat (__NR_openat + 12)
+__NR_utimensat 304
 __NR_eventfd 307
 __NR_fallocate 309
-__NR_utimensat 304
+__NR_eventfd2 314
testcases/kernel/include/powerpc.in +2 -1
diff -Nurp ltp-full-20090630/testcases/kernel/include/powerpc.in ltp-full-20090630.new/testcases/kernel/include/powerpc.in
@@ -20,7 +20,8 @@ __NR_symlinkat (__NR_openat + 9)
 __NR_readlinkat (__NR_openat + 10)
 __NR_fchmodat  (__NR_openat + 11)
 __NR_faccessat (__NR_openat + 12)
+__NR_utimensat 304
 __NR_eventfd 307
 __NR_fallocate 309
-__NR_utimensat 304
+__NR_eventfd2 314
 __NR_perf_counter_open 319
testcases/kernel/syscalls/eventfd2/eventfd2_03.c +11 -11
diff -Nurp ltp-full-20090630/testcases/kernel/syscalls/eventfd2/eventfd2_03.c ltp-full-20090630.new/testcases/kernel/syscalls/eventfd2/eventfd2_03.c
@@ -33,22 +33,17 @@
 #include <unistd.h>
 #include <errno.h>
 
-char *TCID = "eventfd2_02";     /* test program identifier*/
+/* Harness Specific Include Files. */
+#include "test.h"
+#include "linux_syscall_numbers.h"
+
+char *TCID = "eventfd2_03";     /* test program identifier*/
+int TST_TOTAL = 1;	        	/* total number of tests in this file */
 
 #ifndef EFD_SEMLIKE
 #define EFD_SEMLIKE (1 << 0)
 #endif
 
-#ifndef __NR_eventfd2
-#if defined(__x86_64__)
-#define __NR_eventfd2 290
-#elif defined(__i386__)
-#define __NR_eventfd2 328
-#else
-#error Cannot detect your architecture!
-#endif
-#endif
-
 
 static int eventfd2(int count, int flags) {
 	return syscall(__NR_eventfd2, count, flags);
@@ -113,6 +108,11 @@ int main (int argc, char **argv) {
 			return 1;
 		}
 	}
+	if ((tst_kvercmp(2, 6, 27)) < 0) {
+		tst_resm(TCONF,
+			 "This test can only run on kernels that are 2.6.27 and higher");
+		tst_exit();
+	}
 	if ((fd1 = eventfd2(0, EFD_SEMLIKE)) == -1 ||
 	    (fd2 = eventfd2(0, EFD_SEMLIKE)) == -1) {
 		perror("eventfd2");

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

#1 lore raw
Quoted 22 lines · Lucio

Hi,

I've found a failure when building ltp-full-20090630 on powerpc:

eventfd2_03.c:48:2: error: #error Cannot detect your architecture! eventfd2_03.c: In function ‘eventfd2’:
eventfd2_03.c:54: error: ‘__NR_eventfd2’ undeclared (first use in this function) eventfd2_03.c:54: error: (Each undeclared identifier is reported only once eventfd2_03.c:54: error: for each function it appears in.)
eventfd2_03.c: In function ‘main’:
eventfd2_03.c:129: warning: implicit declaration of function ‘waitpid’ make[4]: *** [eventfd2_03] Error 1
make[4]: Leaving directory `/root/ltp-full-20090630/testcases/kernel/syscalls/eventfd2' make[3]: *** [all] Error 2
make[3]: Leaving directory `/root/ltp-full-20090630/testcases/kernel/syscalls' make[2]: *** [all] Error 2
make[2]: Leaving directory `/root/ltp-full-20090630/testcases/kernel' make[1]: *** [all] Error 2
make[1]: Leaving directory `/root/ltp-full-20090630/testcases'
make: *** [all] Error 2

Quoted 5 lines

This patch fixes the failure, the test program identifier and adds a kernel version check.

Signed-off-by Lucio Correia <[email protected]>

Thanks.

Regards--
Subrata

Quoted 73 lines

diff -Nurp ltp-full-20090630/testcases/kernel/include/powerpc64.in ltp-full-20090630.new/testcases/kernel/include/powerpc64.in

testcases/kernel/include/powerpc64.in +2 -1
@@ -20,6 +20,7 @@ __NR_symlinkat (__NR_openat + 9)
 __NR_readlinkat (__NR_openat + 10)
 __NR_fchmodat  (__NR_openat + 11)
 __NR_faccessat (__NR_openat + 12)
+__NR_utimensat 304
 __NR_eventfd 307
 __NR_fallocate 309
-__NR_utimensat 304
+__NR_eventfd2 314

diff -Nurp ltp-full-20090630/testcases/kernel/include/powerpc.in ltp-full-20090630.new/testcases/kernel/include/powerpc.in

testcases/kernel/include/powerpc.in +2 -1
@@ -20,7 +20,8 @@ __NR_symlinkat (__NR_openat + 9)
 __NR_readlinkat (__NR_openat + 10)
 __NR_fchmodat  (__NR_openat + 11)
 __NR_faccessat (__NR_openat + 12)
+__NR_utimensat 304
 __NR_eventfd 307
 __NR_fallocate 309
-__NR_utimensat 304
+__NR_eventfd2 314
 __NR_perf_counter_open 319

diff -Nurp ltp-full-20090630/testcases/kernel/syscalls/eventfd2/eventfd2_03.c ltp-full-20090630.new/testcases/kernel/syscalls/eventfd2/eventfd2_03.c

testcases/kernel/syscalls/eventfd2/eventfd2_03.c +11 -12
@@ -33,22 +33,17 @@
 #include <unistd.h>
 #include <errno.h>
 
-char *TCID = "eventfd2_02";     /* test program identifier*/
+/* Harness Specific Include Files. */
+#include "test.h"
+#include "linux_syscall_numbers.h"
+
+char *TCID = "eventfd2_03";     /* test program identifier*/
+int TST_TOTAL = 1;	        	/* total number of tests in this file */
 
 #ifndef EFD_SEMLIKE
 #define EFD_SEMLIKE (1 << 0)
 #endif
 
-#ifndef __NR_eventfd2
-#if defined(__x86_64__)
-#define __NR_eventfd2 290
-#elif defined(__i386__)
-#define __NR_eventfd2 328
-#else
-#error Cannot detect your architecture!
-#endif
-#endif
-
 
 static int eventfd2(int count, int flags) {
 	return syscall(__NR_eventfd2, count, flags);
@@ -113,6 +108,11 @@ int main (int argc, char **argv) {
 			return 1;
 		}
 	}
+	if ((tst_kvercmp(2, 6, 27)) < 0) {
+		tst_resm(TCONF,
+			 "This test can only run on kernels that are 2.6.27 and higher");
+		tst_exit();
+	}
 	if ((fd1 = eventfd2(0, EFD_SEMLIKE)) == -1 ||
 	    (fd2 = eventfd2(0, EFD_SEMLIKE)) == -1) {
 		perror("eventfd2");
 
 
------------------------------------------------------------------------------
Quoted 4 lines

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

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