Adam, please apply.
At present, we disable the functions for producing debugging output if
the __syscall_return macro is not available. However, we only
actually need the __syscall_return macro on i386, in order to redefine
some of the other _syscall*() macro because the standard versions
don't work in -fPIC code.
This patch is less eager to disable the debugging, and will allow
unmapped_abort() and so forth to work on non-i386 machines even when
__syscall_return() isn't available.
Signed-off-by: David Gibson <[EMAIL PROTECTED]>
Index: libhugetlbfs/elflink.c
===================================================================
--- libhugetlbfs.orig/elflink.c 2006-10-27 16:26:14.000000000 +1000
+++ libhugetlbfs/elflink.c 2006-10-27 16:30:14.000000000 +1000
@@ -51,8 +51,8 @@
#define ELF_ST_TYPE(x) ELF64_ST_TYPE(x)
#endif
-#ifdef __syscall_return
#ifdef __i386__
+#ifdef __syscall_return
/* The normal i386 syscall macros don't work with -fPIC :( */
#undef _syscall2
#define _syscall2(type,name,type1,arg1,type2,arg2) \
@@ -75,7 +75,13 @@ __asm__ volatile ("push %%ebx; movl %2,%
"d" ((long)(arg3))); \
__syscall_return(type,__res); \
}
+#define SYSCALL_MACROS_OK
+#endif /* __syscall_return */
+#else /* __i386__ */
+#define SYSCALL_MACROS_OK
#endif /* __i386__ */
+
+#ifdef SYSCALL_MACROS_OK
/* This function prints an error message to stderr, then aborts. It
* is safe to call, even if the executable segments are presently
* unmapped.
@@ -169,13 +175,13 @@ static void unmapped_abort(const char *f
sys_abort();
}
-#else /* __syscall_return */
-#warning __syscall_return macro not available. Some debugging will be \
+#else /* SYSCALL_MACROS_OK */
+#warning Dont have necessary syscall macros. Some debugging will be \
disabled during executable remapping
static void unmapped_abort(const char *fmt, ...)
{
}
-#endif /* __syscall_return */
+#endif /* SYSCALL_MACROS_OK */
#define MAX_HTLB_SEGS 2
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Libhugetlbfs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libhugetlbfs-devel