From patchwork Tue Apr 3 09:25:47 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tristan Gingold X-Patchwork-Id: 150354 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 66122B6FE2 for ; Tue, 3 Apr 2012 19:26:07 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1334049968; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:From:Content-Type:Content-Transfer-Encoding:Subject: Date:Message-Id:Cc:To:Mime-Version:Mailing-List:Precedence: List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=fYlGLiKZJB/55Zj3B/LkXK7TiWI=; b=tv/nU+cdg2Nx8uj fosW4CPcHoV+wm2CdEoAfBgTO0aRtPFzxtkntf0LArvppAxRz4N7NbjSV2toH6se nQanbz23oBaeExliRl/hUjiwPFHlasW2plL9kp0+HpGOcyUrRCSNvnn7cR914xGA bE2/MkwQ55OC6Vmo0Ww373DfxMVQ= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Received:From:Content-Type:Content-Transfer-Encoding:Subject:Date:Message-Id:Cc:To:Mime-Version:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=mLIExd5iHmbLSKQBfQ/sQX3fbuBF9UewQhOxn3FcV9Ak5JIERXfjBkqgdK3CTA vh/dRx4PY4OL6mFWqpRxA+yTBWTad0vrlqmOwiSV+69V/QiVA0+Vh+L9nz3om1I7 mfrMYZdUOjm8q1t1wH3tKoJDbrFHZ7nsZo/gwNjhk3zU0=; Received: (qmail 28264 invoked by alias); 3 Apr 2012 09:26:04 -0000 Received: (qmail 28244 invoked by uid 22791); 3 Apr 2012 09:26:02 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,TW_NV X-Spam-Check-By: sourceware.org Received: from mel.act-europe.fr (HELO mel.act-europe.fr) (194.98.77.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 03 Apr 2012 09:25:48 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 2A8BB290061; Tue, 3 Apr 2012 11:25:52 +0200 (CEST) Received: from mel.act-europe.fr ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id OiRjhueLQTCu; Tue, 3 Apr 2012 11:25:52 +0200 (CEST) Received: from ulanbator.act-europe.fr (ulanbator.act-europe.fr [10.10.1.67]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mel.act-europe.fr (Postfix) with ESMTP id 1446F29000D; Tue, 3 Apr 2012 11:25:52 +0200 (CEST) From: Tristan Gingold Subject: [Patch]: use mmap.m4 in gcc/configure Date: Tue, 3 Apr 2012 11:25:47 +0200 Message-Id: <597915CC-4C96-4276-B78D-520D894A4916@adacore.com> Cc: Paolo Bonzini To: GCC Patches Mime-Version: 1.0 (Apple Message framework v1257) X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Hi, the gcc_AC_FUNC_MMAP_BLACKLIST function in gcc/acinclude.m4 is exactly the same as the GCC_AC_FUNC_MMAP_BLACKLIST function in config/mmap.m4 (except the case of the first three letters). This patch makes gcc/configure.ac uses config/mmap.m4 instead of its own version. Also, I modified config/mmap.m4 to match *vms* instead of vms* like all other configuration scripts (because the official name is now openvms). Tested by building for ia64-hp-openvms and by visual inspection of the generated configure (only the *vms* lines changed). Ok for trunk ? Tristan. config/ 2012-04-03 Tristan Gingold * mmap.m4: Use *vms* instead of vms*. gcc/ 2012-04-03 Tristan Gingold * configure.ac: Use GCC_AC_FUNC_MMAP_BLACKLIST instead of gcc_AC_FUNC_MMAP_BLACKLIST. * aclocal.m4: Include mmap.m4 * acinclude.m4 (gcc_AC_FUNC_MMAP_BLACKLIST): Remove. * Makefile.in (aclocal_deps): Add mmap.m4. * configure: Regenerate. libitm/ 2012-04-03 Tristan Gingold * configure: Regenerate. diff --git a/config/mmap.m4 b/config/mmap.m4 index 39d79af..fba0d9d 100644 --- a/config/mmap.m4 +++ b/config/mmap.m4 @@ -24,7 +24,7 @@ else # read() to the same fd. The only system known to have a problem here # is VMS, where text files have record structure. case "$host_os" in - vms* | ultrix*) + *vms* | ultrix*) gcc_cv_func_mmap_file=no ;; *) gcc_cv_func_mmap_file=yes;; @@ -42,7 +42,7 @@ else # Systems known to be in this category are Windows (all variants), # VMS, and Darwin. case "$host_os" in - vms* | cygwin* | pe | mingw* | darwin* | ultrix* | hpux10* | hpux11.00) + *vms* | cygwin* | pe | mingw* | darwin* | ultrix* | hpux10* | hpux11.00) gcc_cv_func_mmap_dev_zero=no ;; *) gcc_cv_func_mmap_dev_zero=yes;; @@ -74,7 +74,7 @@ else # above for use of /dev/zero. # Systems known to be in this category are Windows, VMS, and SCO Unix. case "$host_os" in - vms* | cygwin* | pe | mingw* | sco* | udk* ) + *vms* | cygwin* | pe | mingw* | sco* | udk* ) gcc_cv_func_mmap_anon=no ;; *) gcc_cv_func_mmap_anon=yes;; diff --git a/gcc/Makefile.in b/gcc/Makefile.in index f5fa0c3..8fd8208 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -1650,6 +1650,7 @@ aclocal_deps = \ $(srcdir)/../config/unwind_ipinfo.m4 \ $(srcdir)/../config/warnings.m4 \ $(srcdir)/../config/dfp.m4 \ + $(srcdir)/../config/mmap.m4 \ $(srcdir)/acinclude.m4 $(srcdir)/configure: @MAINT@ $(srcdir)/configure.ac $(srcdir)/aclocal.m4 diff --git a/gcc/acinclude.m4 b/gcc/acinclude.m4 index 84b828f..c24464b 100644 --- a/gcc/acinclude.m4 +++ b/gcc/acinclude.m4 @@ -221,99 +221,6 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' AC_SUBST(INSTALL_DATA)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], -[ -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 -else - AC_CACHE_CHECK([whether read-only mmap of a plain file works], - gcc_cv_func_mmap_file, - [# Add a system to this blacklist if - # mmap(0, stat_size, PROT_READ, MAP_PRIVATE, fd, 0) doesn't return a - # memory area containing the same data that you'd get if you applied - # read() to the same fd. The only system known to have a problem here - # is VMS, where text files have record structure. - case "$host_os" in - vms* | ultrix*) - gcc_cv_func_mmap_file=no ;; - *) - gcc_cv_func_mmap_file=yes;; - esac]) - AC_CACHE_CHECK([whether mmap from /dev/zero works], - gcc_cv_func_mmap_dev_zero, - [# Add a system to this blacklist if it has mmap() but /dev/zero - # does not exist, or if mmapping /dev/zero does not give anonymous - # zeroed pages with both the following properties: - # 1. If you map N consecutive pages in with one call, and then - # unmap any subset of those pages, the pages that were not - # explicitly unmapped remain accessible. - # 2. If you map two adjacent blocks of memory and then unmap them - # both at once, they must both go away. - # Systems known to be in this category are Windows (all variants), - # VMS, and Darwin. - case "$host_os" in - vms* | cygwin* | pe | mingw* | darwin* | ultrix* | hpux10* | hpux11.00) - gcc_cv_func_mmap_dev_zero=no ;; - *) - gcc_cv_func_mmap_dev_zero=yes;; - esac]) - - # Unlike /dev/zero, the MAP_ANON(YMOUS) defines can be probed for. - AC_CACHE_CHECK([for MAP_ANON(YMOUS)], gcc_cv_decl_map_anon, - [AC_COMPILE_IFELSE([AC_LANG_PROGRAM( -[#include -#include -#include - -#ifndef MAP_ANONYMOUS -#define MAP_ANONYMOUS MAP_ANON -#endif -], -[int n = MAP_ANONYMOUS;])], - gcc_cv_decl_map_anon=yes, - gcc_cv_decl_map_anon=no)]) - - if test $gcc_cv_decl_map_anon = no; then - gcc_cv_func_mmap_anon=no - else - AC_CACHE_CHECK([whether mmap with MAP_ANON(YMOUS) works], - gcc_cv_func_mmap_anon, - [# Add a system to this blacklist if it has mmap() and MAP_ANON or - # MAP_ANONYMOUS, but using mmap(..., MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) - # doesn't give anonymous zeroed pages with the same properties listed - # above for use of /dev/zero. - # Systems known to be in this category are Windows, VMS, and SCO Unix. - case "$host_os" in - vms* | cygwin* | pe | mingw* | sco* | udk* ) - gcc_cv_func_mmap_anon=no ;; - *) - gcc_cv_func_mmap_anon=yes;; - esac]) - fi -fi - -if test $gcc_cv_func_mmap_file = yes; then - AC_DEFINE(HAVE_MMAP_FILE, 1, - [Define if read-only mmap of a plain file works.]) -fi -if test $gcc_cv_func_mmap_dev_zero = yes; then - AC_DEFINE(HAVE_MMAP_DEV_ZERO, 1, - [Define if mmap of /dev/zero works.]) -fi -if test $gcc_cv_func_mmap_anon = yes; then - AC_DEFINE(HAVE_MMAP_ANON, 1, - [Define if mmap with MAP_ANON(YMOUS) works.]) -fi -]) - dnl Determine if enumerated bitfields are unsigned. ISO C says they can dnl be either signed or unsigned. dnl diff --git a/gcc/aclocal.m4 b/gcc/aclocal.m4 index 06028cc..a992c3a 100644 --- a/gcc/aclocal.m4 +++ b/gcc/aclocal.m4 @@ -113,6 +113,7 @@ m4_include([../config/lcmessage.m4]) m4_include([../config/lib-ld.m4]) m4_include([../config/lib-link.m4]) m4_include([../config/lib-prefix.m4]) +m4_include([../config/mmap.m4]) m4_include([../config/override.m4]) m4_include([../config/picflag.m4]) m4_include([../config/progtest.m4]) diff --git a/gcc/configure.ac b/gcc/configure.ac index d860b2b..8869121 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -1059,7 +1059,7 @@ fi AC_CHECK_TYPE(ssize_t, int) AC_CHECK_TYPE(caddr_t, char *) -gcc_AC_FUNC_MMAP_BLACKLIST +GCC_AC_FUNC_MMAP_BLACKLIST case "${host}" in *-*-*vms*)