[klibc] [patch] openat build with older !openat linux tree

maximilian attems maks at sternwelten.at
Sun Feb 19 08:02:34 PST 2006


klibc/arch/i386/openat.o: In function `openat':klibc/arch/i386/openat.S:19: undefined reference to `__NR_openat'
make[3]: *** [klibc/libc.so] Error 1

belows allows to build against a tree based on 2.6.15

Signed-off-by: maximilian attems <maks at sternwelten.at>

diff --git a/klibc/arch/i386/openat.S b/klibc/arch/i386/openat.S
index 3955eae..40ab299 100644
--- a/klibc/arch/i386/openat.S
+++ b/klibc/arch/i386/openat.S
@@ -6,6 +6,7 @@
  * and the need for O_LARGEFILE.
  */
 
+#ifdef __NR_openat
 #include <asm/unistd.h>
 
 /* <asm/fcntl.h>, despite the name, isn't assembly-safe */
@@ -20,3 +21,4 @@ openat:
 	jmp	__syscall_varadic
 
 	.size	openat,.-openat
+#endif /* __NR_openat */
diff --git a/klibc/openat.c b/klibc/openat.c
index 2975112..e2ce67b 100644
--- a/klibc/openat.c
+++ b/klibc/openat.c
@@ -10,7 +10,7 @@
 #include <fcntl.h>
 #include <bitsize.h>
 
-#if _BITSIZE == 32 && !defined(__i386__) && defined(__NR_openat)
+#if _BITSIZE == 32 && defined(__NR_openat)
 
 extern int __openat(int, const char *, int, mode_t);
 



More information about the klibc mailing list