Sync config files with GCC
authorH.J. Lu <hjl.tools@gmail.com>
Tue, 14 Jul 2015 15:43:24 +0000 (08:43 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Tue, 14 Jul 2015 16:18:16 +0000 (09:18 -0700)
Sync with GCC
2015-05-13  Eric Botcazou  <ebotcazou@adacore.com>

* sjlj.m4: New file.

2015-05-04  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>

* bitfields.m4: Change int to long long, and use bitfields of
width 1 instead of 0.

2015-05-01  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>

* bitfields.m4: New file.

2015-04-14  H.J. Lu  <hongjiu.lu@intel.com>

* bootstrap-mpx.mk: New file.

2015-03-25  Uros Bizjak  <ubizjak@gmail.com>

PR bootstrap/65537
* bootstrap-lto-noplugin.mk: New build configuration.

2014-11-13  Kirill Yukhin  <kirill.yukhin@intel.com>

* target-posix: New file.

2014-10-27  Tom Tromey  <tromey@redhat.com>

* gcc-plugin.m4: New file.

config/ChangeLog
config/bitfields.m4 [new file with mode: 0644]
config/bootstrap-lto-noplugin.mk [new file with mode: 0644]
config/bootstrap-mpx.mk [new file with mode: 0644]
config/gcc-plugin.m4 [new file with mode: 0644]
config/sjlj.m4 [new file with mode: 0644]
config/target-posix [new file with mode: 0644]

index 7c6e3e01218d9a57abb3cd222839aa39eefadbdc..5e36bee0827527bb5a53ca7cacc7d70ae0cdaa9e 100644 (file)
@@ -1,3 +1,36 @@
+2015-07-14  H.J. Lu  <hongjiu.lu@intel.com>
+
+       Sync with GCC
+       2015-05-13  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * sjlj.m4: New file.
+
+       2015-05-04  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>
+
+       * bitfields.m4: Change int to long long, and use bitfields of
+       width 1 instead of 0.
+
+       2015-05-01  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>
+
+       * bitfields.m4: New file.
+
+       2015-04-14  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * bootstrap-mpx.mk: New file.
+
+       2015-03-25  Uros Bizjak  <ubizjak@gmail.com>
+
+       PR bootstrap/65537
+       * bootstrap-lto-noplugin.mk: New build configuration.
+
+       2014-11-13  Kirill Yukhin  <kirill.yukhin@intel.com>
+
+       * target-posix: New file.
+
+       2014-10-27  Tom Tromey  <tromey@redhat.com>
+
+       * gcc-plugin.m4: New file.
+
 2015-07-14  H.J. Lu  <hongjiu.lu@intel.com>
 
        Sync with GCC
diff --git a/config/bitfields.m4 b/config/bitfields.m4
new file mode 100644 (file)
index 0000000..8185cd3
--- /dev/null
@@ -0,0 +1,25 @@
+dnl Copyright (C) 2015 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License.  As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+# Define HAVE_BITFIELD_TYPE_MATTERS if the type of bitfields effects their
+# alignment.
+
+AC_DEFUN([gt_BITFIELD_TYPE_MATTERS],
+[
+  AC_CACHE_CHECK([if the type of bitfields matters], gt_cv_bitfield_type_matters,
+  [
+    AC_TRY_COMPILE(
+      [struct foo1 { char x; char y:1; char z; };
+struct foo2 { char x; long long int y:1; char z; };
+int foo1test[ sizeof (struct foo1) < sizeof (struct foo2) ? 1 : -1 ]; ],
+      [], gt_cv_bitfield_type_matters=yes, gt_cv_bitfield_type_matters=no)
+  ])
+  if test $gt_cv_bitfield_type_matters = yes; then
+    AC_DEFINE(HAVE_BITFIELD_TYPE_MATTERS, 1,
+      [Define if the type of bitfields effects alignment.])
+  fi
+])
diff --git a/config/bootstrap-lto-noplugin.mk b/config/bootstrap-lto-noplugin.mk
new file mode 100644 (file)
index 0000000..a507336
--- /dev/null
@@ -0,0 +1,6 @@
+# This option enables LTO for stage2 and stage3 on
+# hosts without linker plugin support.
+
+STAGE2_CFLAGS += -flto=jobserver -frandom-seed=1 -ffat-lto-objects
+STAGE3_CFLAGS += -flto=jobserver -frandom-seed=1 -ffat-lto-objects
+STAGEprofile_CFLAGS += -fno-lto
diff --git a/config/bootstrap-mpx.mk b/config/bootstrap-mpx.mk
new file mode 100644 (file)
index 0000000..acc2a2e
--- /dev/null
@@ -0,0 +1,9 @@
+# This option enables -fcheck-pointer-bounds -mmpx for stage2 and stage3.
+
+STAGE2_CFLAGS += -fcheck-pointer-bounds -mmpx -frandom-seed=1
+STAGE3_CFLAGS += -fcheck-pointer-bounds -mmpx -frandom-seed=1
+POSTSTAGE1_LDFLAGS += -fcheck-pointer-bounds -mmpx -frandom-seed=1 \
+                     -static-libmpx -static-libmpxwrappers \
+                     -B$$r/prev-$(TARGET_SUBDIR)/libmpx \
+                     -B$$r/prev-$(TARGET_SUBDIR)/libmpx/mpxrt/.libs \
+                     -B$$r/prev-$(TARGET_SUBDIR)/libmpx/mpxwrap/.libs
diff --git a/config/gcc-plugin.m4 b/config/gcc-plugin.m4
new file mode 100644 (file)
index 0000000..dd06a58
--- /dev/null
@@ -0,0 +1,113 @@
+# gcc-plugin.m4 -*- Autoconf -*-
+# Check whether GCC is able to be built with plugin support.
+
+dnl Copyright (C) 2014 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License.  As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+# Check for plugin support.
+# Respects --enable-plugin.
+# Sets the shell variables enable_plugin and pluginlibs.
+AC_DEFUN([GCC_ENABLE_PLUGINS],
+  [# Check for plugin support
+   AC_ARG_ENABLE(plugin,
+   [AS_HELP_STRING([--enable-plugin], [enable plugin support])],
+   enable_plugin=$enableval,
+   enable_plugin=yes; default_plugin=yes)
+
+   pluginlibs=
+
+   case "${host}" in
+     *-*-darwin*)
+       if test x$build = x$host; then
+        export_sym_check="nm${exeext} -g"
+       elif test x$host = x$target; then
+        export_sym_check="$gcc_cv_nm -g"
+       else
+        export_sym_check=
+       fi
+     ;;
+     *)
+       if test x$build = x$host; then
+        export_sym_check="objdump${exeext} -T"
+       elif test x$host = x$target; then
+        export_sym_check="$gcc_cv_objdump -T"
+       else
+        export_sym_check=
+       fi
+     ;;
+   esac
+
+   if test x"$enable_plugin" = x"yes"; then
+
+     AC_MSG_CHECKING([for exported symbols])
+     if test "x$export_sym_check" != x; then
+       echo "int main() {return 0;} int foobar() {return 0;}" > conftest.c
+       ${CC} ${CFLAGS} ${LDFLAGS} conftest.c -o conftest$ac_exeext > /dev/null 2>&1
+       if $export_sym_check conftest$ac_exeext | grep -q foobar > /dev/null; then
+        : # No need to use a flag
+        AC_MSG_RESULT([yes])
+       else
+        AC_MSG_RESULT([yes])
+        AC_MSG_CHECKING([for -rdynamic])
+        ${CC} ${CFLAGS} ${LDFLAGS} -rdynamic conftest.c -o conftest$ac_exeext > /dev/null 2>&1
+        if $export_sym_check conftest$ac_exeext | grep -q foobar > /dev/null; then
+          plugin_rdynamic=yes
+          pluginlibs="-rdynamic"
+        else
+          plugin_rdynamic=no
+          enable_plugin=no
+        fi
+        AC_MSG_RESULT([$plugin_rdynamic])
+       fi
+     else
+       AC_MSG_RESULT([unable to check])
+     fi
+
+     # Check -ldl
+     saved_LIBS="$LIBS"
+     AC_SEARCH_LIBS([dlopen], [dl])
+     if test x"$ac_cv_search_dlopen" = x"-ldl"; then
+       pluginlibs="$pluginlibs -ldl"
+     fi
+     LIBS="$saved_LIBS"
+
+     # Check that we can build shared objects with -fPIC -shared
+     saved_LDFLAGS="$LDFLAGS"
+     saved_CFLAGS="$CFLAGS"
+     case "${host}" in
+       *-*-darwin*)
+        CFLAGS=`echo $CFLAGS | sed s/-mdynamic-no-pic//g`
+        CFLAGS="$CFLAGS -fPIC"
+        LDFLAGS="$LDFLAGS -shared -undefined dynamic_lookup"
+       ;;
+       *)
+        CFLAGS="$CFLAGS -fPIC"
+        LDFLAGS="$LDFLAGS -fPIC -shared"
+       ;;
+     esac
+     AC_MSG_CHECKING([for -fPIC -shared])
+     AC_TRY_LINK(
+       [extern int X;],[return X == 0;],
+       [AC_MSG_RESULT([yes]); have_pic_shared=yes],
+       [AC_MSG_RESULT([no]); have_pic_shared=no])
+     if test x"$have_pic_shared" != x"yes" -o x"$ac_cv_search_dlopen" = x"no"; then
+       pluginlibs=
+       enable_plugin=no
+     fi
+     LDFLAGS="$saved_LDFLAGS"
+     CFLAGS="$saved_CFLAGS"
+
+     # If plugin support had been requested but not available, fail.
+     if test x"$enable_plugin" = x"no" ; then
+       if test x"$default_plugin" != x"yes"; then
+        AC_MSG_ERROR([
+   Building GCC with plugin support requires a host that supports
+   -fPIC, -shared, -ldl and -rdynamic.])
+       fi
+     fi
+   fi
+])
diff --git a/config/sjlj.m4 b/config/sjlj.m4
new file mode 100644 (file)
index 0000000..71c8b31
--- /dev/null
@@ -0,0 +1,12 @@
+dnl Check if the compiler is configured for setjmp/longjmp exceptions.
+AC_DEFUN([GCC_CHECK_SJLJ_EXCEPTIONS],
+  [AC_CACHE_CHECK([whether the compiler is configured for setjmp/longjmp exceptions],
+    ac_cv_sjlj_exceptions,
+    [AC_COMPILE_IFELSE(
+      [AC_LANG_PROGRAM(
+        [[#ifdef __USING_SJLJ_EXCEPTIONS__
+          this will fail
+          #endif]],
+        [[int i;]])],
+      [ac_cv_sjlj_exceptions=no],
+      [ac_cv_sjlj_exceptions=yes])])])
diff --git a/config/target-posix b/config/target-posix
new file mode 100644 (file)
index 0000000..2fba066
--- /dev/null
@@ -0,0 +1,12 @@
+case "${target}" in
+  *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu | *-*-kopensolaris*-gnu)
+      ;;
+  *-*-netbsd* | *-*-freebsd* | *-*-openbsd* | *-*-dragonfly*)
+      ;;
+  *-*-solaris2* | *-*-hpux11*)
+      ;;
+  *-*-darwin* | *-*-aix*)
+      ;;
+  *)
+      UNSUPPORTED=1 ;;
+  esac