* [patch] weaken the MMAP check
@ 2006-04-17 21:10 Andreas Tobler
2006-04-21 23:32 ` Tom Tromey
0 siblings, 1 reply; 6+ messages in thread
From: Andreas Tobler @ 2006-04-17 21:10 UTC (permalink / raw)
To: Java Patches
Hello,
this patch weakens the MMAP check. We only need MMAP with mmap chosen
address ranges, no FIXED one. On HP-UX PA MAP_FIXED does not work.
To run gcj_dbtool we fail here on HP-UX PA with an mmap not implemented
exception. This patch makes it work.
Ok for trunk ?
Andreas
2006-04-17 Andreas Tobler <a.tobler@schweiz.ch>
* configure.ac: Weaken the check for MMAP.
* configure: Rebuilt.
Index: configure.ac
===================================================================
--- configure.ac (revision 113010)
+++ configure.ac (working copy)
@@ -1346,8 +1346,32 @@
[AC_MSG_RESULT(no)])])])
AC_FUNC_ALLOCA
-AC_FUNC_MMAP
+dnl Check for mmap()
+# AC_FUNC_MMAP goes to far and checks for mmap fixed, we do only need mmap
+# at a mmap selected address. See
+# gnu/java/nio/channels/natFileChannelPosix.cc
+
+AC_MSG_CHECKING([for mmap])
+AC_CACHE_VAL(ac_cv_func_mmap_ok,
+ [AC_TRY_LINK(
+ changequote(<<, >>)dnl
+ <<
+#include <unistd.h>
+#include <sys/mman.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+ >>,
+ changequote([, ])dnl
+ [mmap((void *)0, 0, PROT_READ, 0, 0, 0);],
+ ac_cv_func_mmap_ok=yes,
+ ac_cv_func_mmap_ok=no)] )
+AC_MSG_RESULT($ac_cv_func_mmap_ok)
+if test $ac_cv_func_mmap_ok = yes
+then
+ AC_DEFINE(HAVE_MMAP, 1, [ Define to 1 if you have a working `mmap'
system call w/o fixed address ability.])
+fi
+
AC_CHECK_PROGS(PERL, perl, false)
SYSDEP_SOURCES=
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [patch] weaken the MMAP check
2006-04-17 21:10 [patch] weaken the MMAP check Andreas Tobler
@ 2006-04-21 23:32 ` Tom Tromey
2006-04-22 21:12 ` Andreas Tobler
0 siblings, 1 reply; 6+ messages in thread
From: Tom Tromey @ 2006-04-21 23:32 UTC (permalink / raw)
To: Andreas Tobler; +Cc: Java Patches
>>>>> "Andreas" == Andreas Tobler <toa@pop.agri.ch> writes:
Andreas> this patch weakens the MMAP check. We only need MMAP with mmap chosen
Andreas> address ranges, no FIXED one. On HP-UX PA MAP_FIXED does not work.
Andreas> To run gcj_dbtool we fail here on HP-UX PA with an mmap not
Andreas> implemented exception. This patch makes it work.
Andreas> Ok for trunk ?
Ok, thanks.
Tom
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [patch] weaken the MMAP check
2006-04-21 23:32 ` Tom Tromey
@ 2006-04-22 21:12 ` Andreas Tobler
2006-04-24 16:03 ` Tom Tromey
0 siblings, 1 reply; 6+ messages in thread
From: Andreas Tobler @ 2006-04-22 21:12 UTC (permalink / raw)
To: tromey; +Cc: Java Patches
Tom Tromey wrote:
>>>>>> "Andreas" == Andreas Tobler <toa@pop.agri.ch> writes:
>
> Andreas> this patch weakens the MMAP check. We only need MMAP with mmap chosen
> Andreas> address ranges, no FIXED one. On HP-UX PA MAP_FIXED does not work.
> Andreas> To run gcj_dbtool we fail here on HP-UX PA with an mmap not
> Andreas> implemented exception. This patch makes it work.
>
> Andreas> Ok for trunk ?
>
> Ok, thanks.
Thank you Tom.
I'll check in after an additional build & test since I discovered that I
have to run autoheader too and that it removes the HAVE_GETPAGESIZE from
include/config.h.in (seems to come from AC_FUNC_MMAP).
Andreas
2006-04-22 Andreas Tobler <a.tobler@schweiz.ch>
* configure.ac: Weaken the check for MMAP.
* configure: Rebuilt.
* include/config.h.in: Likewise.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [patch] weaken the MMAP check
2006-04-22 21:12 ` Andreas Tobler
@ 2006-04-24 16:03 ` Tom Tromey
2006-04-24 17:17 ` Andreas Tobler
0 siblings, 1 reply; 6+ messages in thread
From: Tom Tromey @ 2006-04-24 16:03 UTC (permalink / raw)
To: Andreas Tobler; +Cc: Java Patches
>>>>> "Andreas" == Andreas Tobler <toa@pop.agri.ch> writes:
Andreas> I'll check in after an additional build & test since I discovered that
Andreas> I have to run autoheader too and that it removes the HAVE_GETPAGESIZE
Andreas> from include/config.h.in (seems to come from AC_FUNC_MMAP).
In this case you have to add another check for getpagesize.
The symbol HAVE_GETPAGESIZE is actually used in a couple of places.
Tom
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [patch] weaken the MMAP check
2006-04-24 16:03 ` Tom Tromey
@ 2006-04-24 17:17 ` Andreas Tobler
2006-04-24 21:14 ` Tom Tromey
0 siblings, 1 reply; 6+ messages in thread
From: Andreas Tobler @ 2006-04-24 17:17 UTC (permalink / raw)
To: tromey; +Cc: Java Patches
Hi Tom,
Tom Tromey wrote:
>>>>>> "Andreas" == Andreas Tobler <toa@pop.agri.ch> writes:
>
> Andreas> I'll check in after an additional build & test since I discovered that
> Andreas> I have to run autoheader too and that it removes the HAVE_GETPAGESIZE
> Andreas> from include/config.h.in (seems to come from AC_FUNC_MMAP).
>
> In this case you have to add another check for getpagesize.
> The symbol HAVE_GETPAGESIZE is actually used in a couple of places.
Well, in the libgcj core directory I can't find any instance of
HAVE_GETPAGESIZE.
In the classpath sub directory, yes. But there we check again for
getpagesize and mmap, but with a different method. (AC_CHECK_FUNCS)
Andreas
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [patch] weaken the MMAP check
2006-04-24 17:17 ` Andreas Tobler
@ 2006-04-24 21:14 ` Tom Tromey
0 siblings, 0 replies; 6+ messages in thread
From: Tom Tromey @ 2006-04-24 21:14 UTC (permalink / raw)
To: Andreas Tobler; +Cc: Java Patches
>>>>> "Andreas" == Andreas Tobler <toa@pop.agri.ch> writes:
Andreas> Well, in the libgcj core directory I can't find any instance of
Andreas> HAVE_GETPAGESIZE.
Oh, oops -- I misread the grep output the first time.
Things are fine as they are.
Tom
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2006-04-24 21:14 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-04-17 21:10 [patch] weaken the MMAP check Andreas Tobler
2006-04-21 23:32 ` Tom Tromey
2006-04-22 21:12 ` Andreas Tobler
2006-04-24 16:03 ` Tom Tromey
2006-04-24 17:17 ` Andreas Tobler
2006-04-24 21:14 ` Tom Tromey
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).