381 Commits

Author SHA1 Message Date
GCC Administrator
64c9fcfa70 Daily bump. 2026-02-16 00:16:25 +00:00
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
GCC Administrator
1f7e64d56b Daily bump. 2026-01-10 00:16:49 +00:00
Ben Boeckel
d5835ae7bf bugzilla: remove gcc-bugs@ mailing list address
Bugzilla is preferred today. Use a URL that gives context about
gathering information prior to actually filing a bug at Bugzilla.

ChangeLog:

	* config-ml.in: Replace gcc-bugs@ with bug reporting link.
	* symlink-tree: Replace gcc-bugs@ with bug reporting link.

fixincludes/ChangeLog:

	* README: Replace gcc-bugs@ with bug reporting link.

gcc/testsuite/ChangeLog:

	* lib/file-format.exp: Replace gcc-bugs@ with bug reporting link.

libcpp/ChangeLog:

	* configure: Regenerate.
	* configure.ac: Replace gcc-bugs@ with bug reporting link.

libdecnumber/ChangeLog:

	* configure: Regenerate.
	* configure.ac: Replace gcc-bugs@ with bug reporting link.
2026-01-09 11:10:38 +01:00
GCC Administrator
e21d696e78 Daily bump. 2026-01-08 00:16:32 +00:00
Rainer Orth
72a376da3b fixincludes: Remove unnecessary Solaris fixes
Many fixincludes fixes are no longer applied on Solaris 11.4, usually
because they have been incorporated into the system headers.  Sometimes
this happened as early as Solaris 10 already.

A few still were applied although unnecessarily, usually because they
have been applied to system headers in a slightly different way.

This patch removes all such fixes or disables the unnecessary ones that
aren't Solaris-specific on Solaris only.  While the solaris_math_12 fix
isn't necessary in current Solaris 11.4 SRUs, it was kept since it still
applies to Solaris 11.4 FCS.

Bootstrapped without regressions on i386-pc-solaris2.11 and
sparc-sun-solaris2.11.  I've also checked that the fixes applied to the
11.4 FCS headers are identical to those before this patch, with the
exception of those that are no longer actually needed.

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

	fixincludes:
	* inclhack.def (AAB_solaris_sys_varargs_h): Remove.
	(solaris___restrict): Likewise.
	(solaris_complex): Likewise.
	(solaris_complex_cxx): Likewise.
	(solaris_cxx_linkage): Likewise.
	(solaris_getc_strict_stdc): Likewise.
	(solaris_gets_c11): Likewise.
	(solaris_gets_cxx14): Likewise.
	(solaris_int_limits_2): Likewise.
	(solaris_math_1): Likewise.
	(solaris_math_10): Likewise.
	(solaris_math_2): Likewise.
	(solaris_math_3): Likewise.
	(solaris_math_4): Likewise.
	(solaris_math_8): Likewise.
	(solaris_math_9): Likewise.
	(solaris_math_11): Likewise.
	(solaris_once_init_1): Likewise.
	(solaris_posix_spawn_restrict): Likewise.
	(solaris_rwlock_init_1): Likewise.
	(solaris_std___filbuf): Likewise.
	(solaris_std_gets_cxx14): Likewise.
	(solaris_stdio_tag): Likewise.
	(solaris_stdlib_noreturn): Likewise.
	(gnu_types): Simplify Solaris guard.
	(stdio_stdarg_h): Likewise.
	(stdio_va_list): Likewise.
	(stdio_va_list_clients): Bypass on Solaris.
	(strict_ansi_only): Likewise.
	* fixincl.x: Regenerate.

	* tests/base/iso/math_c99.h: Remove.
	* tests/base/iso/stdio_iso.h: Likewise.
	* tests/base/iso/stdlib_c99.h: Likewise.
	* tests/base/iso/stdlib_iso.h: Likewise.
	* tests/base/spawn.h: Likewise.
	* tests/base/stdio_tag.h: Likewise.
	* tests/base/sys/feature_tests.h: Likewise.

	* tests/base/complex.h 	[SOLARIS_COMPLEX_CHECK]: Remove.
	[SOLARIS_COMPLEX_CXX_CHECK]: Likewise.
	* tests/base/pthread.h [SOLARIS_ONCE_INIT_1_CHECK]: Likewise.
	[SOLARIS_RWLOCK_INIT_1_CHECK]: Likewise
	* tests/base/stdio.h [SOLARIS_STD___FILBUF_CHECK]: Likewise.
	[SOLARIS_GETS_CXX14_CHECK]: Likewise.
	* tests/base/sys/int_limits.h [SOLARIS_INT_LIMITS_2_CHECK]: Likewise.
2026-01-07 09:52:39 +01:00
GCC Administrator
a15bdc66d2 Daily bump. 2025-08-29 00:19:55 +00:00
Jonathan Wakely
59db4ce2df fixincludes: Skip pthread_incomplete_struct_argument for modern glibc [PR118009]
The pthread_incomplete_struct_argument fix was intended for ancient
versions of Glibc (only 2.3.3 and 2.3.4, I believe). From Glibc 2.3.5
the pthread.h header already included the change to use a pointer
instead of an array, so the fixinclude was no longer used.

However, the https://sourceware.org/bugzilla/show_bug.cgi?id=26647 fix
changed the __setjmpbuf declaration to use struct __jmp_buf_tag __env[1]
again, which caused this fixinclude to start matching again. This means
that GCC now installs a "fixed" pthread.h with a change to a declaration
that guarded by #if ! __GNUC_PREREQ (11, 0), i.e. it's not even relevant
for modern versions of GCC. The "fixed" pthread.h causes problems for
users because of changes to internal implementation details of the
pthread_cond_t type, which require the "fixed" pthread.h to be updated
with mkheaders if Glibc is updated.

This change adds a bypass to the fixinclude, so that it no longer
matches modern Glibc versions, and only applies to glibc versions 2.3.3
and 2.3.4 as originally intended.

Also remove outdated reference to svn in the comment at the top of the
generated file.

fixincludes/ChangeLog:

	PR bootstrap/118009
	PR bootstrap/119089
	* inclhack.def (pthread_incomplete_struct_argument): Add bypass.
	* fixincl.tpl: Remove reference to svn in comment.
	* fixincl.x: Regenerate.

Reviewed-by: Jason Merrill <jason@redhat.com>
2025-08-28 17:48:03 +01:00
GCC Administrator
5529a1d36f Daily bump. 2025-08-16 00:19:12 +00:00
Francois-Xavier Coudert
e905d7ee2b fixincludes: skip stdio_va_list on modern darwin
Complement to the previous commit in fixincludes
(b1f9ab40cb), for the MacOSX12.3 SDK, it
is necessary to also bypass the stdio_va_list fix. The same bypass is
used, namely, the inclusion of <_stdio.h>.

fixincludes/ChangeLog:

	* fixincl.x: Regenerate.
	* inclhack.def (stdio_va_list): Skip on recent darwin.
2025-08-15 17:34:35 +02:00
Francois-Xavier Coudert
b1f9ab40cb fixincludes: skip stdio_stdarg_h on modern darwin
All macOS SDK since at least macOS 10.9, and until macOS 10.12
(included), feature these lines in <stdio.h>:

/* DO NOT REMOVE THIS COMMENT: fixincludes needs to see:
 * __gnuc_va_list and include <stdarg.h> */

The clear intent (and effect) was to bypass gcc’s stdio_stdarg_h
fixinclude.

However, since macOS 10.13, these lines have been moved to <_stdio.h>,
which is itself included at the top of <stdio.h>. The unintended
consequence is that the stdio_stdarg_h fixinclude is now applied to
macOS <stdio.h>, where it is not needed. This useless fixinclude makes
the compiler more fragile and less portable.

A previous attempt to skip the stdio_stdarg_h fix entirely had to be
reverted, since it broken some very old macOS versions. The new fix is
to bypass the fix based on the detection of <_stdio.h> inclusion, which
is more robust.

fixincludes/ChangeLog:

	* fixincl.x: Regenerate.
	* inclhack.def (stdio_stdarg_h): Skip on darwin.
2025-08-15 08:54:29 +02:00
GCC Administrator
88ff0504ab Daily bump. 2024-07-12 00:17:52 +00:00
Iain Sandoe
619f587f68 Revert "fixincludes: skip stdio_stdarg_h on darwin"
This reverts commit 7d454cae9d.

The change breaks bootstrap on some x86_64 OS versions.
2024-07-11 08:46:26 +01:00
GCC Administrator
f777ab31e5 Daily bump. 2024-07-11 00:17:33 +00:00
Francois-Xavier Coudert
7d454cae9d fixincludes: skip stdio_stdarg_h on darwin
The fix is unnecessary on macOS.

fixincludes/ChangeLog:

	* fixincl.x: Regenerate.
	* inclhack.def (stdio_stdarg_h): Skip on darwin.
2024-07-10 17:57:30 +02:00
Francois-Xavier Coudert
8326956159 fixincludes: add bypass to darwin_objc_runtime_1
Headers are now fixed in the macOS 15 SDK, and the fix should be
bypassed there.

fixincludes/ChangeLog:

	* fixincl.x: Regenerate.
	* inclhack.def (darwin_objc_runtime_1): Add bypass.
2024-07-10 16:55:55 +02:00
GCC Administrator
4fda39e7cc Daily bump. 2024-06-28 00:18:04 +00:00
Francois-Xavier Coudert
1dc1431815 fixincludes: adjust stdio fix for macOS 15 headers
fixincludes/ChangeLog:

	* fixincl.x: Regenerate.
	* inclhack.def (apple_local_stdio_fn_deprecation): Also apply to
	_stdio.h.
2024-06-27 18:55:22 +02:00
GCC Administrator
7fa4b335b1 Daily bump. 2024-06-12 00:18:21 +00:00
Francois-Xavier Coudert
66d6b1861e fixincludes: bypass the math_exception fix on __cplusplus
fixincludes/ChangeLog:

	* fixincl.x: Regenerate.
	* inclhack.def (math_exception): Bypass on __cplusplus.
	* tests/base/math.h: Regenerate.
2024-06-11 07:59:41 +02:00
GCC Administrator
6e5f77fdc7 Daily bump. 2024-06-08 00:18:05 +00:00
Francois-Xavier Coudert
e4f1c1be61 fixincludes: bypass some fixes for recent darwin headers
fixincludes/ChangeLog:

	* fixincl.x: Regenerate.
	* inclhack.def (darwin_stdint_7, darwin_dispatch_object_1,
	darwin_os_trace_2, darwin_os_base_1): Include bypasses
	for recent headers, fixed by Apple.
2024-06-07 11:02:41 +02:00
GCC Administrator
d508d70836 Daily bump. 2024-05-09 10:58:01 +00:00
Zac Walker
13bad1ac7a Introduce aarch64-w64-mingw32 target
Add the initial aarch64-w64-mingw32 target for gcc.

This is the first commit in a sequence of patch series to add
new aarch64-w64-mingw32 target.

Coauthors: Zac Walker <zacwalker@microsoft.com>,
Mark Harmstone <mark@harmstone.com>  and
Ron Riddle <ron.riddle@microsoft.com>

Refactored, prepared, and validated by
Radek Barton <radek.barton@microsoft.com> and
Evgeny Karpov <evgeny.karpov@microsoft.com>

fixincludes/ChangeLog:

	* mkfixinc.sh: Extend for *-mingw32* targets.

gcc/ChangeLog:

	* config.gcc: Add aarch64-w64-mingw32 target.
2024-05-07 16:02:33 +00:00
GCC Administrator
26a7e775a2 Daily bump. 2023-11-23 00:18:14 +00:00
Francois-Xavier Coudert
ce966ae660 Build: fix error in fixinclude configure
The stray line defining enable_darwin_at_rpath outside of the scope of
_LT_DARWIN_LINKER_FEATURES is a mistake and should be removed. It leads
to a wrong line in fixincludes/ChangeLog because there is no $1 argument
at that point.

ChangeLog:

	* libtool.m4: Fix stray call

fixincludes/ChangeLog:

	* configure: Regenerated.
2023-11-22 11:54:33 +01:00
GCC Administrator
a5c157b95a Daily bump. 2023-10-31 00:17:32 +00:00
Iain Sandoe
434975cb1b configure, fixincludes: Add change missed in r14-4825.
This corrects an oversight in the r14-4825 commit.

fixincludes/ChangeLog:

	* configure: Regenerate.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
2023-10-30 19:05:00 +00:00
GCC Administrator
1eb2433ff9 Daily bump. 2023-08-18 00:16:52 +00:00
Rainer Orth
93f803d53b fixincludes: Update darwin_flt_eval_method for macOS 14
On macOS 14, a guard in <math.h> changed:

-- MacOSX13.3.sdk/usr/include/math.h	2023-04-19 01:54:44
+++ MacOSX14.0.sdk/usr/include/math.h	2023-08-01 08:42:43
@@ -22,0 +23 @@
+
@@ -43 +44 @@
-#if __FLT_EVAL_METHOD__ == 0
+#if __FLT_EVAL_METHOD__ == 0 || __FLT_EVAL_METHOD__ == -1
@@ -49 +50 @@
-#elif __FLT_EVAL_METHOD__ == 2 || __FLT_EVAL_METHOD__ == -1
+#elif __FLT_EVAL_METHOD__ == 2

Therefore the darwin_flt_eval_method fixincludes fix doesn't match any
longer, leading to a large number of testsuite failures like

/private/var/gcc/regression/master/14-gcc/build/gcc/include-fixed/math.h:69:5:
error: #error "Unsupported value of __FLT_EVAL_METHOD__."

where __FLT_EVAL_METHOD__ = 16.

This patch adjusts the fix to allow for both forms.

Tested with make check in fixincludes on x86_64-apple-darwin23.0.0 and
verifying that <math.h> has indeed been fixed as expected.

2023-08-16  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	fixincludes:
	* inclhack.def (darwin_flt_eval_method): Handle macOS 14 guard
	variant.
	* fixincl.x: Regenerate.
	* tests/base/math.h [DARWIN_FLT_EVAL_METHOD_CHECK]: Update test.
2023-08-17 10:16:57 +02:00
GCC Administrator
4b92dba78d Daily bump. 2023-08-08 00:17:37 +00:00
Nick Alcock
ab42297456 libtool.m4: fix nm BSD flag detection
Libtool needs to get BSD-format (or MS-format) output out of the system
nm, so that it can scan generated object files for symbol names for
-export-symbols-regex support.  Some nms need specific flags to turn on
BSD-formatted output, so libtool checks for this in its AC_PATH_NM.
Unfortunately the code to do this has a pair of interlocking flaws:

 - it runs the test by doing an nm of /dev/null.  Some platforms
   reasonably refuse to do an nm on a device file, but before now this
   has only been worked around by assuming that the error message has a
   specific textual form emitted by Tru64 nm, and that getting this
   error means this is Tru64 nm and that nm -B would work to produce
   BSD-format output, even though the test never actually got anything
   but an error message out of nm -B.  This is fixable by nm'ing *nm
   itself* (since we necessarily have a path to it).

 - the test is entirely skipped if NM is set in the environment, on the
   grounds that the user has overridden the test: but the user cannot
   reasonably be expected to know that libtool wants not only nm but
   also flags forcing BSD-format output.  Worse yet, one such "user" is
   the top-level Cygnus configure script, which neither tests for
   nor specifies any BSD-format flags.  So platforms needing BSD-format
   flags always fail to set them when run in a Cygnus tree, breaking
   -export-symbols-regex on such platforms.  Libtool also needs to
   augment $LD on some platforms, but this is done unconditionally,
   augmenting whatever the user specified: the nm check should do the
   same.

   One wrinkle: if the user has overridden $NM, a path might have been
   provided: so we use the user-specified path if there was one, and
   otherwise do the path search as usual.  (If the nm specified doesn't
   work, this might lead to a few extra pointless path searches -- but
   the test is going to fail anyway, so that's not a problem.)

(Tested with NM unset, and set to nm, /usr/bin/nm, my-nm where my-nm is a
symlink to /usr/bin/nm on the PATH, and /not-on-the-path/my-nm where
*that* is a symlink to /usr/bin/nm.)

ChangeLog:

	* libtool.m4 (LT_PATH_NM): Try BSDization flags with a user-provided
	NM, if there is one.  Run nm on itself, not on /dev/null, to avoid
	errors from nms that refuse to work on non-regular files.  Remove
	other workarounds for this problem.  Strip out blank lines from the
	nm output.

fixincludes/ChangeLog:

	* configure: Regenerate.

gcc/ChangeLog:

	* configure: Regenerate.

libatomic/ChangeLog:

	* configure: Regenerate.

libbacktrace/ChangeLog:

	* configure: Regenerate.

libcc1/ChangeLog:

	* configure: Regenerate.

libffi/ChangeLog:

	* configure: Regenerate.

libgfortran/ChangeLog:

	* configure: Regenerate.

libgm2/ChangeLog:

	* configure: Regenerate.

libgomp/ChangeLog:

	* configure: Regenerate.

libitm/ChangeLog:

	* configure: Regenerate.

libobjc/ChangeLog:

	* configure: Regenerate.

libphobos/ChangeLog:

	* configure: Regenerate.

libquadmath/ChangeLog:

	* configure: Regenerate.

libsanitizer/ChangeLog:

	* configure: Regenerate.

libssp/ChangeLog:

	* configure: Regenerate.

libstdc++-v3/ChangeLog:

	* configure: Regenerate.

libvtv/ChangeLog:

	* configure: Regenerate.

lto-plugin/ChangeLog:

	* configure: Regenerate.

zlib/ChangeLog:

	* configure: Regenerate.
2023-08-07 22:59:39 +02:00
GCC Administrator
7ff793415f Daily bump. 2023-06-16 00:17:18 +00:00
Marek Polacek
b6cb10af12 configure: Implement --enable-host-pie
[ This is my third attempt to add this configure option.  The first
version was approved but it came too late in the development cycle.
The second version was also approved, but I had to revert it:
<https://gcc.gnu.org/pipermail/gcc-patches/2022-November/607082.html>.
I've fixed the problem (by moving $(PICFLAG) from INTERNAL_CFLAGS to
ALL_COMPILERFLAGS).  Another change is that since r13-4536 I no longer
need to touch Makefile.def, so this patch is simplified. ]

This patch implements the --enable-host-pie configure option which
makes the compiler executables PIE.  This can be used to enhance
protection against ROP attacks, and can be viewed as part of a wider
trend to harden binaries.

It is similar to the option --enable-host-shared, except that --e-h-s
won't add -shared to the linker flags whereas --e-h-p will add -pie.
It is different from --enable-default-pie because that option just
adds an implicit -fPIE/-pie when the compiler is invoked, but the
compiler itself isn't PIE.

Since r12-5768-gfe7c3ecf, PCH works well with PIE, so there are no PCH
regressions.

When building the compiler, the build process may use various in-tree
libraries; these need to be built with -fPIE so that it's possible to
use them when building a PIE.  For instance, when --with-included-gettext
is in effect, intl object files must be compiled with -fPIE.  Similarly,
when building in-tree gmp, isl, mpfr and mpc, they must be compiled with
-fPIE.

With this patch and --enable-host-pie used to configure gcc:

$ file gcc/cc1{,plus,obj,gm2} gcc/f951 gcc/lto1 gcc/cpp gcc/go1 gcc/rust1 gcc/gnat1
gcc/cc1:     ELF 64-bit LSB pie executable, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=98e22cde129d304aa6f33e61b1c39e144aeb135e, for GNU/Linux 3.2.0, with debug_info, not stripped
gcc/cc1plus: ELF 64-bit LSB pie executable, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=859d1ea37e43dfe50c18fd4e3dd9a34bb1db8f77, for GNU/Linux 3.2.0, with debug_info, not stripped
gcc/cc1obj:  ELF 64-bit LSB pie executable, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=1964f8ecee6163182bc26134e2ac1f324816e434, for GNU/Linux 3.2.0, with debug_info, not stripped
gcc/cc1gm2:  ELF 64-bit LSB pie executable, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=a396672c7ff913d21855829202e7b02ecf42ff4c, for GNU/Linux 3.2.0, with debug_info, not stripped
gcc/f951:    ELF 64-bit LSB pie executable, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=59c523db893186547ac75c7a71f48be0a461c06b, for GNU/Linux 3.2.0, with debug_info, not stripped
gcc/lto1:    ELF 64-bit LSB pie executable, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=084a7b77df7be2d63c2d4c655b5bbc3fcdb6038d, for GNU/Linux 3.2.0, with debug_info, not stripped
gcc/cpp:     ELF 64-bit LSB pie executable, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=3503bf8390d219a10d6653b8560aa21158132168, for GNU/Linux 3.2.0, with debug_info, not stripped
gcc/go1:     ELF 64-bit LSB pie executable, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=988cc673af4fba5dcb482f4b34957b99050a68c5, for GNU/Linux 3.2.0, with debug_info, not stripped
gcc/rust1:   ELF 64-bit LSB pie executable, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=b6a5d3d514446c4dcdee0707f086ab9b274a8a3c, for GNU/Linux 3.2.0, with debug_info, not stripped
gcc/gnat1:   ELF 64-bit LSB pie executable, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=bb11ccdc2c366fe3fe0980476bcd8ca19b67f9dc, for GNU/Linux 3.2.0, with debug_info, not stripped

I plan to add an option to link with -Wl,-z,now.

Bootstrapped on x86_64-pc-linux-gnu with --with-included-gettext
--enable-host-pie as well as without --enable-host-pie.  Also tested
on a Debian system where the system gcc was configured with
--enable-default-pie.

Co-Authored by: Iain Sandoe  <iain@sandoe.co.uk>

ChangeLog:

	* configure.ac (--enable-host-pie): New check.  Set PICFLAG after this
	check.
	* configure: Regenerate.

c++tools/ChangeLog:

	* Makefile.in: Rename PIEFLAG to PICFLAG.  Set LD_PICFLAG.  Use it.
	Use pic/libiberty.a if PICFLAG is set.
	* configure.ac (--enable-default-pie): Set PICFLAG instead of PIEFLAG.
	(--enable-host-pie): New check.
	* configure: Regenerate.

fixincludes/ChangeLog:

	* Makefile.in: Set and use PICFLAG and LD_PICFLAG.  Use the "pic"
	build of libiberty if PICFLAG is set.
	* configure.ac:
	* configure: Regenerate.

gcc/ChangeLog:

	* Makefile.in: Set LD_PICFLAG.  Use it.  Set enable_host_pie.
	Remove NO_PIE_CFLAGS and NO_PIE_FLAG.  Pass LD_PICFLAG to
	ALL_LINKERFLAGS.  Use the "pic" build of libiberty if --enable-host-pie.
	* configure.ac (--enable-host-shared): Don't set PICFLAG here.
	(--enable-host-pie): New check.  Set PICFLAG and LD_PICFLAG after this
	check.
	* configure: Regenerate.
	* doc/install.texi: Document --enable-host-pie.

gcc/ada/ChangeLog:

	* gcc-interface/Make-lang.in (ALL_ADAFLAGS): Remove NO_PIE_CFLAGS.  Add
	PICFLAG.  Use PICFLAG when building ada/b_gnat1.o and ada/b_gnatb.o.
	* gcc-interface/Makefile.in: Use pic/libiberty.a if PICFLAG is set.
	Remove NO_PIE_FLAG.

gcc/m2/ChangeLog:

	* Make-lang.in: New var, GM2_PICFLAGS.  Use it.

gcc/d/ChangeLog:

	* Make-lang.in: Remove NO_PIE_CFLAGS.

intl/ChangeLog:

	* Makefile.in: Use @PICFLAG@ in COMPILE as well.
	* configure.ac (--enable-host-shared): Don't set PICFLAG here.
	(--enable-host-pie): New check.  Set PICFLAG after this check.
	* configure: Regenerate.

libcody/ChangeLog:

	* Makefile.in: Pass LD_PICFLAG to LDFLAGS.
	* configure.ac (--enable-host-shared): Don't set PICFLAG here.
	(--enable-host-pie): New check.  Set PICFLAG and LD_PICFLAG after this
	check.
	* configure: Regenerate.

libcpp/ChangeLog:

	* configure.ac (--enable-host-shared): Don't set PICFLAG here.
	(--enable-host-pie): New check.  Set PICFLAG after this check.
	* configure: Regenerate.

libdecnumber/ChangeLog:

	* configure.ac (--enable-host-shared): Don't set PICFLAG here.
	(--enable-host-pie): New check.  Set PICFLAG after this check.
	* configure: Regenerate.

libiberty/ChangeLog:

	* configure.ac: Also set shared when enable_host_pie.
	* configure: Regenerate.

zlib/ChangeLog:

	* configure.ac (--enable-host-shared): Don't set PICFLAG here.
	(--enable-host-pie): New check.  Set PICFLAG after this check.
	* configure: Regenerate.
2023-06-15 16:51:27 -04:00
GCC Administrator
579cdc1e44 Daily bump. 2023-03-29 00:17:01 +00:00
Xi Ruoyao
21c74b6ea4 fixincludes: Declare memmem if it's not declared in system headers [PR109293]
memmem is not POSIX so the system may lack it.  Then libiberty will
provide an implementation, but it's a "supplemental function" and not
declared in libiberty.h.  We need to declare the prototype to use it
then.

See libiberty doc at
https://gcc.gnu.org/onlinedocs/libiberty/Supplemental-Functions.html.

Tested by bootstrapping GCC in the following container environments on
x86_64-linux-gnu:

1. "Vanilla" system with memmem in Glibc.
2. memmem removed from string.h.
3. memmem removed from both string.h and libc.so.

For 3, also verified that memmem from libiberty is linked into fixincl
executable.

Ok for trunk?

fixincludes/ChangeLog:

	PR other/109293
	* configure.ac (AC_CHECK_DECLS): Add memmem.
	* configure: Regenerate.
	* config.h.in: Regenerate.
	* system.h (memmem): Declare if HAVE_DECL_MEMMEM is zero.
2023-03-28 15:26:14 +08:00
GCC Administrator
7814ce44f2 Daily bump. 2023-02-18 00:17:20 +00:00
Rainer Orth
593c8b73fb fixincludes: Bypass solaris_math_12 on newer Solaris 11.4
Solaris 11 <math.h> long had this snippet

which badly broke libstdc++.  This has long been undone using
fixincludes in

	[fixincludes, v3] Don't define libstdc++-internal macros in Solaris 10+ <math.h>
	https://gcc.gnu.org/ml/gcc-patches/2016-11/msg00330.html

However, the issue came up again recently when that code broke the LLVM
build, too, which unfortunately doesn't know about GCC's include-fixed
directory.  The issue was reinvestigated and it turned out that the
workaround/hack is only needed for specific old versions of the Sun/Oracle
Studio compilers.  So <math.h> now looks like

/* Accommodate historical C++11 -std=c++03 behavior of Studio 12.4 and 12.5 */
    ((__SUNPRO_CC == 0x5130) || (__SUNPRO_CC == 0x5140) ||  \
     defined(__MATH_PREEMPTS_GLIBCXX_C99_MATH))

If this change is in place, there's no longer a need for the fixincludes
fix, so this patch bypasses it as appropriate.

Tested on Solaris 11.3 (without the fixed header) and recent 11.4 (with
the fixed header).

2022-11-01  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	fixincludes:
	* inclhack.def (solaris_math_12): Add bypass.
	* fixincl.x: Regenerate.
2023-02-17 13:48:45 +01:00
GCC Administrator
d5717e7f6f Daily bump. 2023-01-22 00:17:27 +00:00
Iain Sandoe
046dc9d0d4 Darwin, fixincludes: Handle Apple Blocks in objc/runtime.h.
The macOS 13 SDK has unguarded Apple Blocks use in objc/runtime.h which
causes most of the objective-c tests to fail.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>

fixincludes/ChangeLog:

	* fixincl.x: Regenerate.
	* inclhack.def (darwin_objc_runtime_1): New hack.
	* tests/base/objc/runtime.h: New file.
2023-01-21 17:08:30 +00:00
Iain Sandoe
442d2bdc1d Darwin, fixincludes: Handle MacOS13 SDK Apple-specific deprecations [PR107568].
The SDK for MacOS13 includes Apple-specific deprecations of some functions that
are not deprecated in Posix, C or C++ and widely used in GCC.

The fix makes the deprecation conditional on __APPLE_LOCAL_DEPRECATIONS so that
end users may still observe them but they are hidden from normal compilations.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>

	PR target/107568

fixincludes/ChangeLog:

	* fixincl.x: Regenerate.
	* inclhack.def: Add a fix for MacOS13 SDK function deprecations
	in stdio.h.
	* tests/base/stdio.h (__deprecated_msg): New test.
2023-01-21 17:07:07 +00:00
GCC Administrator
8761284fd7 Daily bump. 2022-11-24 00:17:47 +00:00
Marek Polacek
04711f5189 Revert "configure: Implement --enable-host-pie"
This reverts commit 251c72a68a.
2022-11-22 21:10:31 -05:00
Marek Polacek
251c72a68a configure: Implement --enable-host-pie
This patch implements the --enable-host-pie configure option which
makes the compiler executables PIE.  This can be used to enhance
protection against ROP attacks, and can be viewed as part of a wider
trend to harden binaries.

It is similar to the option --enable-host-shared, except that --e-h-s
won't add -shared to the linker flags whereas --e-h-p will add -pie.
It is different from --enable-default-pie because that option just
adds an implicit -fPIE/-pie when the compiler is invoked, but the
compiler itself isn't PIE.

Since r12-5768-gfe7c3ecf, PCH works well with PIE, so there are no PCH
regressions.

When building the compiler, the build process may use various in-tree
libraries; these need to be built with -fPIE so that it's possible to
use them when building a PIE.  For instance, when --with-included-gettext
is in effect, intl object files must be compiled with -fPIE.  Similarly,
when building in-tree gmp, isl, mpfr and mpc, they must be compiled with
-fPIE.

I plan to add an option to link with -Wl,-z,now.

ChangeLog:

	* Makefile.def: Pass $(PICFLAG) to AM_CFLAGS for gmp, mpfr, mpc, and
	isl.
	* Makefile.in: Regenerate.
	* Makefile.tpl: Set PICFLAG.
	* configure.ac (--enable-host-pie): New check.  Set PICFLAG after this
	check.
	* configure: Regenerate.

c++tools/ChangeLog:

	* Makefile.in: Rename PIEFLAG to PICFLAG.  Set LD_PICFLAG.  Use it.
	Use pic/libiberty.a if PICFLAG is set.
	* configure.ac (--enable-default-pie): Set PICFLAG instead of PIEFLAG.
	(--enable-host-pie): New check.
	* configure: Regenerate.

fixincludes/ChangeLog:

	* Makefile.in: Set and use PICFLAG and LD_PICFLAG.  Use the "pic"
	build of libiberty if PICFLAG is set.
	* configure.ac:
	* configure: Regenerate.

gcc/ChangeLog:

	* Makefile.in: Set LD_PICFLAG.  Use it.  Set enable_host_pie.
	Remove NO_PIE_CFLAGS and NO_PIE_FLAG.  Pass LD_PICFLAG to
	ALL_LINKERFLAGS.  Use the "pic" build of libiberty if --enable-host-pie.
	* configure.ac (--enable-host-shared): Don't set PICFLAG here.
	(--enable-host-pie): New check.  Set PICFLAG and LD_PICFLAG after this
	check.
	* configure: Regenerate.
	* doc/install.texi: Document --enable-host-pie.

gcc/d/ChangeLog:

	* Make-lang.in: Remove NO_PIE_CFLAGS.

intl/ChangeLog:

	* Makefile.in: Use @PICFLAG@ in COMPILE as well.
	* configure.ac (--enable-host-shared): Don't set PICFLAG here.
	(--enable-host-pie): New check.  Set PICFLAG after this check.
	* configure: Regenerate.

libcody/ChangeLog:

	* Makefile.in: Pass LD_PICFLAG to LDFLAGS.
	* configure.ac (--enable-host-shared): Don't set PICFLAG here.
	(--enable-host-pie): New check.  Set PICFLAG and LD_PICFLAG after this
	check.
	* configure: Regenerate.

libcpp/ChangeLog:

	* configure.ac (--enable-host-shared): Don't set PICFLAG here.
	(--enable-host-pie): New check.  Set PICFLAG after this check.
	* configure: Regenerate.

libdecnumber/ChangeLog:

	* configure.ac (--enable-host-shared): Don't set PICFLAG here.
	(--enable-host-pie): New check.  Set PICFLAG after this check.
	* configure: Regenerate.

libiberty/ChangeLog:

	* configure.ac: Also set shared when enable_host_pie.
	* configure: Regenerate.

zlib/ChangeLog:

	* configure.ac (--enable-host-shared): Don't set PICFLAG here.
	(--enable-host-pie): New check.  Set PICFLAG after this check.
	* configure: Regenerate.
2022-11-22 20:32:18 -05:00
Martin Liska
3d3b561fc3 changelog: Fix extra space after tab. 2022-11-21 10:13:44 +01:00
GCC Administrator
9ff6c33e2e Daily bump. 2022-10-08 00:17:29 +00:00
Jakub Jelinek
348e46fa8c fixincludes: Deal also with the _Float128x cases [PR107059]
On Wed, Sep 28, 2022 at 08:19:43PM +0200, Jakub Jelinek via Gcc-patches wrote:
> Another case are the following 3 snippets:
> #  if !__GNUC_PREREQ (7, 0) || defined __cplusplus
> #   error "_Float128X supported but no constant suffix"
> #  else
> #   define __f128x(x) x##f128x
> #  endif
> ...
> #  if !__GNUC_PREREQ (7, 0) || defined __cplusplus
> #   error "_Float128X supported but no complex type"
> #  else
> #   define __CFLOAT128X _Complex _Float128x
> #  endif
> ...
> #  if !__GNUC_PREREQ (7, 0) || defined __cplusplus
> #   error "_Float128x supported but no type"
> #  endif
> but as no target has _Float128x right now and don't see it
> coming soon, it isn't a big deal (on the glibc side it is of
> course ok to adjust those).

This incremental patch deals handles the above 3 cases, so we
fixinclude what glibc itself changed too.

2022-10-07  Jakub Jelinek  <jakub@redhat.com>

	PR bootstrap/107059
	* inclhack.def (glibc_cxx_floatn_5): New.
	* fixincl.x: Regenerated.
	* tests/base/bits/floatn.h: Regenerated.
2022-10-07 09:00:00 +02:00
Jakub Jelinek
62ec780ac0 fixincludes: Fix up powerpc floatn.h tweaks [PR107059]
On Wed, Sep 28, 2022 at 12:23:31AM +0000, Joseph Myers wrote:
> In general the changes match those made by fixincludes, though I think
> the ones in sysdeps/powerpc/bits/floatn.h, where the header tests
> __LDBL_MANT_DIG__ == 113 or uses #elif, wouldn't match the existing
> fixincludes patterns.

You're right, missed that.
The header has:
 /* Defined to a complex binary128 type if __HAVE_FLOAT128 is 1.  */
 # if __HAVE_FLOAT128
 #  if __LDBL_MANT_DIG__ == 113 && defined __cplusplus
 typedef long double _Float128;
 #   define __CFLOAT128 _Complex long double
 #  elif !__GNUC_PREREQ (7, 0) || defined __cplusplus
 /* The type _Float128 exist for powerpc only since GCC 7.0.  */
 typedef __float128 _Float128;
 /* Add a typedef for older GCC and C++ compilers which don't natively support
    _Complex _Float128.  */
 typedef _Complex float __cfloat128 __attribute__ ((__mode__ (__KC__)));
 #   define __CFLOAT128 __cfloat128
 #  else
 #   define __CFLOAT128 _Complex _Float128
 #  endif
 # endif
and my current rules don't do anything about that.

The following patch fixes that.
I've run additionally
MACRO_LIST=`pwd`/../gcc/macro_list TARGET_MACHINE=x86_64-pc-linux-gnu \
  ../fixincludes/fixinc.sh /tmp/include-fixed \
    `echo /usr/src/libc | sed -e :a -e 's,[^/]*/\.\.\/,,' -e ta`
in the builddir/fixincludes directory where /usr/src/libc is latest glibc
trunk checkout and seems the remaining defined __cplusplus cases in the floatn.h
and floatn-common.h headers are ok or acceptable.
The remaining cases are:
 #if __GNUC_PREREQ (7, 0) && !defined __cplusplus
 # define __HAVE_FLOATN_NOT_TYPEDEF 1
 #else
 # define __HAVE_FLOATN_NOT_TYPEDEF 0
 #endif
which is IMHO ok because this is only used in tgmath.h or tgmath-like math.h
stuff which is C only, as C++ doesn't have _Generic.
Another case are the following 3 snippets:
 #  if !__GNUC_PREREQ (7, 0) || defined __cplusplus
 #   error "_Float128X supported but no constant suffix"
 #  else
 #   define __f128x(x) x##f128x
 #  endif
...
 #  if !__GNUC_PREREQ (7, 0) || defined __cplusplus
 #   error "_Float128X supported but no complex type"
 #  else
 #   define __CFLOAT128X _Complex _Float128x
 #  endif
...
 #  if !__GNUC_PREREQ (7, 0) || defined __cplusplus
 #   error "_Float128x supported but no type"
 #  endif
but as no target has _Float128x right now and don't see it
coming soon, it isn't a big deal (on the glibc side it is of
course ok to adjust those).
OT, besides floatn.h and floatn-common.h headers, the only
one remaining in /tmp/include-fixed is sysdeps/arm/unwind.h, perhaps
-#if defined(linux) || defined(__NetBSD__)
+#if defined(__linux__) || defined(__NetBSD__)
should be done in that header (and libgcc/config/arm/unwind-arm.h
too).

2022-10-07  Jakub Jelinek  <jakub@redhat.com>

	PR bootstrap/107059
	* inclhack.def (glibc_cxx_floatn_2): Handle #elif the same as #if.
	(glibc_cxx_floatn_4): New.
	* fixincl.x: Regenerated.
	* tests/base/bits/floatn.h: Regenerated.
2022-10-07 09:00:00 +02:00
GCC Administrator
1f16a020ac Daily bump. 2022-09-28 00:17:27 +00:00
Jakub Jelinek
b939a5cc41 fixincludes: FIx up for Debian/Ubuntu includes
As reported by Tobias, my C++ _Float{16,32,64,128,32x,64x,128x} support
patch broke Debian/Ubuntu bootstraps.  The problem is that there
glibc bits/floatn.h and bits/floatn-common.h isn't in /usr/include/
directly, but in a subdirectory like /usr/include/x86_64-linux-gnu/
Seems other fixinclude rules for bits/* headers use
files = bits/whatever.h, "*/bits/whatever.h";
so this patch just follows the suit.

2022-06-27  Jakub Jelinek  <jakub@redhat.com>

	* inclhack.def (glibc_cxx_floatn_1, glibc_cxx_floatn_2,
	glibc_cxx_floatn_3): Add to files also "*/bits/floatn.h"
	and "*/bits/floatn-common.h".
	* fixincl.x: Regenerated.
2022-09-27 12:33:23 +02:00