Rainer Orth 0a48b1fe98 Change int8_t to signed char on Solaris [PR113450,PR123176]
int8_t is currently defined as char in Solaris <sys/int_types.h>

/*
 * Basic / Extended integer types
 *
 * The following defines the basic fixed-size integer types.
 *
 * Implementations are free to typedef them to Standard C integer types or
 * extensions that they support. If an implementation does not support one
 * of the particular integer data types below, then it should not define the
 * typedefs and macros corresponding to that data type.  Note that int8_t
 * is not defined in -Xs mode on ISAs for which the ABI specifies "char"
 * as an unsigned entity because there is no way to define an eight bit
 * signed integral.
 */
typedef char			int8_t;
typedef signed char		int8_t;

and _CHAR_IS_SIGNED defined as 1 in <sys/isa_defs.h>.  As has long been
known, this violates C99, 7.18.1.1, Exact-width integer types.

While this works in general nonetheless, it creates constant trouble for
C++ code as can be seen in PRs libstdc++/113450 and recently
libstdc++/123176, but also in LLVM.

While Oracle Solaris engineering is amenable to changing int8_t to
signed char, this will take time.  However, it proved easy to do so now
using fixincludes.

This works for a GCC bootstrap just fine with one exception: as
documented in PR d/123509, libdruntime has its own definition of int8_t
which is now inconsistent with GCC's.  This leads to some gdc.test and
libphobos testsuite failures, which can easily be fixed with the patch
attached to that PR.  I wouldn't consider this a showstopper for GCC 16
if that patch wouldn't make it to the release.

However, the failures point to another problem: with this change, the
mangling of

	void func(int8_t);

changes in C++, creating an ABI break.  Fortunately, this isn't seen in
libstdc++, so the impact should be reasonable compared to the constant
trouble the current definition causes for C++.

Besides, clang already uses

	#define __INT8_TYPE__ signed char

apparently without problems.

In case users do run into the incompatiblity, the fixed definitions are
wrapped in #if !defined(_LEGACY_INT8_T)/#endif so there's an easy way back
to the original definition.

Bootstrapped on i386-pc-solaris2.11, amd64-pc-solaris2.11,
sparc-sun-solaris2.11, and sparcv9-sun-solaris2.11 with only the D
failure described above.

I've also run 1-stage and bootstrap builds of LLVM main using a patched
GCC 16 as bootstrap compiler on amd64-pc-solaris2.11 and
sparcv9-sun-solaris2.11 without regressions.

2026-01-07  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	fixincludes:
	PR libstdc++/113450
	PR libstdc++/123176
	* inclhack.def (solaris_int8_t): New fix.
	* fixincl.x: Regenerate.

	gcc:
	PR libstdc++/113450
	PR libstdc++/123176
	* config/sol2.h (INT8_TYPE): Change to signed char.
	(INT_LEAST8_TYPE): Likewise.
	(INT_FAST8_TYPE): Likewise.
2026-02-15 23:11:44 +01:00
2026-02-05 00:16:28 +00:00
2026-02-06 00:16:39 +00:00
2026-02-06 00:16:39 +00:00
2026-01-31 00:16:35 +00:00
2026-01-31 00:16:35 +00:00
2026-01-30 00:16:31 +00:00
2026-01-31 00:16:35 +00:00
2026-02-07 00:16:36 +00:00
2026-02-15 00:16:25 +00:00
2026-02-13 00:16:32 +00:00
2026-02-13 00:16:32 +00:00
2026-02-13 00:16:32 +00:00
2026-02-06 00:16:39 +00:00
2026-02-14 00:16:28 +00:00
2026-02-06 00:16:39 +00:00

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.
Description
No description provided
Readme 4.2 GiB
Languages
C++ 30.7%
C 30.2%
Ada 14.4%
D 6.1%
Go 5.7%
Other 12.4%