From patchwork Thu Nov 3 18:26:28 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aldy Hernandez X-Patchwork-Id: 123488 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 729CEB6F18 for ; Fri, 4 Nov 2011 05:26:53 +1100 (EST) Received: (qmail 6456 invoked by alias); 3 Nov 2011 18:26:50 -0000 Received: (qmail 6444 invoked by uid 22791); 3 Nov 2011 18:26:48 -0000 X-SWARE-Spam-Status: No, hits=-7.1 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 03 Nov 2011 18:26:29 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id pA3IQToD032521 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 3 Nov 2011 14:26:29 -0400 Received: from houston.quesejoda.com (vpn-236-154.phx2.redhat.com [10.3.236.154]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id pA3IQSTZ032161 for ; Thu, 3 Nov 2011 14:26:29 -0400 Message-ID: <4EB2DCD4.6040302@redhat.com> Date: Thu, 03 Nov 2011 13:26:28 -0500 From: Aldy Hernandez User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0) Gecko/20110927 Thunderbird/7.0 MIME-Version: 1.0 To: gcc-patches Subject: [patch] 8d/n: trans-mem: toplevel/misc changes (configury/makefile/config) 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 +]) Index: ChangeLog.tm =================================================================== --- ChangeLog.tm (.../trunk) (revision 0) +++ ChangeLog.tm (.../branches/transactional-memory) (revision 180773) @@ -0,0 +1,89 @@ +2011-11-02 Aldy Hernandez + + * Merge from mainline rev 180744. + +2011-09-14 Aldy Hernandez + + * Merge from mainline rev 178608. + +2010-04-14 Aldy Hernandez + + * Merge from mainline rev 158257. + +2010-03-31 Richard Henderson + + * Makefile.in: Rebuild. + +2010-02-10 Aldy Hernandez + + * Merge from mainline rev 156607. + +2009-11-13 Richard Henderson + + * Makefile.def (lang_env_dependencies): libitm is c++. + * Makefile.in: Rebuild. + +2009-11-03 Richard Henderson + + * config/mmap.m4: New file. + +2009-10-28 Richard Henderson + + * Merge from mainline rev 153678. + +2009-10-14 Richard Henderson + + * Merge from mainline rev 152728. + +2009-10-13 Richard Henderson + + * Merge from mainline rev 152433. + +2009-09-09 Aldy Hernandez + + * Merge from mainline rev 150253:151506. + +2009-07-31 Richard Henderson + + * Merge from mainline rev 150253. + +2009-07-17 Richard Henderson + + * Merge from mainline rev 149731. + +2009-06-26 Richard Henderson + + * Merge from mainline rev 148984. + +2009-06-18 Richard Henderson + + * Merge from mainline rev 148549. + +2008-11-21 Richard Henderson + + * Makefile.def: Add libitm target module. + * configure.ac: Likewise. + * Makefile.in, configure: Rebuild. + +2008-10-27 Richard Henderson + + Merge from mainline rev 141397. + Index: Makefile.def =================================================================== --- Makefile.def (.../trunk) (revision 180744) +++ Makefile.def (.../branches/transactional-memory) (revision 180773) @@ -139,6 +139,7 @@ target_modules = { module= boehm-gc; }; target_modules = { module= rda; }; target_modules = { module= libada; }; target_modules = { module= libgomp; bootstrap= true; lib_path=.libs; }; +target_modules = { module= libitm; lib_path=.libs; }; // These are (some of) the make targets to be done in each subdirectory. // Not all; these are the ones which don't have special options. @@ -470,6 +471,7 @@ dependencies = { module=all-m4; on=all-b // environment (e.g. on libstdc++). By default target modules depend // on libgcc and newlib/libgloss. lang_env_dependencies = { module=libjava; cxx=true; }; +lang_env_dependencies = { module=libitm; cxx=true; }; lang_env_dependencies = { module=newlib; no_c=true; }; lang_env_dependencies = { module=libgloss; no_c=true; }; lang_env_dependencies = { module=libgcc; no_gcc=true; no_c=true; }; Index: configure.ac =================================================================== --- configure.ac (.../trunk) (revision 180744) +++ configure.ac (.../branches/transactional-memory) (revision 180773) @@ -154,6 +154,7 @@ target_libraries="target-libgcc \ target-libgloss \ target-newlib \ target-libgomp \ + target-libitm \ target-libstdc++-v3 \ target-libmudflap \ target-libssp \ @@ -492,6 +493,24 @@ if test x$enable_libgomp = x ; then esac fi +# Disable libitm on non POSIX hosted systems. +if test x$enable_libitm = x ; then + # Enable libitm by default on hosted POSIX systems. + case "${target}" in + *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu) + ;; + *-*-netbsd* | *-*-freebsd* | *-*-openbsd*) + ;; + *-*-solaris2* | *-*-sysv4* | *-*-irix6* | *-*-osf* | *-*-hpux11*) + ;; + *-*-darwin* | *-*-aix*) + ;; + *) + noconfigdirs="$noconfigdirs target-libitm" + ;; + esac +fi + # Disable libssp for some systems. case "${target}" in avr-*-*) Index: configure =================================================================== --- configure (.../trunk) (revision 180744) +++ configure (.../branches/transactional-memory) (revision 180773) @@ -2681,6 +2681,7 @@ target_libraries="target-libgcc \ target-libgloss \ target-newlib \ target-libgomp \ + target-libitm \ target-libstdc++-v3 \ target-libmudflap \ target-libssp \ @@ -3056,6 +3057,24 @@ if test x$enable_libgomp = x ; then esac fi +# Disable libitm on non POSIX hosted systems. +if test x$enable_libitm = x ; then + # Enable libitm by default on hosted POSIX systems. + case "${target}" in + *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu) + ;; + *-*-netbsd* | *-*-freebsd* | *-*-openbsd*) + ;; + *-*-solaris2* | *-*-sysv4* | *-*-irix6* | *-*-osf* | *-*-hpux11*) + ;; + *-*-darwin* | *-*-aix*) + ;; + *) + noconfigdirs="$noconfigdirs target-libitm" + ;; + esac +fi + # Disable libssp for some systems. case "${target}" in avr-*-*) Index: config/mmap.m4 =================================================================== --- config/mmap.m4 (.../trunk) (revision 0) +++ config/mmap.m4 (.../branches/transactional-memory) (revision 180773) @@ -0,0 +1,97 @@ +dnl ---------------------------------------------------------------------- +dnl This whole bit snagged from gcc + +dnl +dnl mmap(2) blacklisting. Some platforms provide the mmap library routine +dnl but don't support all of the features we need from it. +dnl +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