<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/gcc.git/fixincludes, branch master</title>
<subtitle>gcc.gnu.org: git/gcc.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gcc.git/'/>
<entry>
<title>Daily bump.</title>
<updated>2023-03-29T00:17:01+00:00</updated>
<author>
<name>GCC Administrator</name>
<email>gccadmin@gcc.gnu.org</email>
</author>
<published>2023-03-29T00:17:01+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gcc.git/commit/?id=579cdc1e44b316166ebfdfbcff14d41101003aec'/>
<id>579cdc1e44b316166ebfdfbcff14d41101003aec</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>fixincludes: Declare memmem if it's not declared in system headers [PR109293]</title>
<updated>2023-03-28T07:26:14+00:00</updated>
<author>
<name>Xi Ruoyao</name>
<email>xry111@xry111.site</email>
</author>
<published>2023-03-27T17:48:02+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gcc.git/commit/?id=21c74b6ea41d21ef96813b34bfa55c51a82d6c99'/>
<id>21c74b6ea41d21ef96813b34bfa55c51a82d6c99</id>
<content type='text'>
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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.
</pre>
</div>
</content>
</entry>
<entry>
<title>Daily bump.</title>
<updated>2023-02-18T00:17:20+00:00</updated>
<author>
<name>GCC Administrator</name>
<email>gccadmin@gcc.gnu.org</email>
</author>
<published>2023-02-18T00:17:20+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gcc.git/commit/?id=7814ce44f24181a4e8e8e0d6815fe2f493b2aa33'/>
<id>7814ce44f24181a4e8e8e0d6815fe2f493b2aa33</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>fixincludes: Bypass solaris_math_12 on newer Solaris 11.4</title>
<updated>2023-02-17T12:48:45+00:00</updated>
<author>
<name>Rainer Orth</name>
<email>ro@CeBiTec.Uni-Bielefeld.DE</email>
</author>
<published>2023-02-17T12:48:45+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gcc.git/commit/?id=593c8b73fb15683fdd1a9d85fe7e7e99540de3c8'/>
<id>593c8b73fb15683fdd1a9d85fe7e7e99540de3c8</id>
<content type='text'>
Solaris 11 &lt;math.h&gt; 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+ &lt;math.h&gt;
	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 &lt;math.h&gt; 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  &lt;ro@CeBiTec.Uni-Bielefeld.DE&gt;

	fixincludes:
	* inclhack.def (solaris_math_12): Add bypass.
	* fixincl.x: Regenerate.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Solaris 11 &lt;math.h&gt; 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+ &lt;math.h&gt;
	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 &lt;math.h&gt; 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  &lt;ro@CeBiTec.Uni-Bielefeld.DE&gt;

	fixincludes:
	* inclhack.def (solaris_math_12): Add bypass.
	* fixincl.x: Regenerate.
</pre>
</div>
</content>
</entry>
<entry>
<title>Daily bump.</title>
<updated>2023-01-22T00:17:27+00:00</updated>
<author>
<name>GCC Administrator</name>
<email>gccadmin@gcc.gnu.org</email>
</author>
<published>2023-01-22T00:17:27+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gcc.git/commit/?id=d5717e7f6fd5a13356ebc46c3b54e081a99dd826'/>
<id>d5717e7f6fd5a13356ebc46c3b54e081a99dd826</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Darwin, fixincludes: Handle Apple Blocks in objc/runtime.h.</title>
<updated>2023-01-21T17:08:30+00:00</updated>
<author>
<name>Iain Sandoe</name>
<email>iain@sandoe.co.uk</email>
</author>
<published>2023-01-18T23:25:36+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gcc.git/commit/?id=046dc9d0d4683bab99d28983d8841ba3c56ef744'/>
<id>046dc9d0d4683bab99d28983d8841ba3c56ef744</id>
<content type='text'>
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 &lt;iain@sandoe.co.uk&gt;

fixincludes/ChangeLog:

	* fixincl.x: Regenerate.
	* inclhack.def (darwin_objc_runtime_1): New hack.
	* tests/base/objc/runtime.h: New file.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;iain@sandoe.co.uk&gt;

fixincludes/ChangeLog:

	* fixincl.x: Regenerate.
	* inclhack.def (darwin_objc_runtime_1): New hack.
	* tests/base/objc/runtime.h: New file.
</pre>
</div>
</content>
</entry>
<entry>
<title>Darwin, fixincludes: Handle MacOS13 SDK Apple-specific deprecations [PR107568].</title>
<updated>2023-01-21T17:07:07+00:00</updated>
<author>
<name>Iain Sandoe</name>
<email>iain@sandoe.co.uk</email>
</author>
<published>2023-01-18T19:58:33+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gcc.git/commit/?id=442d2bdc1d2a98aba0b18aeaa3e87fa946ac8031'/>
<id>442d2bdc1d2a98aba0b18aeaa3e87fa946ac8031</id>
<content type='text'>
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 &lt;iain@sandoe.co.uk&gt;

	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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;iain@sandoe.co.uk&gt;

	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.
</pre>
</div>
</content>
</entry>
<entry>
<title>Daily bump.</title>
<updated>2022-11-24T00:17:47+00:00</updated>
<author>
<name>GCC Administrator</name>
<email>gccadmin@gcc.gnu.org</email>
</author>
<published>2022-11-24T00:17:47+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gcc.git/commit/?id=8761284fd7862fbd9665237145f3a0d8de79c265'/>
<id>8761284fd7862fbd9665237145f3a0d8de79c265</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "configure: Implement --enable-host-pie"</title>
<updated>2022-11-23T02:10:31+00:00</updated>
<author>
<name>Marek Polacek</name>
<email>polacek@redhat.com</email>
</author>
<published>2022-11-23T02:10:31+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gcc.git/commit/?id=04711f5189a72c2fcaeed520d65582704adca042'/>
<id>04711f5189a72c2fcaeed520d65582704adca042</id>
<content type='text'>
This reverts commit 251c72a68af3a8b0638705b73ef120ffdf0053eb.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit 251c72a68af3a8b0638705b73ef120ffdf0053eb.
</pre>
</div>
</content>
</entry>
<entry>
<title>configure: Implement --enable-host-pie</title>
<updated>2022-11-23T01:32:18+00:00</updated>
<author>
<name>Marek Polacek</name>
<email>polacek@redhat.com</email>
</author>
<published>2022-11-10T21:33:03+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gcc.git/commit/?id=251c72a68af3a8b0638705b73ef120ffdf0053eb'/>
<id>251c72a68af3a8b0638705b73ef120ffdf0053eb</id>
<content type='text'>
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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.
</pre>
</div>
</content>
</entry>
</feed>
