summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@baserock.org>2013-04-11 09:13:11 +0000
committer <>2014-04-23 12:05:38 +0000
commit6af3fdec2262dd94954acc5e426ef71cbd4521d3 (patch)
tree9be02de9a80f7935892a2d03741adee44723e65d /config
parent19be2b4342ac32e9edc78ce6fed8f61b63ae98d1 (diff)
downloadgcc-tarball-6af3fdec2262dd94954acc5e426ef71cbd4521d3.tar.gz
Imported from /home/lorry/working-area/delta_gcc-tarball/gcc-4.7.3.tar.bz2.gcc-4.7.3
Diffstat (limited to 'config')
-rw-r--r--config/ChangeLog98
-rw-r--r--config/acx.m48
-rw-r--r--config/asmcfi.m415
-rw-r--r--config/elf.m44
-rw-r--r--config/mh-cxux5
-rw-r--r--config/mh-cygwin7
-rw-r--r--config/mh-decstation3
-rw-r--r--config/mh-dgux3865
-rw-r--r--config/mh-interix7
-rw-r--r--config/mh-lynxrs6k2
-rw-r--r--config/mh-ncr30004
-rw-r--r--config/mh-necv44
-rw-r--r--config/mh-sco4
-rw-r--r--config/mh-solaris2
-rw-r--r--config/mh-sysv44
-rw-r--r--config/mh-sysv54
-rw-r--r--config/mh-x86omitfp2
-rw-r--r--config/mmap.m497
-rw-r--r--config/mt-alphaieee1
-rw-r--r--config/mt-mep8
-rw-r--r--config/mt-netware1
-rw-r--r--config/mt-v8103
-rw-r--r--config/mt-wince10
-rw-r--r--config/picflag.m492
-rw-r--r--config/warnings.m424
-rw-r--r--config/weakref.m448
26 files changed, 367 insertions, 95 deletions
diff --git a/config/ChangeLog b/config/ChangeLog
index c05876f6b9..cc4d6cb2e3 100644
--- a/config/ChangeLog
+++ b/config/ChangeLog
@@ -1,12 +1,71 @@
-2011-10-26 Release Manager
+2013-04-11 Release Manager
- * GCC 4.6.2 released.
+ * GCC 4.7.3 released.
-2011-06-27 Release Manager
+2012-09-20 Release Manager
- * GCC 4.6.1 released.
+ * GCC 4.7.2 released.
-2011-06-18 Mike Stump <mikestump@comcast.net>
+2012-06-14 Release Manager
+
+ * GCC 4.7.1 released.
+
+2012-03-22 Release Manager
+
+ * GCC 4.7.0 released.
+
+2012-01-22 Douglas B Rupp <rupp@gnat.com>
+
+ * config/mh-interix: Remove as unneeded.
+ * config/picflag.m4 (i[[34567]]86-*-interix3*):
+ Change triplet to i[[34567]]86-*-interix[[3-9]]*.
+
+2012-01-04 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
+
+ PR bootstrap/51734
+ * picflag.m4: Remove s390 case statement.
+
+2011-12-20 Andreas Schwab <schwab@linux-m68k.org>
+
+ * warnings.m4 (ACX_PROG_CC_WARNING_OPTS): Avoid leading dash in
+ expr call.
+
+2011-12-19 Andreas Schwab <schwab@linux-m68k.org>
+
+ PR bootstrap/51388
+ * warnings.m4 (ACX_PROG_CC_WARNING_OPTS)
+ (ACX_PROG_CC_WARNING_ALMOST_PEDANTIC): Run the test without the
+ no- prefix.
+
+2011-12-18 Eric Botcazou <ebotcazou@adacore.com>
+
+ * acx.m4 (Test for GNAT): Update comment and add quotes in final test.
+
+2011-11-22 Iain Sandoe <iains@gcc.gnu.org>
+
+ * weakref.m4: New file.
+
+2011-11-09 Richard Henderson <rth@redhat.com>
+
+ * asmcfi.m4: New file.
+
+2011-11-02 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * mh-interix (LIBGCC2_DEBUG_CFLAGS): Remove.
+
+2011-08-22 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * picflag.m4: New file.
+
+2011-07-18 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * elf.m4 (target_elf): Remove *-netware*.
+
+2011-07-06 Uros Bizjak <ubizjak@gmail.com>
+
+ * mt-alphaieee (GOCFLAGS_FOR_TARGET): Add -mieee.
+
+2011-06-15 Mike Stump <mikestump@comcast.net>
PR target/49461
* mh-darwin: Turn off -pie on darwin11 and later.
@@ -15,9 +74,34 @@
* bootstrap-lto.mk: Remove obsolete requirement.
-2011-03-25 Release Manager
+2011-03-24 Paolo Bonzini <pbonzini@redhat.com>
+
+ * mt-mep: Remove, obsolete.
+ * mt-netware: Remove, obsolete.
+ * mt-wince: Remove, obsolete.
+ * mt-v810: Remove, unused.
+
+2011-03-24 Paolo Bonzini <bonzini@gnu.org>
+
+ * mh-x86omitfp: Remove.
+
+2011-03-24 Paolo Bonzini <bonzini@gnu.org>
+
+ * mh-cygwin: Remove obsolete variables and dependencies.
+
+2011-03-24 Paolo Bonzini <bonzini@gnu.org>
+
+ * mh-sysv4: Remove.
+ * mh-solaris: Remove.
+
+2011-03-24 Paolo Bonzini <bonzini@gnu.org>
+
+ * mh-sysv4: Remove AR_CFLAGS.
+
+2011-03-24 Joseph Myers <joseph@codesourcery.com>
- * GCC 4.6.0 released.
+ * mh-cxux, mh-decstation, mh-dgux386, mh-lynxrs6k, mh-ncr3000,
+ mh-necv4, mh-sco, mh-sysv5: Remove.
2011-03-05 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
Eric Blake <eblake@redhat.com>
diff --git a/config/acx.m4 b/config/acx.m4
index b559c03ebd..9ff31eb85f 100644
--- a/config/acx.m4
+++ b/config/acx.m4
@@ -356,9 +356,9 @@ m4_define([AC_CHECK_HEADER],m4_defn([_AC_CHECK_HEADER_OLD]))
ac_c_preproc_warn_flag=yes])# AC_PROG_CPP_WERROR
# Test for GNAT.
-# We require the gnatbind program, and a compiler driver that
-# understands Ada. We use the user's CC setting, already found,
-# and possibly add $1 to the command-line parameters.
+# We require the gnatbind & gnatmake programs, as well as a compiler driver
+# that understands Ada. We use the user's CC setting, already found, and
+# possibly add $1 to the command-line parameters.
#
# Sets the shell variable have_gnat to yes or no as appropriate, and
# substitutes GNATBIND and GNATMAKE.
@@ -387,7 +387,7 @@ if test x"$errors" = x && test -f conftest.$ac_objext; then
fi
rm -f conftest.*])
-if test x$GNATBIND != xno && test x$GNATMAKE != xno && test x$acx_cv_cc_gcc_supports_ada != xno; then
+if test "x$GNATBIND" != xno && test "x$GNATMAKE" != xno && test x$acx_cv_cc_gcc_supports_ada != xno; then
have_gnat=yes
else
have_gnat=no
diff --git a/config/asmcfi.m4 b/config/asmcfi.m4
new file mode 100644
index 0000000000..a725aa11de
--- /dev/null
+++ b/config/asmcfi.m4
@@ -0,0 +1,15 @@
+;; Cribbed from libffi
+
+AC_DEFUN([GCC_AS_CFI_PSEUDO_OP],
+[AC_CACHE_CHECK([assembler .cfi pseudo-op support],
+ gcc_cv_as_cfi_pseudo_op, [
+ gcc_cv_as_cfi_pseudo_op=unknown
+ AC_TRY_COMPILE([asm (".cfi_startproc\n\t.cfi_endproc");],,
+ [gcc_cv_as_cfi_pseudo_op=yes],
+ [gcc_cv_as_cfi_pseudo_op=no])
+ ])
+ if test "x$gcc_cv_as_cfi_pseudo_op" = xyes; then
+ AC_DEFINE(HAVE_AS_CFI_PSEUDO_OP, 1,
+ [Define if your assembler supports .cfi_* directives.])
+ fi
+])
diff --git a/config/elf.m4 b/config/elf.m4
index 007006eaea..da051cbe61 100644
--- a/config/elf.m4
+++ b/config/elf.m4
@@ -1,4 +1,4 @@
-dnl Copyright (C) 2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2010, 2011 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
@@ -14,7 +14,7 @@ AC_REQUIRE([AC_CANONICAL_TARGET])
target_elf=no
case $target in
*-darwin* | *-aix* | *-cygwin* | *-mingw* | *-aout* | *-*coff* | \
- *-msdosdjgpp* | *-netware* | *-vms* | *-wince* | *-*-pe* | \
+ *-msdosdjgpp* | *-vms* | *-wince* | *-*-pe* | \
alpha*-dec-osf* | *-interix* | hppa[[12]]*-*-hpux*)
target_elf=no
;;
diff --git a/config/mh-cxux b/config/mh-cxux
deleted file mode 100644
index 8680654fff..0000000000
--- a/config/mh-cxux
+++ /dev/null
@@ -1,5 +0,0 @@
-# Configuration for Harris CX/UX 7 (and maybe 6), based on sysv4 configuration.
-
-# The l flag generates a warning from the SVR4 archiver, remove it.
-AR_FLAGS = cq
-
diff --git a/config/mh-cygwin b/config/mh-cygwin
index e3f7325035..1f746bdea8 100644
--- a/config/mh-cygwin
+++ b/config/mh-cygwin
@@ -1,11 +1,4 @@
-EXTRA_TARGET_HOST_ALL_MODULES=maybe-all-libtermcap
-EXTRA_TARGET_HOST_INSTALL_MODULES=maybe-install-libtermcap
-
# Increase stack limit to a figure based on the Linux default, with 4MB added
# as GCC turns out to need that much more to pass all the limits-* tests.
LDFLAGS += -Wl,--stack,12582912
BOOT_LDFLAGS += -Wl,--stack,12582912
-
-all-gdb: maybe-all-libtermcap
-
-install-gdb: maybe-all-libtermcap
diff --git a/config/mh-decstation b/config/mh-decstation
deleted file mode 100644
index 320927c306..0000000000
--- a/config/mh-decstation
+++ /dev/null
@@ -1,3 +0,0 @@
-# for X11, since the native DECwindows include files are really broken when
-# it comes to function prototypes.
-X11_EXTRA_CFLAGS = "-DNeedFunctionPrototypes=0"
diff --git a/config/mh-dgux386 b/config/mh-dgux386
deleted file mode 100644
index b2d2a057b4..0000000000
--- a/config/mh-dgux386
+++ /dev/null
@@ -1,5 +0,0 @@
-# The l flag generates a warning from the SVR4 archiver, remove it.
-AR_FLAGS = cr
-
-X11_EXTRA_LIBS = -lnsl
-
diff --git a/config/mh-interix b/config/mh-interix
deleted file mode 100644
index 67dff5c443..0000000000
--- a/config/mh-interix
+++ /dev/null
@@ -1,7 +0,0 @@
-# The shell may not be in /bin.
-SHELL = sh
-
-# We also need to override LIBGCC2_DEBUG_CFLAGS so libgcc2 will be
-# built without debugging information
-
-LIBGCC2_DEBUG_CFLAGS=
diff --git a/config/mh-lynxrs6k b/config/mh-lynxrs6k
deleted file mode 100644
index fac1b973a6..0000000000
--- a/config/mh-lynxrs6k
+++ /dev/null
@@ -1,2 +0,0 @@
-# /bin/sh is too buggy, so use /bin/bash instead.
-SHELL = /bin/bash
diff --git a/config/mh-ncr3000 b/config/mh-ncr3000
deleted file mode 100644
index 7c6ee12739..0000000000
--- a/config/mh-ncr3000
+++ /dev/null
@@ -1,4 +0,0 @@
-# Host configuration file for an NCR 3000 (i486/SVR4) system.
-
-# The l flag generates a warning from the SVR4 archiver, remove it.
-AR_FLAGS = cq
diff --git a/config/mh-necv4 b/config/mh-necv4
deleted file mode 100644
index d71805e052..0000000000
--- a/config/mh-necv4
+++ /dev/null
@@ -1,4 +0,0 @@
-# Host Makefile fragment for NEC MIPS SVR4.
-
-# NEC -lX11 needs some other libraries.
-X11_EXTRA_LIBS = -lsocket -lnsl
diff --git a/config/mh-sco b/config/mh-sco
deleted file mode 100644
index bf5a807b0e..0000000000
--- a/config/mh-sco
+++ /dev/null
@@ -1,4 +0,0 @@
-# You may need this if you don't have bison.
-# BISON = yacc -Sm10400
-
-X11_EXTRA_LIBS = -lsocket -lm -lintl -lmalloc
diff --git a/config/mh-solaris b/config/mh-solaris
deleted file mode 100644
index 6e8f296a4e..0000000000
--- a/config/mh-solaris
+++ /dev/null
@@ -1,2 +0,0 @@
-# Makefile changes for Suns running Solaris 2
-X11_EXTRA_LIBS = -lnsl -lsocket
diff --git a/config/mh-sysv4 b/config/mh-sysv4
deleted file mode 100644
index 2e9374c7f9..0000000000
--- a/config/mh-sysv4
+++ /dev/null
@@ -1,4 +0,0 @@
-# The l flag generates a warning from the SVR4 archiver, remove it.
-AR_FLAGS = cr
-
-X11_EXTRA_LIBS = -lnsl
diff --git a/config/mh-sysv5 b/config/mh-sysv5
deleted file mode 100644
index 2e9374c7f9..0000000000
--- a/config/mh-sysv5
+++ /dev/null
@@ -1,4 +0,0 @@
-# The l flag generates a warning from the SVR4 archiver, remove it.
-AR_FLAGS = cr
-
-X11_EXTRA_LIBS = -lnsl
diff --git a/config/mh-x86omitfp b/config/mh-x86omitfp
deleted file mode 100644
index 7f536c8ba2..0000000000
--- a/config/mh-x86omitfp
+++ /dev/null
@@ -1,2 +0,0 @@
-# Add -fomit-frame-pointer to the usual BOOT_CFLAGS to speed up the compiler.
-BOOT_CFLAGS += -fomit-frame-pointer
diff --git a/config/mmap.m4 b/config/mmap.m4
new file mode 100644
index 0000000000..39d79afc74
--- /dev/null
+++ b/config/mmap.m4
@@ -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
+])
diff --git a/config/mt-alphaieee b/config/mt-alphaieee
index 9c205314ad..80c17cdc6a 100644
--- a/config/mt-alphaieee
+++ b/config/mt-alphaieee
@@ -1,2 +1,3 @@
CFLAGS_FOR_TARGET += -mieee
CXXFLAGS_FOR_TARGET += -mieee
+GOCFLAGS_FOR_TARGET += -mieee
diff --git a/config/mt-mep b/config/mt-mep
deleted file mode 100644
index 849d128a3f..0000000000
--- a/config/mt-mep
+++ /dev/null
@@ -1,8 +0,0 @@
-
-EXTRA_TARGET_HOST_ALL_MODULES:=$(EXTRA_TARGET_HOST_ALL_MODULES) all-utils
-EXTRA_TARGET_HOST_INSTALL_MODULES:=$(EXTRA_TARGET_HOST_INSTALL_MODULES) install-utils
-
-all-utils : all-libiberty
-
-install-utils : all-libiberty
-
diff --git a/config/mt-netware b/config/mt-netware
deleted file mode 100644
index 9482f9b36d..0000000000
--- a/config/mt-netware
+++ /dev/null
@@ -1 +0,0 @@
-GDB_NLM_DEPS = all-gcc all-ld
diff --git a/config/mt-v810 b/config/mt-v810
deleted file mode 100644
index f5714f89e8..0000000000
--- a/config/mt-v810
+++ /dev/null
@@ -1,3 +0,0 @@
-CC_FOR_TARGET = ca732 -ansi
-AS_FOR_TARGET = as732
-AR_FOR_TARGET = ar732
diff --git a/config/mt-wince b/config/mt-wince
deleted file mode 100644
index cc7d67b588..0000000000
--- a/config/mt-wince
+++ /dev/null
@@ -1,10 +0,0 @@
-# For Windows CE, we need to build the program that converts, copies,
-# and renames the platform SDK files into gcc directories.
-
-EXTRA_TARGET_HOST_ALL_MODULES:=$(EXTRA_TARGET_HOST_ALL_MODULES) all-utils
-EXTRA_TARGET_HOST_INSTALL_MODULES:=$(EXTRA_TARGET_HOST_INSTALL_MODULES) install-utils
-
-all-utils : all-libiberty
-
-install-utils : all-libiberty
-
diff --git a/config/picflag.m4 b/config/picflag.m4
new file mode 100644
index 0000000000..bd818125a6
--- /dev/null
+++ b/config/picflag.m4
@@ -0,0 +1,92 @@
+# _GCC_PICFLAG(FLAG, DISPATCH)
+# ----------------------------
+# Store PIC flag corresponding to DISPATCH triplet in FLAG.
+# Explit use of -fpic in CFLAGS corresponding to FLAG overrides default.
+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
+ ;;
+ alpha*-dec-osf5*)
+ # PIC is the default.
+ ;;
+ hppa*64*-*-hpux*)
+ # PIC is the default for 64-bit PA HP-UX.
+ ;;
+ i[[34567]]86-*-cygwin* | i[[34567]]86-*-mingw* | x86_64-*-mingw*)
+ ;;
+ i[[34567]]86-*-interix[[3-9]]*)
+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+ # Instead, we relocate shared libraries at runtime.
+ ;;
+ i[[34567]]86-*-nto-qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ $1='-fPIC -shared'
+ ;;
+ i[[34567]]86-pc-msdosdjgpp*)
+ # DJGPP does not support shared libraries at all.
+ ;;
+ ia64*-*-hpux*)
+ # On IA64 HP-UX, PIC is the default but the pic flag
+ # sets the default TLS model and affects inlining.
+ $1=-fPIC
+ ;;
+ mips-sgi-irix6*)
+ # PIC is the default.
+ ;;
+ rs6000-ibm-aix* | powerpc-ibm-aix*)
+ # All AIX code is PIC.
+ ;;
+
+ # Some targets support both -fPIC and -fpic, but prefer the latter.
+ # FIXME: Why?
+ i[[34567]]86-*-* | x86_64-*-*)
+ $1=-fpic
+ ;;
+ m68k-*-*)
+ $1=-fpic
+ ;;
+ # FIXME: Override -fPIC default in libgcc only?
+ sh-*-linux* | sh[[2346lbe]]*-*-linux*)
+ $1=-fpic
+ ;;
+ # FIXME: Simplify to sh*-*-netbsd*?
+ sh-*-netbsdelf* | shl*-*-netbsdelf* | sh5-*-netbsd* | sh5l*-*-netbsd* | \
+ sh64-*-netbsd* | sh64l*-*-netbsd*)
+ $1=-fpic
+ ;;
+ # Default to -fPIC unless specified otherwise.
+ *)
+ $1=-fPIC
+ ;;
+esac
+
+# If the user explicitly uses -fpic/-fPIC, keep that.
+case "${m4_bpatsubsts($1, PICFLAG, CFLAGS)}" in
+ *-fpic*)
+ $1=-fpic
+ ;;
+ *-fPIC*)
+ $1=-fPIC
+ ;;
+esac
+])
+
+# GCC_PICFLAG
+# -----------
+# Store host PIC flag in PICFLAG.
+AC_DEFUN([GCC_PICFLAG], [
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ _GCC_PICFLAG([PICFLAG], [host])])
+
+# GCC_PICFLAG_FOR_TARGET
+# ----------------------
+# Store target PIC flag in PICFLAG_FOR_TARGET.
+AC_DEFUN([GCC_PICFLAG_FOR_TARGET], [
+ AC_REQUIRE([AC_CANONICAL_TARGET])
+ _GCC_PICFLAG([PICFLAG_FOR_TARGET], [target])])
diff --git a/config/warnings.m4 b/config/warnings.m4
index 3801c856be..b64b594e62 100644
--- a/config/warnings.m4
+++ b/config/warnings.m4
@@ -1,6 +1,6 @@
# Autoconf include file defining macros related to compile-time warnings.
-# Copyright 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
+# Copyright 2004, 2005, 2007, 2009, 2011 Free Software Foundation, Inc.
#This file is part of GCC.
@@ -28,7 +28,13 @@ AC_SUBST(acx_Var)dnl
m4_expand_once([acx_Var=
],m4_quote(acx_Var=))dnl
save_CFLAGS="$CFLAGS"
-for option in $1; do
+for real_option in $1; do
+ # Do the check with the no- prefix removed since gcc silently
+ # accepts any -Wno-* option on purpose
+ case $real_option in
+ -Wno-*) option=-W`expr x$real_option : 'x-Wno-\(.*\)'` ;;
+ *) option=$real_option ;;
+ esac
AS_VAR_PUSHDEF([acx_Woption], [acx_cv_prog_cc_warning_$option])
AC_CACHE_CHECK([whether $CC supports $option], acx_Woption,
[CFLAGS="$option"
@@ -37,14 +43,14 @@ for option in $1; do
[AS_VAR_SET(acx_Woption, no)])
])
AS_IF([test AS_VAR_GET(acx_Woption) = yes],
- [acx_Var="$acx_Var${acx_Var:+ }$option"])
+ [acx_Var="$acx_Var${acx_Var:+ }$real_option"])
AS_VAR_POPDEF([acx_Woption])dnl
done
CFLAGS="$save_CFLAGS"
m4_popdef([acx_Var])dnl
])# ACX_PROG_CC_WARNING_OPTS
-# ACX_PROG_CC_WARNING_ALMOST_PEDANTIC(WARNINGS, [VARIABLE = WARN_PEDANTIC)
+# ACX_PROG_CC_WARNING_ALMOST_PEDANTIC(WARNINGS, [VARIABLE = WARN_PEDANTIC])
# Append to VARIABLE "-pedantic" + the argument, if the compiler is GCC
# and accepts all of those options simultaneously, otherwise to nothing.
AC_DEFUN([ACX_PROG_CC_WARNING_ALMOST_PEDANTIC],
@@ -53,11 +59,14 @@ m4_pushdef([acx_Var], [m4_default([$2], [WARN_PEDANTIC])])dnl
AC_SUBST(acx_Var)dnl
m4_expand_once([acx_Var=
],m4_quote(acx_Var=))dnl
-AS_VAR_PUSHDEF([acx_Pedantic], [acx_cv_prog_cc_pedantic_$1])dnl
+# Do the check with the no- prefix removed from the warning options
+# since gcc silently accepts any -Wno-* option on purpose
+m4_pushdef([acx_Woptions], [m4_bpatsubst([$1], [-Wno-], [-W])])dnl
+AS_VAR_PUSHDEF([acx_Pedantic], [acx_cv_prog_cc_pedantic_]acx_Woptions)dnl
AS_IF([test "$GCC" = yes],
-[AC_CACHE_CHECK([whether $CC supports -pedantic $1], acx_Pedantic,
+[AC_CACHE_CHECK([whether $CC supports -pedantic ]acx_Woptions, acx_Pedantic,
[save_CFLAGS="$CFLAGS"
-CFLAGS="-pedantic $1"
+CFLAGS="-pedantic acx_Woptions"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
[AS_VAR_SET(acx_Pedantic, yes)],
[AS_VAR_SET(acx_Pedantic, no)])
@@ -66,6 +75,7 @@ AS_IF([test AS_VAR_GET(acx_Pedantic) = yes],
[acx_Var="$acx_Var${acx_Var:+ }-pedantic $1"])
])
AS_VAR_POPDEF([acx_Pedantic])dnl
+m4_popdef([acx_Woptions])dnl
m4_popdef([acx_Var])dnl
])# ACX_PROG_CC_WARNING_ALMOST_PEDANTIC
diff --git a/config/weakref.m4 b/config/weakref.m4
new file mode 100644
index 0000000000..39b63d39b8
--- /dev/null
+++ b/config/weakref.m4
@@ -0,0 +1,48 @@
+
+dnl Check if the target supports weak.
+AC_DEFUN([GCC_CHECK_ATTRIBUTE_WEAK], [
+ AC_CACHE_CHECK([whether the target supports weak],
+ ac_cv_have_attribute_weak, [
+ weakref_m4_saved_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -Werror"
+ AC_TRY_COMPILE([void __attribute__((weak)) foo(void) { }],
+ [], ac_cv_have_attribute_weak=yes,
+ ac_cv_have_attribute_weak=no)
+ CFLAGS="$weakref_m4_saved_CFLAGS"])
+ if test x"$ac_cv_have_attribute_weak" = xyes; then
+ AC_DEFINE(HAVE_ATTRIBUTE_WEAK, 1,
+ [Define to 1 if the target supports __attribute__((weak)).])
+ fi])
+
+dnl Check whether weak refs work like the ELF ones.
+dnl This means that the weak reference works without having to satify
+dnl linkage for the item.
+dnl There are targets (at least Darwin) where we have fully functional
+dnl weakrefs at runtime, but must supply the referenced item at link time.
+AC_DEFUN([GCC_CHECK_ELF_STYLE_WEAKREF], [
+ AC_CACHE_CHECK([whether weak refs work like ELF],
+ ac_cv_have_elf_style_weakref, [
+ weakref_m4_saved_CFLAGS="$CFLAGS"
+ case "${host}" in
+ *-apple-darwin*) CFLAGS="$CFLAGS -Wl,-undefined,dynamic_lookup" ;;
+ *) ;;
+ esac
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
+extern void fNotToBeFound(void) __attribute__((weak));
+int main ()
+{
+ if (fNotToBeFound)
+ return 1;
+ else
+ return 0;
+}
+]])], ac_cv_have_elf_style_weakref=yes, ac_cv_have_elf_style_weakref=no, [
+case "${host}" in
+ alpha*-dec-osf*) ac_cv_have_elf_style_weakref=no ;;
+ *-apple-darwin[[89]]*) ac_cv_have_elf_style_weakref=no ;;
+ *) ac_cv_have_elf_style_weakref=yes;;
+esac])CFLAGS="$weakref_m4_saved_CFLAGS"])
+if test x"$ac_cv_have_elf_style_weakref" = xyes; then
+ AC_DEFINE(HAVE_ELF_STYLE_WEAKREF, 1, [Define to 1 if target has a weakref that works like the ELF one.])
+fi])
+