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

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

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: >> >>

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

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

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: >> >>

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

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 sch...@linux-m68k.org 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

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 hjl.to...@gmail.com 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 Andreas Schwab
H.J. Lu hjl.to...@gmail.com 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

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 hjl.to...@gmail.com 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,

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 sch...@linux-m68k.org wrote: H.J. Lu hjl.to...@gmail.com 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

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 sch...@linux-m68k.org writes: H.J. Lu hjl.to...@gmail.com 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

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 sch...@linux-m68k.org wrote: H.J. Lu hjl.to...@gmail.com 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 hjl.to...@gmail.com 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-30 Thread H.J. Lu
On Sat, May 30, 2015 at 8:10 AM, Andreas Schwab sch...@linux-m68k.org wrote: H.J. Lu hjl.to...@gmail.com 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

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 hjl.to...@gmail.com 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

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 sch...@linux-m68k.org wrote: H.J. Lu hjl.to...@gmail.com 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

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 berg...@vnet.ibm.com 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

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 berg...@vnet.ibm.com 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)

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 berg...@vnet.ibm.com 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 berg...@vnet.ibm.com wrote: On Tue, 2015-05-26 at 16:40 -0500, Bill Schmidt wrote: Ah, never mind. I guess I need to

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

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 dje@gmail.com wrote: On Wed, May 27, 2015 at 12:18 PM, H.J. Lu hjl.to...@gmail.com wrote: On Wed, May 27, 2015 at 9:05 AM, Peter Bergner berg...@vnet.ibm.com wrote: On Wed, 2015-05-27 at 08:36 -0700, H.J. Lu wrote: On Wed, May 27, 2015 at

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 hjl.to...@gmail.com wrote: On Wed, May 27, 2015 at 9:05 AM, Peter Bergner berg...@vnet.ibm.com 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 berg...@vnet.ibm.com wrote: On Tue, 2015-05-26 at

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

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

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 hjl.to...@gmail.com Date: Tue, 19 May 2015 10:12:20 -0700 Subject: