public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [patch] libffi/: check mmap() availability explicitly
@ 2004-07-31  0:24 Maciej W. Rozycki
  2004-08-02 15:46 ` Tom Tromey
  0 siblings, 1 reply; 2+ messages in thread
From: Maciej W. Rozycki @ 2004-07-31  0:24 UTC (permalink / raw)
  To: gcc-patches

Hello,

 The configure script in libffi/ relies on autoconf cache variables being
implictly set for its mmap() test.  Unfortunately with the current set of
autotools used they are not set (anymore, probably) -- it's easily
verifiable -- the first occurence of "ac_cv_header_sys_mman_h" and
"ac_cv_func_mmap" in libffi/configure are tests of their values.  Here is
a patch that fixes the problem for me.

2004-07-30  Maciej W. Rozycki  <macro@linux-mips.org>

	* acinclude.m4 (AC_FUNC_MMAP_BLACKLIST): Check for <sys/mman.h>
	and mmap() explicitly instead of relying on preset autoconf cache
	variables.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.

 I think the fix should be considered obvious and despite being somewhat
dated, it is still needed for the trunk.  Please apply.

  Maciej

gcc-3.5.0-20040322-libffi-ac25.patch
diff -up --recursive --new-file gcc-3.5.0-20040322.macro/libffi/acinclude.m4 gcc-3.5.0-20040322/libffi/acinclude.m4
--- gcc-3.5.0-20040322.macro/libffi/acinclude.m4	2003-11-22 03:29:37.000000000 +0000
+++ gcc-3.5.0-20040322/libffi/acinclude.m4	2004-01-24 02:54:32.000000000 +0000
@@ -11,8 +11,12 @@ AC_SUBST(LIBTOOL)
 # mmap(2) blacklisting.  Some platforms provide the mmap library routine
 # but don't support all of the features we need from it.
 AC_DEFUN([AC_FUNC_MMAP_BLACKLIST],
-[if test $ac_cv_header_sys_mman_h != yes \
- || test $ac_cv_func_mmap != yes; then
+[
+AC_CHECK_HEADER([sys/mman.h],
+		[libffi_header_sys_mman_h=yes], [libffi_header_sys_mman_h=no])
+AC_CHECK_FUNC([mmap], [libffi_func_mmap=yes], [libffi_func_mmap=no])
+if test "$libffi_header_sys_mman_h" != yes \
+ || test "$libffi_func_mmap" != yes; then
    ac_cv_func_mmap_file=no
    ac_cv_func_mmap_dev_zero=no
    ac_cv_func_mmap_anon=no

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [patch] libffi/: check mmap() availability explicitly
  2004-07-31  0:24 [patch] libffi/: check mmap() availability explicitly Maciej W. Rozycki
@ 2004-08-02 15:46 ` Tom Tromey
  0 siblings, 0 replies; 2+ messages in thread
From: Tom Tromey @ 2004-08-02 15:46 UTC (permalink / raw)
  To: Maciej W. Rozycki; +Cc: Gcc Patch List

>>>>> "Maciej" == Maciej W Rozycki <macro@linux-mips.org> writes:

Maciej> 2004-07-30  Maciej W. Rozycki  <macro@linux-mips.org>
Maciej> * acinclude.m4 (AC_FUNC_MMAP_BLACKLIST): Check for <sys/mman.h>
Maciej> and mmap() explicitly instead of relying on preset autoconf cache
Maciej> variables.
Maciej> * aclocal.m4: Regenerate.
Maciej> * configure: Regenerate.

It looks like the intent here was for the explicit checks in
configure.ac to set these variables:

    AC_CHECK_HEADERS(sys/mman.h)
    AC_CHECK_FUNCS(mmap)
    AC_FUNC_MMAP_BLACKLIST

... but IMO relying on autoconf cache variable names is not a very
good practice.  I agree we ought to move these calls into
AC_FUNC_MMAP_BLACKLIST.  Can you re-test with the checks removed from
configure.ac?  If that works for you I will check it in.

Tom

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-08-02 15:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-07-31  0:24 [patch] libffi/: check mmap() availability explicitly Maciej W. Rozycki
2004-08-02 15:46 ` 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).