summaryrefslogtreecommitdiff
path: root/gold/configure.ac
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2013-10-11 21:56:16 +0000
committerRoland McGrath <roland@gnu.org>2013-10-11 21:56:16 +0000
commit9502638f158976cb57177af939947146ad93d33a (patch)
treebf87280f5380335081de528c1ee6fccc00451544 /gold/configure.ac
parent1a041db9cd15754cc49ca5834999b634360238f6 (diff)
downloadbinutils-redhat-9502638f158976cb57177af939947146ad93d33a.tar.gz
gold/
* configure.ac (MERGE_CONSTANTS_FLAG): New check. * configure: Regenerate. * Makefile.in: Regenerate. * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix. * testsuite/merge_string_literals_2.c: Likewise. * testsuite/Makefile.am (merge_string_literals_1.o, merge_string_literals_2.o): Update deps. (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of literal -fmerge-constants. * testsuite/Makefile.in: Regenerate.
Diffstat (limited to 'gold/configure.ac')
-rw-r--r--gold/configure.ac17
1 files changed, 15 insertions, 2 deletions
diff --git a/gold/configure.ac b/gold/configure.ac
index e3e10b3dbd..4cc9569e12 100644
--- a/gold/configure.ac
+++ b/gold/configure.ac
@@ -7,12 +7,12 @@ dnl This file is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 3 of the License, or
dnl (at your option) any later version.
-dnl
+dnl
dnl This program is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
dnl GNU General Public License for more details.
-dnl
+dnl
dnl You should have received a copy of the GNU General Public License
dnl along with this program; see the file COPYING3. If not see
dnl <http://www.gnu.org/licenses/>.
@@ -338,6 +338,19 @@ dnl Whether we can test -mcmodel=medium.
AM_CONDITIONAL(MCMODEL_MEDIUM,
[test "$target_cpu" = "x86_64" -a "$have_mcmodel_medium" = "yes" -a "$gold_cv_prog_gcc41" = "yes"])
+AC_CACHE_CHECK([whether $CC supports -fmerge-constants],
+ [gold_cv_merge_constants], [
+save_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS -fmerge-constants"
+AC_COMPILE_IFELSE([const char *s = "foo";],
+ [have_merge_constants=yes],
+ [have_merge_constants=no])
+CFLAGS="$save_CFLAGS"])
+AC_SUBST([MERGE_CONSTANTS_FLAG])
+AS_IF([test "$gold_cv_merge_constants" = yes],
+ [MERGE_CONSTANTS_FLAG=-fmerge-constants],
+ [MERGE_CONSTANTS_FLAG=])
+
dnl Test for __thread support.
AC_CACHE_CHECK([for thread support], [gold_cv_c_thread],
[AC_COMPILE_IFELSE([__thread int i = 1;],