Patchwork 8d/n: trans-mem: toplevel/misc changes (configury/makefile/config)

login
register
mail settings
Submitter Aldy Hernandez
Date Nov. 3, 2011, 6:26 p.m.
Message ID <4EB2DCD4.6040302@redhat.com>
Download mbox | patch
Permalink /patch/123488/
State New
Headers show

Comments

Aldy Hernandez - Nov. 3, 2011, 6:26 p.m.
+])

Patch

Index: ChangeLog.tm
===================================================================
--- ChangeLog.tm	(.../trunk)	(revision 0)
+++ ChangeLog.tm	(.../branches/transactional-memory)	(revision 180773)
@@ -0,0 +1,89 @@ 
+2011-11-02  Aldy Hernandez  <aldyh@redhat.com>
+
+	* Merge from mainline rev 180744.
+
+2011-09-14  Aldy Hernandez  <aldyh@redhat.com>
+
+	* Merge from mainline rev 178608.
+
+2010-04-14  Aldy Hernandez  <aldyh@redhat.com>
+
+	* Merge from mainline rev 158257.
+
+2010-03-31  Richard Henderson  <rth@redhat.com>
+
+	* Makefile.in: Rebuild.
+
+2010-02-10  Aldy Hernandez  <aldyh@redhat.com>
+
+	* Merge from mainline rev 156607.
+
+2009-11-13  Richard Henderson  <rth@redhat.com>
+
+	* Makefile.def (lang_env_dependencies): libitm is c++.
+	* Makefile.in: Rebuild.
+
+2009-11-03  Richard Henderson  <rth@redhat.com>
+
+	* config/mmap.m4: New file.
+
+2009-10-28  Richard Henderson  <rth@redhat.com>
+
+	* Merge from mainline rev 153678.
+
+2009-10-14  Richard Henderson  <rth@redhat.com>
+
+	* Merge from mainline rev 152728.
+
+2009-10-13  Richard Henderson  <rth@redhat.com>
+
+	* Merge from mainline rev 152433.
+
+2009-09-09  Aldy Hernandez  <aldyh@redhat.com>
+
+	* Merge from mainline rev 150253:151506.
+
+2009-07-31  Richard Henderson  <rth@redhat.com>
+
+	* Merge from mainline rev 150253.
+
+2009-07-17  Richard Henderson  <rth@redhat.com>
+
+	* Merge from mainline rev 149731.
+
+2009-06-26  Richard Henderson  <rth@redhat.com>
+
+	* Merge from mainline rev 148984.
+
+2009-06-18  Richard Henderson  <rth@redhat.com>
+
+	* Merge from mainline rev 148549.
+
+2008-11-21  Richard Henderson  <rth@redhat.com>
+
+	* Makefile.def: Add libitm target module.
+	* configure.ac: Likewise.
+	* Makefile.in, configure: Rebuild.
+
+2008-10-27  Richard Henderson  <rth@redhat.com>
+
+	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 <sys/types.h>
+#include <sys/mman.h>
+#include <unistd.h>
+
+#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