This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch] gcc/: check mmap() availability explicitly
- From: "Maciej W. Rozycki" <macro at linux-mips dot org>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 30 Jul 2004 17:43:31 +0200 (CEST)
- Subject: [patch] gcc/: check mmap() availability explicitly
Hello,
The configure script in gcc/ 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 gcc/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>
* aclocal.m4 (gcc_AC_FUNC_MMAP_BLACKLIST): Check for <sys/mman.h>
and mmap() explicitly instead of relying on preset autoconf cache
variables.
* 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.4.0-20040112-gcc-ac25.patch
diff -up --recursive --new-file gcc-3.4.0-20040112.macro/gcc/aclocal.m4 gcc-3.4.0-20040112/gcc/aclocal.m4
--- gcc-3.4.0-20040112.macro/gcc/aclocal.m4 2004-01-09 12:57:31.000000000 +0000
+++ gcc-3.4.0-20040112/gcc/aclocal.m4 2004-01-24 02:58:49.000000000 +0000
@@ -376,8 +376,12 @@ AC_SUBST($1)dnl
# mmap(2) blacklisting. Some platforms provide the mmap library routine
# but don't support all of the features we need from it.
AC_DEFUN([gcc_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],
+ [gcc_header_sys_mman_h=yes], [gcc_header_sys_mman_h=no])
+AC_CHECK_FUNC([mmap], [gcc_func_mmap=yes], [gcc_func_mmap=no])
+if test "$gcc_header_sys_mman_h" != yes \
+ || test "$gcc_func_mmap" != yes; then
gcc_cv_func_mmap_file=no
gcc_cv_func_mmap_dev_zero=no
gcc_cv_func_mmap_anon=no