Enforce C++11 as a minimum for building gold [PR30867]

The attempt in 5e9091dab8 to correct gold for modern LLVM has broken
gold for older compilers.  This commit introduced C++11 types without
changing the build system to require a C++ compiler.  More importantly
it depends on the compiler having at least C++11 as the default
language.  Older compilers which support C++11 but not as the default
language needlessly break.  Fix that.

	PR gold/30867
	* configure.ac (AX_CXX_COMPILE_STDCXX): Require C++11.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* config.in: Regenerate.
	* configure: Regenerate.
	* testsuite/Makefile.in: Regenerate.
This commit is contained in:
Tamar Christina 2024-01-04 15:20:14 +00:00 committed by Alan Modra
parent 375beedfd3
commit 941d02eaae
6 changed files with 1012 additions and 2 deletions

View File

@ -123,7 +123,9 @@ noinst_PROGRAMS = ld-new$(EXEEXT) incremental-dump$(EXEEXT)
@GCC_TRUE@@NATIVE_LINKER_TRUE@@THREADS_TRUE@am__append_7 = bootstrap-test-treehash-chunksize
subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/../config/ax_pthread.m4 \
am__aclocal_m4_deps = \
$(top_srcdir)/../config/ax_cxx_compile_stdcxx.m4 \
$(top_srcdir)/../config/ax_pthread.m4 \
$(top_srcdir)/../config/depstand.m4 \
$(top_srcdir)/../config/gettext-sister.m4 \
$(top_srcdir)/../config/gettext.m4 \
@ -551,6 +553,7 @@ GMSGFMT = @GMSGFMT@
GOLD_LDADD = @GOLD_LDADD@
GOLD_LDFLAGS = @GOLD_LDFLAGS@
GREP = @GREP@
HAVE_CXX11 = @HAVE_CXX11@
INCINTL = @INCINTL@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@

1
gold/aclocal.m4 vendored
View File

@ -1196,6 +1196,7 @@ AC_SUBST([am__tar])
AC_SUBST([am__untar])
]) # _AM_PROG_TAR
m4_include([../config/ax_cxx_compile_stdcxx.m4])
m4_include([../config/ax_pthread.m4])
m4_include([../config/depstand.m4])
m4_include([../config/gettext-sister.m4])

View File

@ -52,6 +52,9 @@
/* Define to 1 if you have the `chsize' function. */
#undef HAVE_CHSIZE
/* define if the compiler supports basic C++11 syntax */
#undef HAVE_CXX11
/* Define if the GNU dcgettext() function is already present or preinstalled.
*/
#undef HAVE_DCGETTEXT

996
gold/configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -681,6 +681,10 @@ if test "$gold_cv_unordered_map_rehash" = "yes"; then
[Define if ::std::tr1::unordered_map::rehash is usable])
fi
# Since 5e9091dab8858b25210a91d22fbbbfdee9c969ad gold now requires C++11
# So we need to check for it.
AX_CXX_COMPILE_STDCXX([11], [], [mandatory])
# Use of tr1/unordered_map with off_t as a key is not supported on GCC
# 4.1.xx when compiling in 32-bit mode with a 64-bit off_t type.
AC_CACHE_CHECK([whether std::tr1::hash<off_t> is defined],

View File

@ -1138,7 +1138,9 @@ check_PROGRAMS = $(am__EXEEXT_1) $(am__EXEEXT_2) $(am__EXEEXT_3) \
@DEFAULT_TARGET_X86_64_TRUE@ retain_2.out
subdir = testsuite
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/../config/ax_pthread.m4 \
am__aclocal_m4_deps = \
$(top_srcdir)/../config/ax_cxx_compile_stdcxx.m4 \
$(top_srcdir)/../config/ax_pthread.m4 \
$(top_srcdir)/../config/depstand.m4 \
$(top_srcdir)/../config/gettext-sister.m4 \
$(top_srcdir)/../config/gettext.m4 \
@ -2647,6 +2649,7 @@ GMSGFMT = @GMSGFMT@
GOLD_LDADD = @GOLD_LDADD@
GOLD_LDFLAGS = @GOLD_LDFLAGS@
GREP = @GREP@
HAVE_CXX11 = @HAVE_CXX11@
INCINTL = @INCINTL@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@