summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@baserock.org>2015-04-22 10:21:45 +0000
committer <>2015-04-25 21:44:09 +0000
commitf80b5ea1605c9f9408c5aa386ba71c16d918ebbf (patch)
treebb7eafaa81fc4b8c5c215bc08d517fd158db234a /config
parentc27a97d04853380f1e80525391b3f0d156ed4c84 (diff)
downloadgcc-tarball-f80b5ea1605c9f9408c5aa386ba71c16d918ebbf.tar.gz
Imported from /home/lorry/working-area/delta_gcc-tarball/gcc-5.1.0.tar.bz2.gcc-5.1.0
Diffstat (limited to 'config')
-rw-r--r--config/ChangeLog89
-rw-r--r--config/bootstrap-asan.mk3
-rw-r--r--config/bootstrap-lto-noplugin.mk6
-rw-r--r--config/bootstrap-lto.mk16
-rw-r--r--config/cloog.m4152
-rw-r--r--config/elf.m47
-rw-r--r--config/gcc-plugin.m4113
-rw-r--r--config/isl.m424
-rw-r--r--config/mh-darwin31
-rw-r--r--config/mt-gnu2
-rw-r--r--config/mt-nios2-elf5
-rw-r--r--config/mt-ospace4
-rw-r--r--config/picflag.m412
-rw-r--r--config/plugins.m426
-rw-r--r--config/target-posix12
15 files changed, 296 insertions, 206 deletions
diff --git a/config/ChangeLog b/config/ChangeLog
index e569d7aed4..290938e52b 100644
--- a/config/ChangeLog
+++ b/config/ChangeLog
@@ -1,19 +1,96 @@
-2014-10-30 Release Manager
+2015-04-22 Release Manager
- * GCC 4.9.2 released.
+ * GCC 5.1.0 released.
+
+2015-04-10 Jakub Jelinek <jakub@redhat.com>
+ Iain Sandoe <iain@codesourcery.com>
+
+ PR target/65351
+ * mh-darwin: Only apply -mdynamic-no-pic for m32 Darwin when the
+ compiler in use supports -mno-dynamic-no-pic.
+ * picflag.m4: Only append -mno-dynamic-no-pic for Darwin when
+ -mdynamic-no-pic is present in CFLAGS.
+
+2015-04-07 Jakub Jelinek <jakub@redhat.com>
+ Iain Sandoe <iain@codesourcery.com>
+
+ PR target/65351
+ * picflag.m4: Append -mno-dynamic-no-pic for Darwin.
+
+2015-03-25 Uros Bizjak <ubizjak@gmail.com>
+
+ PR bootstrap/65537
+ * bootstrap-lto-noplugin.mk: New build configuration.
+
+2015-02-18 Thomas Schwinge <thomas@codesourcery.com>
+
+ * elf.m4 (ACX_ELF_TARGET_IFELSE): nvptx-*-none isn't ELF.
+
+2014-11-17 Bob Dunlop <bob.dunlop@xyzzy.org.uk>
+
+ * mt-ospace (CFLAGS_FOR_TARGET): Append -g -Os rather than
+ overwriting.
+ (CXXFLAGS_FOR_TARGET): Similarly.
+
+2014-11-17 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR bootstrap/63888
+ * bootstrap-asan.mk (ASAN_OPTIONS): Export "detect_leaks=0".
+
+2014-11-13 Kirill Yukhin <kirill.yukhin@intel.com>
+
+ * target-posix: New file.
+
+2014-11-11 Tobias Burnus <burnus@net-b.de>
+
+ * cloog.m4: Remove.
+
+2014-10-27 Tom Tromey <tromey@redhat.com>
+
+ * gcc-plugin.m4: New file.
+
+2014-09-01 Andi Kleen <ak@linux.intel.com>
+
+ * bootstrap-lto.mk: Implement slim bootstrap.
+
+2014-08-21 Bin Cheng <bin.cheng@arm.com>
+
+ * isl.m4 (ISL_CHECK_VERSION): Check link of isl library
+ for cross_compiling.
+
+2014-08-19 Alan Modra <amodra@gmail.com>
+
+ * plugins.m4 (AC_PLUGINS): If plugins are enabled, add -ldl to
+ LIBS via AC_SEARCH_LIBS.
+
+2014-08-18 Roman Gareev <gareevroman@gmail.com>
+
+ * cloog.m4: Remove the path to isllibs from clooglibs.
+ * isl.m4: Add paths to islinc, isllibs.
+
+2014-08-14 Alan Modra <amodra@gmail.com>
+
+ * plugins.m4: Test for dlfcn.h or windows.h here to set default
+ for --enable-plugins. Report error if someone tries to enable
+ plugins on a host we don't support.
2014-07-26 Uros Bizjak <ubizjak@gmail.com>
PR target/47230
* mh-alpha-linux: New file.
-2014-07-16 Release Manager
+2014-05-14 Sandra Loosemore <sandra@codesourcery.com>
+
+ * mt-nios2-elf: New file.
+
+2014-04-25 Marc Glisse <marc.glisse@inria.fr>
- * GCC 4.9.1 released.
+ PR target/43538
+ * mt-gnu: Don't reset CXXFLAGS_FOR_TARGET.
-2014-04-22 Release Manager
+2013-12-07 Mike Frysinger <vapier@gentoo.org>
- * GCC 4.9.0 released.
+ * acinclude.m4: Remove +x file mode.
2013-11-29 Marek Polacek <polacek@redhat.com>
diff --git a/config/bootstrap-asan.mk b/config/bootstrap-asan.mk
index fbef02125d..52ef30e99c 100644
--- a/config/bootstrap-asan.mk
+++ b/config/bootstrap-asan.mk
@@ -1,5 +1,8 @@
# This option enables -fsanitize=address for stage2 and stage3.
+# Suppress LeakSanitizer in bootstrap.
+export ASAN_OPTIONS="detect_leaks=0"
+
STAGE2_CFLAGS += -fsanitize=address
STAGE3_CFLAGS += -fsanitize=address
POSTSTAGE1_LDFLAGS += -fsanitize=address -static-libasan \
diff --git a/config/bootstrap-lto-noplugin.mk b/config/bootstrap-lto-noplugin.mk
new file mode 100644
index 0000000000..a5073365b5
--- /dev/null
+++ b/config/bootstrap-lto-noplugin.mk
@@ -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-lto.mk b/config/bootstrap-lto.mk
index 27bad1529b..9e065e1d85 100644
--- a/config/bootstrap-lto.mk
+++ b/config/bootstrap-lto.mk
@@ -1,7 +1,13 @@
-# This option enables LTO for stage2 and stage3.
-# FIXME: Our build system is not yet able to use gcc-ar wrapper, so we need
-# to go with -ffat-lto-objects.
+# This option enables LTO for stage2 and stage3 in slim mode
-STAGE2_CFLAGS += -flto=jobserver -frandom-seed=1 -ffat-lto-objects
-STAGE3_CFLAGS += -flto=jobserver -frandom-seed=1 -ffat-lto-objects
+STAGE2_CFLAGS += -flto=jobserver -frandom-seed=1
+STAGE3_CFLAGS += -flto=jobserver -frandom-seed=1
STAGEprofile_CFLAGS += -fno-lto
+
+# assumes the host supports the linker plugin
+LTO_AR = $$r/$(HOST_SUBDIR)/prev-gcc/gcc-ar$(exeext) -B$$r/$(HOST_SUBDIR)/prev-gcc/
+LTO_RANLIB = $$r/$(HOST_SUBDIR)/prev-gcc/gcc-ranlib$(exeext) -B$$r/$(HOST_SUBDIR)/prev-gcc/
+
+LTO_EXPORTS = AR="$(LTO_AR)"; export AR; \
+ RANLIB="$(LTO_RANLIB)"; export RANLIB;
+LTO_FLAGS_TO_PASS = AR="$(LTO_AR)" RANLIB="$(LTO_RANLIB)"
diff --git a/config/cloog.m4 b/config/cloog.m4
deleted file mode 100644
index 670cd652fc..0000000000
--- a/config/cloog.m4
+++ /dev/null
@@ -1,152 +0,0 @@
-# This file is part of GCC.
-#
-# GCC is free software; you can redistribute it and/or modify it under
-# the terms of the GNU General Public License as published by the Free
-# Software Foundation; either version 3, or (at your option) any later
-# version.
-#
-# GCC is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with GCC; see the file COPYING3. If not see
-# <http://www.gnu.org/licenses/>.
-#
-# Contributed by Andreas Simbuerger <simbuerg@fim.uni-passau.de>
-
-# CLOOG_INIT_FLAGS ()
-# -------------------------
-# Provide configure switches for CLooG support.
-# Initialize clooglibs/clooginc according to the user input.
-AC_DEFUN([CLOOG_INIT_FLAGS],
-[
- AC_ARG_WITH([cloog-include],
- [AS_HELP_STRING(
- [--with-cloog-include=PATH],
- [Specify directory for installed CLooG include files])])
- AC_ARG_WITH([cloog-lib],
- [AS_HELP_STRING(
- [--with-cloog-lib=PATH],
- [Specify the directory for the installed CLooG library])])
-
- AC_ARG_ENABLE(cloog-version-check,
- [AS_HELP_STRING(
- [--disable-cloog-version-check],
- [disable check for CLooG version])],
- ENABLE_CLOOG_CHECK=$enableval,
- ENABLE_CLOOG_CHECK=yes)
-
- # Initialize clooglibs and clooginc.
- case $with_cloog in
- no)
- clooglibs=
- clooginc=
- ;;
- "" | yes)
- ;;
- *)
- clooglibs="-L$with_cloog/lib"
- clooginc="-I$with_cloog/include"
- ;;
- esac
- if test "x${with_cloog_include}" != x ; then
- clooginc="-I$with_cloog_include"
- fi
- if test "x${with_cloog_lib}" != x; then
- clooglibs="-L$with_cloog_lib"
- fi
- dnl If no --with-cloog flag was specified and there is in-tree CLooG
- dnl source, set up flags to use that and skip any version tests
- dnl as we cannot run them reliably before building CLooG
- if test "x${clooginc}" = x && test "x${clooglibs}" = x \
- && test -d ${srcdir}/cloog; then
- clooglibs='-L$$r/$(HOST_SUBDIR)/cloog/'"$lt_cv_objdir"' '
- clooginc='-I$$r/$(HOST_SUBDIR)/cloog/include -I$$s/cloog/include -I'${srcdir}'/cloog/include '
- ENABLE_CLOOG_CHECK=no
- AC_MSG_WARN([using in-tree CLooG, disabling version check])
- fi
-
- clooginc="-DCLOOG_INT_GMP ${clooginc}"
- clooglibs="${clooglibs} -lcloog-isl ${isllibs} -lisl"
-]
-)
-
-# CLOOG_REQUESTED (ACTION-IF-REQUESTED, ACTION-IF-NOT)
-# ----------------------------------------------------
-# Provide actions for failed CLooG detection.
-AC_DEFUN([CLOOG_REQUESTED],
-[
- AC_REQUIRE([CLOOG_INIT_FLAGS])
-
- if test "x${with_cloog}" = xno; then
- $2
- elif test "x${with_cloog}" != x \
- || test "x${with_cloog_include}" != x \
- || test "x${with_cloog_lib}" != x ; then
- $1
- else
- $2
- fi
-]
-)
-
-# _CLOOG_CHECK_CT_PROG(MAJOR, MINOR, REVISION)
-# --------------------------------------------
-# Helper for verifying CLooG's compile time version.
-m4_define([_CLOOG_CHECK_CT_PROG],[AC_LANG_PROGRAM(
- [#include "cloog/version.h"],
- [#if CLOOG_VERSION_MAJOR != $1 \
- || CLOOG_VERSION_MINOR != $2 \
- || CLOOG_VERSION_REVISION < $3
- choke me
- #endif])])
-
-# CLOOG_CHECK_VERSION CLOOG_CHECK_VERSION (MAJOR, MINOR, REVISION)
-# ----------------------------------------------------------------
-# Test the found CLooG to be exact of version MAJOR.MINOR and at least
-# REVISION.
-AC_DEFUN([CLOOG_CHECK_VERSION],
-[
- AC_REQUIRE([CLOOG_INIT_FLAGS])
-
- if test "${ENABLE_CLOOG_CHECK}" = yes ; then
- _cloog_saved_CFLAGS=$CFLAGS
- _cloog_saved_LDFLAGS=$LDFLAGS
-
- CFLAGS="${_cloog_saved_CFLAGS} ${clooginc} ${islinc} ${gmpinc}"
- LDFLAGS="${_cloog_saved_LDFLAGS} ${clooglibs} ${isllibs} ${gmplib}"
-
- AC_MSG_CHECKING([for version $1.$2.$3 of CLooG])
- AC_COMPILE_IFELSE([_CLOOG_CHECK_CT_PROG($1,$2,$3)],
- [gcc_cv_cloog=yes],
- [gcc_cv_cloog=no])
- AC_MSG_RESULT([$gcc_cv_cloog])
-
- CFLAGS=$_cloog_saved_CFLAGS
- LDFLAGS=$_cloog_saved_LDFLAGS
- fi
-]
-)
-
-# CLOOG_IF_FAILED (ACTION-IF-FAILED)
-# ----------------------------------
-# Executes ACTION-IF-FAILED, if GRAPHITE was requested and
-# the checks failed.
-AC_DEFUN([CLOOG_IF_FAILED],
-[
- CLOOG_REQUESTED([graphite_requested=yes], [graphite_requested=no])
-
- if test "${gcc_cv_cloog}" = no ; then
- clooglibs=
- clooginc=
- fi
-
- if test "${graphite_requested}" = yes \
- && test "x${clooglibs}" = x \
- && test "x${clooginc}" = x ; then
- $1
- fi
-]
-)
diff --git a/config/elf.m4 b/config/elf.m4
index da051cbe61..1772a44318 100644
--- a/config/elf.m4
+++ b/config/elf.m4
@@ -1,4 +1,4 @@
-dnl Copyright (C) 2010, 2011 Free Software Foundation, Inc.
+dnl Copyright (C) 2010, 2011, 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
@@ -7,6 +7,8 @@ dnl the same distribution terms as the rest of that program.
dnl From Paolo Bonzini.
+dnl Is this an ELF target supporting the LTO plugin?
+
dnl usage: ACX_ELF_TARGET_IFELSE([if-elf], [if-not-elf])
AC_DEFUN([ACX_ELF_TARGET_IFELSE], [
AC_REQUIRE([AC_CANONICAL_TARGET])
@@ -15,7 +17,8 @@ target_elf=no
case $target in
*-darwin* | *-aix* | *-cygwin* | *-mingw* | *-aout* | *-*coff* | \
*-msdosdjgpp* | *-vms* | *-wince* | *-*-pe* | \
- alpha*-dec-osf* | *-interix* | hppa[[12]]*-*-hpux*)
+ alpha*-dec-osf* | *-interix* | hppa[[12]]*-*-hpux* | \
+ nvptx-*-none)
target_elf=no
;;
*)
diff --git a/config/gcc-plugin.m4 b/config/gcc-plugin.m4
new file mode 100644
index 0000000000..dd06a58cd1
--- /dev/null
+++ b/config/gcc-plugin.m4
@@ -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/isl.m4 b/config/isl.m4
index f45854d222..459fac1e3e 100644
--- a/config/isl.m4
+++ b/config/isl.m4
@@ -68,6 +68,8 @@ AC_DEFUN([ISL_INIT_FLAGS],
ENABLE_ISL_CHECK=no
AC_MSG_WARN([using in-tree ISL, disabling version check])
fi
+
+ isllibs="${isllibs} -lisl"
]
)
@@ -90,20 +92,9 @@ AC_DEFUN([ISL_REQUESTED],
]
)
-# _ISL_CHECK_CT_PROG(MAJOR, MINOR)
-# --------------------------------------------
-# Helper for verifying ISL compile time version.
-m4_define([_ISL_CHECK_CT_PROG],[AC_LANG_PROGRAM(
- [#include <isl/version.h>
- #include <string.h>],
- [if (strncmp (isl_version (), "isl-$1.$2", strlen ("isl-$1.$2")) != 0)
- return 1;
- ])])
-
-# ISL_CHECK_VERSION ISL_CHECK_VERSION (MAJOR, MINOR)
+# ISL_CHECK_VERSION ISL_CHECK_VERSION ()
# ----------------------------------------------------------------
-# Test the found ISL to be exact of version MAJOR.MINOR and at least
-# REVISION.
+# Test that ISL contains functionality added to the minimum expected version.
AC_DEFUN([ISL_CHECK_VERSION],
[
if test "${ENABLE_ISL_CHECK}" = yes ; then
@@ -115,11 +106,10 @@ AC_DEFUN([ISL_CHECK_VERSION],
LDFLAGS="${_isl_saved_LDFLAGS} ${isllibs}"
LIBS="${_isl_saved_LIBS} -lisl"
- AC_MSG_CHECKING([for version $1.$2 of ISL])
- AC_RUN_IFELSE([_ISL_CHECK_CT_PROG($1,$2)],
+ AC_MSG_CHECKING([for compatible ISL])
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <isl/val.h>]], [[;]])],
[gcc_cv_isl=yes],
- [gcc_cv_isl=no],
- [gcc_cv_isl=yes])
+ [gcc_cv_isl=no])
AC_MSG_RESULT([$gcc_cv_isl])
CFLAGS=$_isl_saved_CFLAGS
diff --git a/config/mh-darwin b/config/mh-darwin
index a039f20141..148b73038c 100644
--- a/config/mh-darwin
+++ b/config/mh-darwin
@@ -1,18 +1,29 @@
# The -mdynamic-no-pic ensures that the compiler executable is built without
# position-independent-code -- the usual default on Darwin. This fix speeds
-# compiles by 3-5%.
-BOOT_CFLAGS += \
+# compiles by 3-5%. Don't add it if the compiler doesn't also support
+# -mno-dynamic-no-pic to undo it.
+DARWIN_MDYNAMIC_NO_PIC := \
`case ${host} in i?86-*-darwin* | powerpc-*-darwin*) \
- echo -mdynamic-no-pic ;; esac;`
+ $(CC) -S -xc /dev/null -o /dev/null -mno-dynamic-no-pic 2>/dev/null \
+ && echo -mdynamic-no-pic ;; esac`
+DARWIN_GCC_MDYNAMIC_NO_PIC := \
+`case ${host} in i?86-*-darwin* | powerpc-*-darwin*) \
+ $(CC) -S -xc /dev/null -o /dev/null -mno-dynamic-no-pic 2>/dev/null \
+ || echo -mdynamic-no-pic ;; esac`
# ld on Darwin versions >= 10.7 defaults to PIE executables. Disable this for
# gcc components, since it is incompatible with our pch implementation.
-BOOT_LDFLAGS += \
-`case ${host} in *-*-darwin[1][1-9]*) echo -Wl,-no_pie ;; esac;`
+DARWIN_NO_PIE := `case ${host} in *-*-darwin[1][1-9]*) echo -Wl,-no_pie ;; esac;`
+
+BOOT_CFLAGS += $(DARWIN_MDYNAMIC_NO_PIC)
+BOOT_LDFLAGS += $(DARWIN_NO_PIE)
# Similarly, for cross-compilation.
-STAGE1_CFLAGS += \
-`case ${host} in i?86-*-darwin* | powerpc-*-darwin*)\
- echo -mdynamic-no-pic ;; esac;`
-STAGE1_LDFLAGS += \
-`case ${host} in *-*-darwin[1][1-9]*) echo -Wl,-no_pie ;; esac;`
+STAGE1_CFLAGS += $(DARWIN_MDYNAMIC_NO_PIC)
+STAGE1_LDFLAGS += $(DARWIN_NO_PIE)
+
+# Without -mno-dynamic-no-pic support, add -mdynamic-no-pic just to later
+# stages when we know it is built with gcc.
+STAGE2_CFLAGS += $(DARWIN_GCC_MDYNAMIC_NO_PIC)
+STAGE3_CFLAGS += $(DARWIN_GCC_MDYNAMIC_NO_PIC)
+STAGE4_CFLAGS += $(DARWIN_GCC_MDYNAMIC_NO_PIC)
diff --git a/config/mt-gnu b/config/mt-gnu
index 15bf417160..5c696f51b0 100644
--- a/config/mt-gnu
+++ b/config/mt-gnu
@@ -1 +1 @@
-CXXFLAGS_FOR_TARGET = $(CXXFLAGS) -D_GNU_SOURCE
+CXXFLAGS_FOR_TARGET += -D_GNU_SOURCE
diff --git a/config/mt-nios2-elf b/config/mt-nios2-elf
new file mode 100644
index 0000000000..1dee7c6439
--- /dev/null
+++ b/config/mt-nios2-elf
@@ -0,0 +1,5 @@
+# We build library code with -mno-gpopt so that it can be linked with
+# larger executables with small-data sections that exceed the 16-bit
+# offset range for GP-relative addressing.
+CFLAGS_FOR_TARGET += -mno-gpopt
+CXXFLAGS_FOR_TARGET += -mno-gpopt
diff --git a/config/mt-ospace b/config/mt-ospace
index 7f091041d8..ce29ff4315 100644
--- a/config/mt-ospace
+++ b/config/mt-ospace
@@ -1,3 +1,3 @@
# Build libraries optimizing for space, not speed.
- CFLAGS_FOR_TARGET = -g -Os
- CXXFLAGS_FOR_TARGET = -g -Os
+ CFLAGS_FOR_TARGET += -g -Os
+ CXXFLAGS_FOR_TARGET += -g -Os
diff --git a/config/picflag.m4 b/config/picflag.m4
index 3bcdbf1de3..2f5b9721eb 100644
--- a/config/picflag.m4
+++ b/config/picflag.m4
@@ -7,9 +7,15 @@ AC_DEFUN([_GCC_PICFLAG], [
case "${$2}" in
# PIC is the default on some targets or must not be used.
*-*-darwin*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- $1=-fno-common
+ # For darwin, common symbols are not allowed in MH_DYLIB files
+ case "${CFLAGS}" in
+ # If we are using a compiler supporting mdynamic-no-pic
+ # and the option has been tested as safe to add, then cancel
+ # it here, since the code generated is incompatible with shared
+ # libs.
+ *-mdynamic-no-pic*) $1='-fno-common -mno-dynamic-no-pic' ;;
+ *) $1=-fno-common ;;
+ esac
;;
alpha*-dec-osf5*)
# PIC is the default.
diff --git a/config/plugins.m4 b/config/plugins.m4
index 7ee8412aa3..513c690e1b 100644
--- a/config/plugins.m4
+++ b/config/plugins.m4
@@ -1,11 +1,21 @@
AC_DEFUN([AC_PLUGINS],
[
-AC_ARG_ENABLE([plugins],
-AS_HELP_STRING([--enable-plugins], [Enable support for plugins (defaults no)]),
-[case "${enableval}" in
- yes | "") plugins=yes ;;
- no) plugins=no ;;
- *) plugins=yes ;;
- esac],
-[plugins=no])
+ maybe_plugins=no
+ AC_CHECK_HEADERS([dlfcn.h], [maybe_plugins=yes], [], [AC_INCLUDES_DEFAULT])
+ AC_CHECK_HEADERS([windows.h], [maybe_plugins=yes], [], [AC_INCLUDES_DEFAULT])
+
+ AC_ARG_ENABLE([plugins],
+ AS_HELP_STRING([--enable-plugins], [Enable support for plugins]),
+ [case "${enableval}" in
+ no) plugins=no ;;
+ *) plugins=yes
+ if test "$maybe_plugins" != "yes" ; then
+ AC_MSG_ERROR([Building with plugin support requires a host that supports dlopen.])
+ fi ;;
+ esac],
+ [plugins=$maybe_plugins]
+ )
+ if test "$plugins" = "yes"; then
+ AC_SEARCH_LIBS([dlopen], [dl])
+ fi
])
diff --git a/config/target-posix b/config/target-posix
new file mode 100644
index 0000000000..2fba066c61
--- /dev/null
+++ b/config/target-posix
@@ -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