Hello,
On Wednesday 10 December 2008 10:50:28 Veerendra wrote:
> In the latest LTP release ( LTP-full-20081130) the make is failing for
> Power machines for the 'utimensat' tests.
> Can you please check this ?
>
> make[4]: Entering directory
> `/root/ltp-full-20081130/testcases/kernel/syscalls/utimensat' make[5]:
> Entering directory
> `/root/ltp-full-20081130/testcases/kernel/syscalls/utimensat' cc -Wall
> -I../../include -g -Wall -I../../../../include -Wall -I../../../../include
> -Wall -o check_for_utimensat_support check_for_utimensat_support.c
> ../../../../lib/tst_kvercmp.c -I../../../../include make[5]: Leaving
> directory `/root/ltp-full-20081130/testcases/kernel/syscalls/utimensat'
> make[5]: Entering directory
> `/root/ltp-full-20081130/testcases/kernel/syscalls/utimensat' cc -Wall
> -I../../include -g -Wall -I../../../../include -Wall -I../../../../include
> -Wall utimensat01.c -L../../../../lib -lltp -o utimensat01
> ../../include/linux_syscall_numbers.h:18: warning: ‘cleanup’ declared
> ‘static’ but never defined ../../../../lib/libltp.a(tst_res.o): In
> function `tst_res':
> ../../../../lib/libltp.a(tst_res.o):tst_res.c:(.text+0x13a6): more
> undefined references to `TCID' follow collect2: ld returned 1 exit status
> make[5]: *** [utimensat01] Error 1
> make[5]: Leaving directory
> `/root/ltp-full-20081130/testcases/kernel/syscalls/utimensat' make[4]: ***
> [all] Error 2
> make[4]: Leaving directory
> `/root/ltp-full-20081130/testcases/kernel/syscalls/utimensat' make[3]: ***
> [all] Error 2
> make[3]: Leaving directory
> `/root/ltp-full-20081130/testcases/kernel/syscalls' make[2]: *** [all]
> Error 2
> make[2]: Leaving directory `/root/ltp-full-20081130/testcases/kernel'
> make[1]: *** [all] Error 2
> make[1]: Leaving directory `/root/ltp-full-20081130/testcases'
>
> make: *** [all] Error 2
This is because TCID is needed to call tst_brk if the syscall doesn't exist or
optimization doesn't eliminate the call. At the first sight, it might seem that
syscall() is not called when __NR_utimensat is undefined, because it is guarded
by #ifdef, but it's not really so, because __NR_utimensat is stubbed in
linux_syscall_numbers.h
To fix it, apply the first patch, which moves the definition of TCID outside
the
#ifdef block - it should be there anyway. The second patch removes the
conditional compilation altogether, because it is never effective.
The patches should be applied in sequence.
Regards
Jiri Palecek
From 73314f9d593ab636dbd19b2e2e19dcb45c1bb89a Mon Sep 17 00:00:00 2001
From: Jiri Palecek <[EMAIL PROTECTED](none)>
Date: Thu, 11 Dec 2008 00:26:08 +0100
Subject: [PATCH] Move the TCID and TST_TOTAL definitions out of the #ifdef block, to avoid link failures when the utimensat syscall doesn't exist or optimization is turned off
Signed-off-by: Jiri Palecek <[EMAIL PROTECTED]>
---
testcases/kernel/syscalls/utimensat/utimensat01.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/testcases/kernel/syscalls/utimensat/utimensat01.c b/testcases/kernel/syscalls/utimensat/utimensat01.c
index 0ac75fc..69f1c92 100644
--- a/testcases/kernel/syscalls/utimensat/utimensat01.c
+++ b/testcases/kernel/syscalls/utimensat/utimensat01.c
@@ -44,6 +44,9 @@
#include <test.h>
#include "linux_syscall_numbers.h"
+char *TCID="utimensat01"; /* Test program identifier. */
+int TST_TOTAL = 0; /* Total number of test cases. */
+
#define cleanup tst_exit
/* We use EXIT_FAILURE for an expected failure from utimensat()
@@ -284,9 +287,6 @@ main(int argc, char *argv[])
}
#else
-char *TCID="utimensat01"; /* Test program identifier. */
-int TST_TOTAL = 0; /* Total number of test cases. */
-
int main(){
tst_resm(TCONF, "This test needs a kernel that has utimensat syscall.");
--
1.6.0.2
From 39e32a05a3d1ab0751337cb5a0bbceb204c8b8ba Mon Sep 17 00:00:00 2001
From: Jiri Palecek <[EMAIL PROTECTED](none)>
Date: Thu, 11 Dec 2008 00:28:40 +0100
Subject: [PATCH] Don't compile the utimensat test conditionally depending on existence of __NR_utimensat, since it is stubbed anyway
Signed-off-by: Jiri Palecek <[EMAIL PROTECTED]>
---
testcases/kernel/syscalls/utimensat/utimensat01.c | 9 ---------
1 files changed, 0 insertions(+), 9 deletions(-)
diff --git a/testcases/kernel/syscalls/utimensat/utimensat01.c b/testcases/kernel/syscalls/utimensat/utimensat01.c
index 69f1c92..7d0a4f9 100644
--- a/testcases/kernel/syscalls/utimensat/utimensat01.c
+++ b/testcases/kernel/syscalls/utimensat/utimensat01.c
@@ -53,8 +53,6 @@ int TST_TOTAL = 0; /* Total number of test cases. */
(e.g., EACCES and EPERM), and one of the following for unexpected
failures (i.e., something broke in our test setup). */
-#ifdef __NR_utimensat
-
#ifndef AT_FDCWD
#define AT_FDCWD -100
#endif
@@ -286,11 +284,4 @@ main(int argc, char *argv[])
exit(EXIT_SUCCESS);
}
-#else
-int main(){
-
- tst_resm(TCONF, "This test needs a kernel that has utimensat syscall.");
- return 0;
-}
-#endif
--
1.6.0.2
------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you. Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list