Jin Bing Guo wrote:
>
> I think the patch can fix the build error on ppc and ppc64.
>
> ---
> ltp-intermediate-20080820.orig/testcases/kernel/syscalls/sync_file_range/sync_file_range01.c
> 2008-08-18 05:37:42.000000000 -0500
> +++
> ltp-intermediate-20080820/testcases/kernel/syscalls/sync_file_range/sync_file_range01.c
> 2008-08-22 04:05:12.000000000 -0500
> @@ -245,12 +245,12 @@ return;
> static inline long syncfilerange(int fd, off64_t offset, off64_t
> nbytes, unsigned int flags)
> {
>
> - #if defined(__powerpc64__) && (__WORDSIZE==32)
> + #if (defined(__powerpc__) || defined(__powerpc64__)) && (__WORDSIZE==32)
>
> return syscall(__NR_sync_file_range2, fd, flags, (int)(offset >>32), \
> (int)offset, (int)(nbytes >>32), (int)nbytes);
>
> - #elif defined(__powerpc64__) && (__WORDSIZE==64)
> + #elif (defined(__powerpc__) || defined(__powerpc64__)) &&
> (__WORDSIZE==64)
>
> return syscall(__NR_sync_file_range2, fd, flags, offset, nbytes);
> #else
>
>
>
> /(See attached file: Fix_build_error_sync_file_range01.patch)/
>
> Best regards!
>
> Jin Bing Guo 郭晋兵
>
I too had prepared the same patch, but there were some more issues on a
different kernel. Hence, have put more checks in the newly attached patch.
Subrata,
I have tested it on ppc64 and x86_64 and is working fine. Please test
and let me know.

Regards,
Poornima
>
>
>
>
>
>
> Inactive hide details for Subrata Modak ---08/21/2008 10:39:23 PM---Hi
> Poornima,Subrata Modak ---08/21/2008 10:39:23 PM---Hi Poornima,
>
>                         *Subrata Modak <[EMAIL PROTECTED]>*
>
>                         08/21/2008 10:24 PM
>                         Please respond to
>                         [EMAIL PROTECTED]
>
>       
>
> To
>       
> "B. N. Poornima" <[EMAIL PROTECTED]>
>
> cc
>       
> Vijay Kumar <[EMAIL PROTECTED]>, [email protected],
> suzukikp <[EMAIL PROTECTED]>, Antonio Rosales
> <[EMAIL PROTECTED]>, suparna <[EMAIL PROTECTED]>,
> [EMAIL PROTECTED], Andi Kleen <[EMAIL PROTECTED]>,
> [EMAIL PROTECTED], Masatake YAMATO <[EMAIL PROTECTED]>, Jin Bing
> Guo/China/[EMAIL PROTECTED], Li Zefan <[EMAIL PROTECTED]>, Shi Weihua
> <[EMAIL PROTECTED]>
>
> Subject
>       
> Re: [LTP] Testcases for sync_file_range() system call
>
>       
>
>
> Hi Poornima,
>
> On Thu, 2008-08-21 at 18:35 +0530, B. N. Poornima wrote:
> > Vijay Kumar wrote:
> > > B. N. Poornima wrote:
> > >>> 1. The patch is modifying a generated file linux_syscall_numbers.h.
> > >>> The files in testcases/kernel/include/*.in should have been
> modified.
> > >> Thanks for the input. I am attaching the modified patch with the
> > >> above correction.
> > >
> > > The updated patch is still modifying linux_syscall_numbers.h.
> > Oops...I missed the '*.in' part of it. Sorry for the inconvenience. As
> > the remaining part of the code is already in, am re-basing only this
> > part of the patch and attaching. Let me know if this is fine.
>
> I was getting some build failures for the sync_file_range() syscall
> tests on some machine and was about to report them, when i found this
> patch. I thought that this would solve the problem. Still the build
> failures occur post patching. Please see the failures below and provide
> fixes for the same. The test is against the latest ltp-intermediate
> release. The failure are basically against the PPC64 machines, but
> worked well on x86_64, i386 and ia64 machines:
>
> 1) Linux 2.6.9-22.EL #1 SMP Mon Sep 19 17:52:20 EDT 2005 ppc64 ppc64
> ppc64 GNU/Linux
>
> cc -Wall -I../../include -g -Wall -I../../../../include -Wall
> sync_file_range01.c -L../../../../lib -lltp -o sync_file_range01
> sync_file_range01.c: In function `syncfilerange':
> sync_file_range01.c:258: error: `__NR_sync_file_range' undeclared (first
> use in this function)
> sync_file_range01.c:258: error: (Each undeclared identifier is reported
> only once
> sync_file_range01.c:258: error: for each function it appears in.)
> make[4]: *** [sync_file_range01] Error 1
>
> 2) Linux 2.6.16.21-0.8-ppc64 #1 SMP Mon Jul 3 18:25:39 UTC 2006 ppc64
> ppc64 ppc64 GNU/Linux
>
> make[4]: Entering directory
> `/root/subrata/ltp/ltp-intermediate-20080820/testcases/kernel/syscalls/sync_file_range'
> cc -Wall -I../../include -g -Wall -I../../../../include -Wall
> sync_file_range01.c -L../../../../lib -lltp -o sync_file_range01
> sync_file_range01.c: In function ‘syncfilerange’:
> sync_file_range01.c:258: error: ‘__NR_sync_file_range’ undeclared (first
> use in this function)
> sync_file_range01.c:258: error: (Each undeclared identifier is reported
> only once
> sync_file_range01.c:258: error: for each function it appears in.)
> make[4]: *** [sync_file_range01] Error 1
>
> Regards--
> Subrata
>
> > >
> > >>> 2. When the patch was committed the generated file got added to the
> > >>> CVS repository.
> > >> I did not understand the problem here. Is there anything expected
> > >> from my end?
> > >
> > > This issue has been fixed.
> > >
> > > Regards,
> > > Vijay
> > >
> > Regards,
> > Poornima
>
>

--- ltp-intermediate-20080820.original/testcases/kernel/syscalls/sync_file_range/sync_file_range01.c	2008-08-18 16:07:42.000000000 +0530
+++ ltp-intermediate-20080820/testcases/kernel/syscalls/sync_file_range/sync_file_range01.c	2008-08-22 17:59:03.000000000 +0530
@@ -245,12 +245,12 @@ return;
 static inline long syncfilerange(int fd, off64_t offset, off64_t nbytes, unsigned int flags)
 {
 
-	#if defined(__powerpc64__) && (__WORDSIZE==32)
+	#if (defined(__powerpc64__) || defined(__powerpc__)) && (__WORDSIZE==32)
 
 	       	  return syscall(__NR_sync_file_range2, fd, flags, (int)(offset >>32), \
 					(int)offset, (int)(nbytes >>32), (int)nbytes);
 
-	#elif defined(__powerpc64__) && (__WORDSIZE==64)  
+	#elif (defined(__powerpc64__) || defined(__powerpc__)) && (__WORDSIZE==64)  
 		         
 		  return syscall(__NR_sync_file_range2, fd, flags, offset, nbytes);
 	#else
@@ -294,18 +294,26 @@ main(int   ac,    	/* number of command 
 	char *msg;
 
  /***************************************************************
-              parse standard options
+              parse standard options  
   ********************************************************************/
         if ( (msg=parse_opts(ac, av, (option_t *) NULL, NULL)) != (char *) NULL )
                 tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
 
- /* This test needs kernel version > 2.6.16 */
-       
+		
+#if defined(__powerpc__) || defined(__powerpc64__)     /* for PPC, kernel version > 2.6.21 needed */
+                if ( !arch_support || (tst_kvercmp(2,16,22) < 0)) {
+                        tst_resm(TCONF, "System doesn't support execution of the test");
+                        tst_exit();
+                }
+#else
+        /* For other archs, need kernel version > 2.6.16 */
+
         if ( !arch_support || (tst_kvercmp(2,6,17) < 0)) {
                 tst_resm(TCONF, "System doesn't support execution of the test");
                 tst_exit();
         }
-		
+
+#endif
 	
 /* perform global test setup, call setup() function. */
 setup();
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to