Re: Fwd: PING^3: [PATCH]: New configure options that make the compiler use -fPIE and -pie as default option

2015-10-29 Thread H.J. Lu
On Thu, Oct 29, 2015 at 4:00 AM, Richard Earnshaw wrote: > On 23/10/15 13:34, H.J. Lu wrote: >> On Fri, Oct 23, 2015 at 4:54 AM, Marcus Shawcroft >> wrote: >>> Hi, >>> >>> This patch breaks the distinction between build and host. For example >>> consider a configure along these lines: >>> >>> ./c

Re: Fwd: PING^3: [PATCH]: New configure options that make the compiler use -fPIE and -pie as default option

2015-10-29 Thread Richard Earnshaw
On 23/10/15 13:34, H.J. Lu wrote: > On Fri, Oct 23, 2015 at 4:54 AM, Marcus Shawcroft > wrote: >> Hi, >> >> This patch breaks the distinction between build and host. For example >> consider a configure along these lines: >> >> ./configure --host=aarch64-none-linux-gnu >> --target=aarch64-none-linu

Re: Fwd: PING^3: [PATCH]: New configure options that make the compiler use -fPIE and -pie as default option

2015-10-28 Thread Marcus Shawcroft
On 23 October 2015 at 13:34, H.J. Lu wrote: > On Fri, Oct 23, 2015 at 4:54 AM, Marcus Shawcroft > wrote: >> Hi, >> >> This patch breaks the distinction between build and host. For example >> consider a configure along these lines: >> >> ./configure --host=aarch64-none-linux-gnu >> --target=aarch6

Re: Fwd: PING^3: [PATCH]: New configure options that make the compiler use -fPIE and -pie as default option

2015-10-23 Thread Marcus Shawcroft
On 23 October 2015 at 13:34, H.J. Lu wrote: > On Fri, Oct 23, 2015 at 4:54 AM, Marcus Shawcroft > wrote: >> Hi, >> >> This patch breaks the distinction between build and host. For example >> consider a configure along these lines: >> >> ./configure --host=aarch64-none-linux-gnu >> --target=aarch6

Re: Fwd: PING^3: [PATCH]: New configure options that make the compiler use -fPIE and -pie as default option

2015-10-23 Thread H.J. Lu
On Fri, Oct 23, 2015 at 4:54 AM, Marcus Shawcroft wrote: > Hi, > > This patch breaks the distinction between build and host. For example > consider a configure along these lines: > > ./configure --host=aarch64-none-linux-gnu > --target=aarch64-none-linux-gnu --build=x86_64-pc-linux-gnu > > Will re

Re: Fwd: PING^3: [PATCH]: New configure options that make the compiler use -fPIE and -pie as default option

2015-10-23 Thread Marcus Shawcroft
Hi, This patch breaks the distinction between build and host. For example consider a configure along these lines: ./configure --host=aarch64-none-linux-gnu --target=aarch64-none-linux-gnu --build=x86_64-pc-linux-gnu Will result in: CXX_FOR_BUILD='g++' CXX='aarch64-none-linux-gnu-g++' the gcc/c

Re: PING^3: [PATCH]: New configure options that make the compiler use -fPIE and -pie as default option

2015-06-10 Thread Rainer Orth
"H.J. Lu" writes: > On Tue, May 19, 2015 at 8:33 AM, Joseph Myers wrote: >> On Tue, 19 May 2015, H.J. Lu wrote: >> >>> > I think the whole thing should be posted as one patch, with both the >>> > target-independent changes and the target-specific changes for all >>> > targets. >>> > >>> >>> That

Re: PING^3: [PATCH]: New configure options that make the compiler use -fPIE and -pie as default option

2015-06-03 Thread Rainer Orth
"H.J. Lu" writes: > On Thu, May 21, 2015 at 7:13 AM, Rainer Orth > wrote: >> "H.J. Lu" writes: >> >>> Here is the complete patch. Tested on Linux/x86-64. It is also >>> available on hjl/pie/master branch in git mirror. Now that the patch is in, I see a couple of testsuite regressions on both

Re: Fwd: PING^3: [PATCH]: New configure options that make the compiler use -fPIE and -pie as default option

2015-05-31 Thread H.J. Lu
On Sun, May 31, 2015 at 12:04 AM, Andreas Schwab wrote: > configure:28726: checking for -fno-PIE option > configure:28737: g++ -c -g conftest.cpp >&5 > configure:28737: $? = 0 > configure:28745: result: yes Since GCC is written in C++ now, we need to check CXXFLAGS instead of CFLAGS for NO_PIE_

Re: Fwd: PING^3: [PATCH]: New configure options that make the compiler use -fPIE and -pie as default option

2015-05-31 Thread Andreas Schwab
configure:28726: checking for -fno-PIE option configure:28737: g++ -c -g conftest.cpp >&5 configure:28737: $? = 0 configure:28745: result: yes Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something compl

Re: Fwd: PING^3: [PATCH]: New configure options that make the compiler use -fPIE and -pie as default option

2015-05-30 Thread H.J. Lu
On Sat, May 30, 2015 at 2:18 PM, Andreas Schwab wrote: > "H.J. Lu" writes: > >> What is wrong with it? > > It tests nothing. > Can you explain? -- H.J.

Re: Fwd: PING^3: [PATCH]: New configure options that make the compiler use -fPIE and -pie as default option

2015-05-30 Thread Andreas Schwab
"H.J. Lu" writes: > What is wrong with it? It tests nothing. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."

Re: Fwd: PING^3: [PATCH]: New configure options that make the compiler use -fPIE and -pie as default option

2015-05-30 Thread H.J. Lu
On Sat, May 30, 2015 at 9:44 AM, Andreas Schwab wrote: > "H.J. Lu" writes: > >> There is no harm and the message is gone in stage 2 and 3, >> We can treat it the same as other spurious messages from the >> bootstrap compiler. > > But you still need to fix the first test, since it doesn't test > a

Re: Fwd: PING^3: [PATCH]: New configure options that make the compiler use -fPIE and -pie as default option

2015-05-30 Thread Andreas Schwab
Andreas Schwab writes: > "H.J. Lu" writes: > >> diff --git a/gcc/config/m68k/m68k.h b/gcc/config/m68k/m68k.h >> index 88356cc..74ebff7 100644 >> --- a/gcc/config/m68k/m68k.h >> +++ b/gcc/config/m68k/m68k.h >> @@ -40,7 +40,8 @@ along with GCC; see the file COPYING3. If not see >> %{m68020-40:-m

Re: Fwd: PING^3: [PATCH]: New configure options that make the compiler use -fPIE and -pie as default option

2015-05-30 Thread Andreas Schwab
"H.J. Lu" writes: > There is no harm and the message is gone in stage 2 and 3, > We can treat it the same as other spurious messages from the > bootstrap compiler. But you still need to fix the first test, since it doesn't test anything. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG K

Re: Fwd: PING^3: [PATCH]: New configure options that make the compiler use -fPIE and -pie as default option

2015-05-30 Thread Andreas Schwab
"H.J. Lu" writes: > diff --git a/gcc/config/m68k/m68k.h b/gcc/config/m68k/m68k.h > index 88356cc..74ebff7 100644 > --- a/gcc/config/m68k/m68k.h > +++ b/gcc/config/m68k/m68k.h > @@ -40,7 +40,8 @@ along with GCC; see the file COPYING3. If not see > %{m68020-40:-m68040}%{m68020-60:-m68040}\ > %{m

Re: Fwd: PING^3: [PATCH]: New configure options that make the compiler use -fPIE and -pie as default option

2015-05-30 Thread H.J. Lu
On Sat, May 30, 2015 at 8:54 AM, Andreas Schwab wrote: > "H.J. Lu" writes: > >> Starting GCC 4.6, the unrecognized option became an error. >> Before 4.6, it was ignored. Does it cause any problems for >> bootstrap? > > No, only spurious messages. > There is no harm and the message is gone in st

Re: Fwd: PING^3: [PATCH]: New configure options that make the compiler use -fPIE and -pie as default option

2015-05-30 Thread Andreas Schwab
"H.J. Lu" writes: > Starting GCC 4.6, the unrecognized option became an error. > Before 4.6, it was ignored. Does it cause any problems for > bootstrap? No, only spurious messages. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214

Re: Fwd: PING^3: [PATCH]: New configure options that make the compiler use -fPIE and -pie as default option

2015-05-30 Thread H.J. Lu
On Sat, May 30, 2015 at 8:10 AM, Andreas Schwab wrote: > "H.J. Lu" writes: > >> +# Check if -fno-PIE works. >> +AC_CACHE_CHECK([for -fno-PIE option], >> + [gcc_cv_c_no_fpie], >> + [saved_CFLAGS="$CFLAGS" >> + CFLAGS="$CFLAGS -fno-PIE" >> + AC_COMPILE_IFELSE([int main(void) {return 0;}], >>

Re: Fwd: PING^3: [PATCH]: New configure options that make the compiler use -fPIE and -pie as default option

2015-05-30 Thread Andreas Schwab
"H.J. Lu" writes: > +# Check if -fno-PIE works. > +AC_CACHE_CHECK([for -fno-PIE option], > + [gcc_cv_c_no_fpie], > + [saved_CFLAGS="$CFLAGS" > + CFLAGS="$CFLAGS -fno-PIE" > + AC_COMPILE_IFELSE([int main(void) {return 0;}], > + [gcc_cv_c_no_fpie=yes], > + [gcc_cv_c_no_fpie=no]) > +

Re: Fwd: PING^3: [PATCH]: New configure options that make the compiler use -fPIE and -pie as default option

2015-05-27 Thread H.J. Lu
On Wed, May 27, 2015 at 9:59 AM, David Edelsohn wrote: > On Wed, May 27, 2015 at 12:18 PM, H.J. Lu wrote: >> On Wed, May 27, 2015 at 9:05 AM, Peter Bergner wrote: >>> On Wed, 2015-05-27 at 08:36 -0700, H.J. Lu wrote: On Wed, May 27, 2015 at 8:24 AM, Peter Bergner wrote: > On Tue

Re: Fwd: PING^3: [PATCH]: New configure options that make the compiler use -fPIE and -pie as default option

2015-05-27 Thread David Edelsohn
On Wed, May 27, 2015 at 12:18 PM, H.J. Lu wrote: > On Wed, May 27, 2015 at 9:05 AM, Peter Bergner wrote: >> On Wed, 2015-05-27 at 08:36 -0700, H.J. Lu wrote: >>> On Wed, May 27, 2015 at 8:24 AM, Peter Bergner wrote: >>> > On Tue, 2015-05-26 at 16:40 -0500, Bill Schmidt wrote: >>> >> Ah, never mi

Re: Fwd: PING^3: [PATCH]: New configure options that make the compiler use -fPIE and -pie as default option

2015-05-27 Thread H.J. Lu
On Wed, May 27, 2015 at 9:05 AM, Peter Bergner wrote: > On Wed, 2015-05-27 at 08:36 -0700, H.J. Lu wrote: >> On Wed, May 27, 2015 at 8:24 AM, Peter Bergner wrote: >> > On Tue, 2015-05-26 at 16:40 -0500, Bill Schmidt wrote: >> >> Ah, never mind. I guess I need to run automake first. >> > >> > I r

Re: Fwd: PING^3: [PATCH]: New configure options that make the compiler use -fPIE and -pie as default option

2015-05-27 Thread Peter Bergner
On Wed, 2015-05-27 at 08:36 -0700, H.J. Lu wrote: > On Wed, May 27, 2015 at 8:24 AM, Peter Bergner wrote: > > On Tue, 2015-05-26 at 16:40 -0500, Bill Schmidt wrote: > >> Ah, never mind. I guess I need to run automake first. > > > > I ran the patch on powerpc64-linux (ie, Big Endian) both with and

Re: Fwd: PING^3: [PATCH]: New configure options that make the compiler use -fPIE and -pie as default option

2015-05-27 Thread H.J. Lu
On Wed, May 27, 2015 at 8:24 AM, Peter Bergner wrote: > On Tue, 2015-05-26 at 16:40 -0500, Bill Schmidt wrote: >> Ah, never mind. I guess I need to run automake first. > > I ran the patch on powerpc64-linux (ie, Big Endian) both with and > without --enable-default-pie. Both bootstraps completed

Re: Fwd: PING^3: [PATCH]: New configure options that make the compiler use -fPIE and -pie as default option

2015-05-27 Thread Peter Bergner
On Tue, 2015-05-26 at 16:40 -0500, Bill Schmidt wrote: > Ah, never mind. I guess I need to run automake first. I ran the patch on powerpc64-linux (ie, Big Endian) both with and without --enable-default-pie. Both bootstraps completed with no errors and the without --enable-default-pie regtested w

Re: PING^3: [PATCH]: New configure options that make the compiler use -fPIE and -pie as default option

2015-05-26 Thread H.J. Lu
On Tue, May 26, 2015 at 3:11 PM, Matthew Fortune wrote: > The change for MIPS looks fine by visual inspection and I've built both > a default pie and default no-pie compiler. The default pie won't build > glibc but I am pretty sure it is not down to this patch. I haven't had > time to look into wh

RE: PING^3: [PATCH]: New configure options that make the compiler use -fPIE and -pie as default option

2015-05-26 Thread Matthew Fortune
The change for MIPS looks fine by visual inspection and I've built both a default pie and default no-pie compiler. The default pie won't build glibc but I am pretty sure it is not down to this patch. I haven't had time to look into why it won't build though, something related to selecting the CRT f

Re: Fwd: PING^3: [PATCH]: New configure options that make the compiler use -fPIE and -pie as default option

2015-05-26 Thread Bill Schmidt
Ah, never mind. I guess I need to run automake first. Bill On Tue, 2015-05-26 at 16:39 -0500, Bill Schmidt wrote: > Hi H.J., > > I tried your patch on powerpc64le-linux-gnu, and it fails to bootstrap > as follows: > > > g++ -std=c++98 -c -g -DIN_GCC-fno-exceptions -fno-rtti > > -fasynch

Re: Fwd: PING^3: [PATCH]: New configure options that make the compiler use -fPIE and -pie as default option

2015-05-26 Thread Bill Schmidt
Hi H.J., I tried your patch on powerpc64le-linux-gnu, and it fails to bootstrap as follows: > g++ -std=c++98 -c -g -DIN_GCC-fno-exceptions -fno-rtti > -fasynchronous-unwi > nd-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-format > -Wmiss > ing-format-attribute -Woverload

Re: Fwd: PING^3: [PATCH]: New configure options that make the compiler use -fPIE and -pie as default option

2015-05-22 Thread H.J. Lu
I fixed a typo in gcc/config/openbsd.h. Here is the updated patch. The whole patch is also on hjl/pie/master branch in GCC git mirror. -- H.J. From 64364101d6c888e20eb1146ee2baac4b08e684cf Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Tue, 19 May 2015 10:12:20 -0700 Subject: [PATCH] Add --ena

Re: PING^3: [PATCH]: New configure options that make the compiler use -fPIE and -pie as default option

2015-05-21 Thread H.J. Lu
On Thu, May 21, 2015 at 7:13 AM, Rainer Orth wrote: > "H.J. Lu" writes: > >> Here is the complete patch. Tested on Linux/x86-64. It is also >> available on hjl/pie/master branch in git mirror. > > As always, please keep generated files like configure and config.in out > of the submission: it si

Re: PING^3: [PATCH]: New configure options that make the compiler use -fPIE and -pie as default option

2015-05-21 Thread Joseph Myers
On Thu, 21 May 2015, Rainer Orth wrote: > @@ -1864,6 +1873,12 @@ libgcc.mvars: config.status Makefile specs > xgcc$(exeext) > echo GCC_CFLAGS = '$(GCC_CFLAGS)' >> tmp-libgcc.mvars > echo INHIBIT_LIBC_CFLAGS = '$(INHIBIT_LIBC_CFLAGS)' >> tmp-libgcc.mvars > echo TARGET_SYSTEM_ROOT

Re: PING^3: [PATCH]: New configure options that make the compiler use -fPIE and -pie as default option

2015-05-21 Thread Rainer Orth
"H.J. Lu" writes: > Here is the complete patch. Tested on Linux/x86-64. It is also > available on hjl/pie/master branch in git mirror. As always, please keep generated files like configure and config.in out of the submission: it simplifies review. diff --git a/gcc/Makefile.in b/gcc/Makefile.i

Re: PING^3: [PATCH]: New configure options that make the compiler use -fPIE and -pie as default option

2015-05-20 Thread H.J. Lu
On Wed, May 20, 2015 at 3:53 PM, Hans-Peter Nilsson wrote: >> From: "H.J. Lu" >> Date: Tue, 19 May 2015 21:20:46 +0200 > >> This patch affects your target. Can you verify if it is OK on >> your target? > > If you mean philosophically, it's ok when the general bits and > direction are ok, but for

Re: PING^3: [PATCH]: New configure options that make the compiler use -fPIE and -pie as default option

2015-05-20 Thread Hans-Peter Nilsson
> From: "H.J. Lu" > Date: Tue, 19 May 2015 21:20:46 +0200 > This patch affects your target. Can you verify if it is OK on > your target? If you mean philosophically, it's ok when the general bits and direction are ok, but for the practical part of checking e.g. for typos through compilation, pl

Re: PING^3: [PATCH]: New configure options that make the compiler use -fPIE and -pie as default option

2015-05-20 Thread Joseph Myers
On Tue, 19 May 2015, H.J. Lu wrote: > Here is the complete patch. Tested on Linux/x86-64. It is also > available on hjl/pie/master branch in git mirror. OK a week after you CC all relevant target maintainers on the patch, in the absence of objections from those target maintainers. -- Joseph

Re: PING^3: [PATCH]: New configure options that make the compiler use -fPIE and -pie as default option

2015-05-19 Thread H.J. Lu
On Tue, May 19, 2015 at 8:33 AM, Joseph Myers wrote: > On Tue, 19 May 2015, H.J. Lu wrote: > >> > I think the whole thing should be posted as one patch, with both the >> > target-independent changes and the target-specific changes for all >> > targets. >> > >> >> That is what makes me concerned.

Re: PING^3: [PATCH]: New configure options that make the compiler use -fPIE and -pie as default option

2015-05-19 Thread H.J. Lu
Granberg; GCC Patches > Subject: Re: PING^3: [PATCH]: New configure options that make the compiler > use -fPIE and -pie as default option > > On Tue, May 19, 2015 at 8:21 AM, Joseph Myers wrote: >> ... >> I think the whole thing should be posted as one patch, with both the

RE: PING^3: [PATCH]: New configure options that make the compiler use -fPIE and -pie as default option

2015-05-19 Thread Paul_Koning
make the compiler use -fPIE and -pie as default option On Tue, May 19, 2015 at 8:21 AM, Joseph Myers wrote: > ... > I think the whole thing should be posted as one patch, with both the > target-independent changes and the target-specific changes for all > targets. > That i

Re: PING^3: [PATCH]: New configure options that make the compiler use -fPIE and -pie as default option

2015-05-19 Thread Joseph Myers
On Tue, 19 May 2015, H.J. Lu wrote: > > I think the whole thing should be posted as one patch, with both the > > target-independent changes and the target-specific changes for all > > targets. > > > > That is what makes me concerned. I have some simple target-specified > patches which weren't re

Re: PING^3: [PATCH]: New configure options that make the compiler use -fPIE and -pie as default option

2015-05-19 Thread H.J. Lu
On Tue, May 19, 2015 at 8:21 AM, Joseph Myers wrote: > On Mon, 18 May 2015, H.J. Lu wrote: > >> > Have updates for all affected specs for all targets been posted? I just >> > saw a small and apparently arbitrary subset of targets with patches, and >> > no explanation of how those targets were ide

Re: PING^3: [PATCH]: New configure options that make the compiler use -fPIE and -pie as default option

2015-05-19 Thread Joseph Myers
On Mon, 18 May 2015, H.J. Lu wrote: > > Have updates for all affected specs for all targets been posted? I just > > saw a small and apparently arbitrary subset of targets with patches, and > > no explanation of how those targets were identified or why the other > > targets with specs mentioning t

Re: PING^3: [PATCH]: New configure options that make the compiler use -fPIE and -pie as default option

2015-05-18 Thread H.J. Lu
On Mon, May 18, 2015 at 6:11 PM, Joseph Myers wrote: > On Tue, 19 May 2015, Magnus Granberg wrote: > >> > > noted a >> > > possible issue with MIPS. Actually, rather more config/*.h and >> > > config/*/*.h headers contain specs testing fo

Re: PING^3: [PATCH]: New configure options that make the compiler use -fPIE and -pie as default option

2015-05-18 Thread Joseph Myers
On Tue, 19 May 2015, Magnus Granberg wrote: > > > noted a > > > possible issue with MIPS. Actually, rather more config/*.h and > > > config/*/*.h headers contain specs testing for (-fpie, -fPIE, -fno-pie, > > > -fno-PIE, -pie) options, wh

Re: PING^3: [PATCH]: New configure options that make the compiler use -fPIE and -pie as default option

2015-05-18 Thread Magnus Granberg
fredag 08 maj 2015 10.35.44 skrev H.J. Lu: > On Thu, May 7, 2015 at 2:17 PM, Joseph Myers wrote: > > On Fri, 6 Mar 2015, H.J. Lu wrote: > >> +# We don't want to compile the compiler with -fPIE, it make PCH fail. > >> +COMPILER += @NO_PIE_CFLAGS@ > >> + > >> +# Link with -no-pie since we compile

Re: PING^3: [PATCH]: New configure options that make the compiler use -fPIE and -pie as default option

2015-05-08 Thread H.J. Lu
On Thu, May 7, 2015 at 2:17 PM, Joseph Myers wrote: > On Fri, 6 Mar 2015, H.J. Lu wrote: > >> +# We don't want to compile the compiler with -fPIE, it make PCH fail. >> +COMPILER += @NO_PIE_CFLAGS@ >> + >> +# Link with -no-pie since we compile the compiler with -fno-PIE. >> +LINKER += @NO_PIE_FLAG@

Re: PING^3: [PATCH]: New configure options that make the compiler use -fPIE and -pie as default option

2015-05-07 Thread Joseph Myers
On Fri, 6 Mar 2015, H.J. Lu wrote: > +# We don't want to compile the compiler with -fPIE, it make PCH fail. > +COMPILER += @NO_PIE_CFLAGS@ > + > +# Link with -no-pie since we compile the compiler with -fno-PIE. > +LINKER += @NO_PIE_FLAG@ As I understand it, what we don't want is the compiler to b

Re: PING^3: [PATCH]: New configure options that make the compiler use -fPIE and -pie as default option

2015-03-06 Thread H.J. Lu
On Fri, Mar 6, 2015 at 12:11 PM, Magnus Granberg wrote: > fredag 06 mars 2015 09.31.26 skrev H.J. Lu: >> PING. I am enclosing the patch here for review. >> > Have you tested it on mips? > gcc pass -mno-shared if HAVE_AS_NO_SHARED is defened > in config/mips/gnu-user.h. -mshared don't get enable.

Re: PING^3: [PATCH]: New configure options that make the compiler use -fPIE and -pie as default option

2015-03-06 Thread Magnus Granberg
fredag 06 mars 2015 09.31.26 skrev H.J. Lu: > PING. I am enclosing the patch here for review. > Have you tested it on mips? gcc pass -mno-shared if HAVE_AS_NO_SHARED is defened in config/mips/gnu-user.h. -mshared don't get enable. /Magnus G.

PING^3: [PATCH]: New configure options that make the compiler use -fPIE and -pie as default option

2015-03-06 Thread H.J. Lu
PING. I am enclosing the patch here for review. On Wed, Feb 11, 2015 at 8:47 AM, H.J. Lu wrote: > PING. > > On Wed, Jan 28, 2015 at 8:05 AM, H.J. Lu wrote: >> PING. >> >> On Tue, Jan 13, 2015 at 3:25 PM, H.J. Lu wrote: >>> On Tue, Jan 13, 2015 at 5:03 AM, H.J. Lu wrote: On Mon, Jan 12, 2