Go to file
Jonathan Wakely fe2651affa libstdc++: Fix iostream init for Clang on darwin [PR110432]
The __has_attribute(init_priority) check in <iostream> is true for Clang
on darwin, which means that user code including <iostream> thinks the
library will initialize the global streams. However, when libstdc++ is
built by GCC on darwin, the __has_attribute(init_priority) check is
false, which means that the library thinks that user code will do the
initialization when <iostream> is included. This means that the
initialization is never done.

Add an autoconf check so that the header and the library both make their
decision based on the static properties of GCC at build time, with a
consistent outcome.

As a belt and braces check, also do the initialization in <iostream> if
the compiler including that header doesn't support the attribute (even
if the library also containers the initialization). This might result in
redundant initialization done in <iostream>, but ensures the
initialization happens somewhere if there's any doubt about the
attribute working correctly due to missing linker support.

libstdc++-v3/ChangeLog:

	PR libstdc++/110432
	* acinclude.m4 (GLIBCXX_CHECK_INIT_PRIORITY): New.
	* config.h.in: Regenerate.
	* configure: Regenerate.
	* configure.ac: Use GLIBCXX_CHECK_INIT_PRIORITY.
	* include/std/iostream: Use new autoconf macro as well as
	__has_attribute.
	* src/c++98/ios_base_init.h: Use new autoconf macro instead of
	__has_attribute.

Reviewed-by: Patrick Palka <ppalka@redhat.com>
2023-06-30 15:35:02 +01:00
c++tools
config
contrib
fixincludes
gcc Fix handling of __builtin_expect_with_probability and improve first-match heuristics 2023-06-30 16:27:27 +02:00
gnattools
gotools
include
INSTALL
intl
libada
libatomic
libbacktrace
libcc1
libcody
libcpp
libdecnumber
libffi
libgcc
libgfortran
libgm2
libgo
libgomp
libiberty
libitm
libobjc
libphobos Daily bump. 2023-06-26 00:17:28 +00:00
libquadmath
libsanitizer
libssp
libstdc++-v3 libstdc++: Fix iostream init for Clang on darwin [PR110432] 2023-06-30 15:35:02 +01:00
libvtv
lto-plugin Regenrate lto-plugin/Makefile.in 2023-06-30 13:27:15 +02:00
maintainer-scripts
zlib
.dir-locals.el
.gitattributes
.gitignore
ABOUT-NLS
ar-lib
ChangeLog Daily bump. 2023-06-30 00:17:51 +00:00
ChangeLog.jit
ChangeLog.tree-ssa
compile
config-ml.in
config.guess
config.rpath
config.sub
configure configure, Darwin: Ensure overrides to host-pie are passed to gcc configure. 2023-06-25 10:16:39 +01:00
configure.ac configure, Darwin: Ensure overrides to host-pie are passed to gcc configure. 2023-06-25 10:16:39 +01:00
COPYING
COPYING3
COPYING3.LIB
COPYING.LIB
COPYING.RUNTIME
depcomp
install-sh
libtool-ldflags
libtool.m4
lt~obsolete.m4
ltgcc.m4
ltmain.sh
ltoptions.m4
ltsugar.m4
ltversion.m4
MAINTAINERS MAINTAINERS file: Added myself to Write After Approval and DCO 2023-06-30 16:04:48 +05:30
Makefile.def configure, Darwin: Ensure overrides to host-pie are passed to gcc configure. 2023-06-25 10:16:39 +01:00
Makefile.in Fix collection and processing of autoprofile data for target libs 2023-06-28 18:21:49 -07:00
Makefile.tpl Fix collection and processing of autoprofile data for target libs 2023-06-28 18:21:49 -07:00
missing
mkdep
mkinstalldirs
move-if-change
multilib.am
README
symlink-tree
test-driver
ylwrap

This directory contains the GNU Compiler Collection (GCC).

The GNU Compiler Collection is free software.  See the files whose
names start with COPYING for copying permission.  The manuals, and
some of the runtime libraries, are under different terms; see the
individual source files for details.

The directory INSTALL contains copies of the installation information
as HTML and plain text.  The source of this information is
gcc/doc/install.texi.  The installation information includes details
of what is included in the GCC sources and what files GCC installs.

See the file gcc/doc/gcc.texi (together with other files that it
includes) for usage and porting information.  An online readable
version of the manual is in the files gcc/doc/gcc.info*.

See http://gcc.gnu.org/bugs/ for how to report bugs usefully.

Copyright years on GCC source files may be listed using range
notation, e.g., 1987-2012, indicating that every year in the range,
inclusive, is a copyrightable year that could otherwise be listed
individually.