This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PING][PATCH][1-3] New configure options that make the compiler use -fPIE and -pie as default option
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Magnus Granberg <zorry at gentoo dot org>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Sun, 11 Jan 2015 09:39:23 -0800
- Subject: Re: [PING][PATCH][1-3] New configure options that make the compiler use -fPIE and -pie as default option
- Authentication-results: sourceware.org; auth=none
- References: <54B239EA dot 8080807 at gmail dot com> <54B23CE4 dot 60408 at gmail dot com> <CAMe9rOqmpoL4VanN--v2+-Pry1-1O7jscPQs_3CnvT8EHKB7_A at mail dot gmail dot com> <1544032 dot XE9RNgkelG at laptop1 dot gw dot ume dot nu>
On Sun, Jan 11, 2015 at 5:29 AM, Magnus Granberg <zorry@gentoo.org> wrote:
> sÃndag 11 januari 2015 03.37.14 skrev H.J. Lu:
>> On Sun, Jan 11, 2015 at 1:05 AM, Daniel Micay <danielmicay@gmail.com> wrote:
>> > On 11/01/15 03:52 AM, Daniel Micay wrote:
>> >> This branch works well for me. It doesn't automatically turn off the
>> >> linker flag when -fno-PIE or -fno-PIC are passed like most of the
>> >> wrapper scripts / downstream patches do, but that might not be a problem
>> >> in practice.
>>
>> -fno-PIE and -fno-PIC aren't linking options. We don't turn on PIE with
>>
>> # gcc -fPIE ....
>>
>> You need to use
>>
>> # gcc -pie -fPIE
>>
>> To turn off PIE, you should use
>>
>> # gcc -no-pie -fno-PIE
>>
>> > Er, Thunderbird did a terrible job handling my manual reply (wasn't
>> > subscribed to the list). Sorry about that.
>> >
>> > For clarity, this is about H.J. Lu's branch at:
>> >
>> > https://gcc.gnu.org/git/?p=gcc.git;a=shortlog;h=refs/heads/hjl/pie
> It works fine for me but 6 test fails in the testsuite.
> Do we realy want to pass -fPIE -fPIC when someone do -fno-PIC or -fno-pic?
>
> FAIL: gcc.dg/tree-ssa/ssa-store-ccp-3.c scan-tree-dump-times optimized
> "conststaticvariable" 1
> FAIL: gcc.target/i386/nop-mcount.c (test for excess errors)
> FAIL: gcc.target/i386/pr54445-2.c scan-assembler mov(b|zbl)[ \t]
> (%fs:)?tls_array@tpoff-1\\(%
> FAIL: g++.dg/other/anon5.C -std=gnu++98 (test for excess errors)
> FAIL: g++.dg/other/anon5.C -std=gnu++11 (test for excess errors)
> FAIL: g++.dg/other/anon5.C -std=gnu++14 (test for excess errors)
I fixed them on hjl/pie branch. Please take a look.
--
H.J.