This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Fwd: PING^3: [PATCH]: 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: Peter Bergner <bergner at vnet dot ibm dot com>
- Cc: Bill Schmidt <wschmidt at linux dot vnet dot ibm dot com>, Andreas Schwab <schwab at linux-m68k dot org>, Richard Earnshaw <richard dot earnshaw at arm dot com>, Bernd Schmidt <bernds at codesourcery dot com>, Hans-Peter Nilsson <hans-peter dot nilsson at axis dot com>, Nick Clifton <nickc at redhat dot com>, Matthew Fortune <Matthew dot Fortune at imgtec dot com>, David Edelsohn <dje dot gcc at gmail dot com>, "David S. Miller" <davem at redhat dot com>, Matt Thomas <matt at 3am-software dot com>, Rainer Orth <ro at cebitec dot uni-bielefeld dot de>, Mike Stump <mikestump at comcast dot net>, GCC Patches <gcc-patches at gcc dot gnu dot org>, "Joseph S. Myers" <joseph at codesourcery dot com>
- Date: Wed, 27 May 2015 08:36:42 -0700
- Subject: Re: Fwd: PING^3: [PATCH]: New configure options that make the compiler use -fPIE and -pie as default option
- Authentication-results: sourceware.org; auth=none
- References: <CAMe9rOrw7OFObOmOCG1wM2Hfr_hpKo-wY0_17ngB89CTQ_34Mw at mail dot gmail dot com> <alpine dot DEB dot 2 dot 10 dot 1505072104300 dot 20024 at digraph dot polyomino dot org dot uk> <CAMe9rOrcADb1t2Ch0LDy9SOaS9RDoj4BGgo8qL+6jtg1tnLA8g at mail dot gmail dot com> <3072346 dot CTCrhcXNep at laptop1 dot gw dot ume dot nu> <alpine dot DEB dot 2 dot 10 dot 1505190109380 dot 16300 at digraph dot polyomino dot org dot uk> <CAMe9rOr-mU-vxmF3po-zKAYtLyYGGCN4LeM-DJkL6Kv3fYxD_g at mail dot gmail dot com> <alpine dot DEB dot 2 dot 10 dot 1505191520110 dot 32308 at digraph dot polyomino dot org dot uk> <CAMe9rOqncLsJhb7Fhr3t3acDO+Kq38AeA+ac1TKt6oqWwGz-5Q at mail dot gmail dot com> <alpine dot DEB dot 2 dot 10 dot 1505191531440 dot 32308 at digraph dot polyomino dot org dot uk> <CAMe9rOrW1BGje8b6EmrzaJP8b0rPWF+WrTTWdAn-67Fn7-imqw at mail dot gmail dot com> <CAMe9rOpZow4w3zcycLoTb5LZdLKP2QWNpsU5oLMJCyZGUTd1fg at mail dot gmail dot com> <87vbflkh05 dot fsf at igel dot home> <CAMe9rOr0SApdtzeOrc-uNDRH8=z6c4EzHUkyXmERW_q9BYjrAQ at mail dot gmail dot com> <87k2w1k54t dot fsf at igel dot home> <CAMe9rOqUj4dhH3omFO7UONsPgmg9iOaXhntfK+dNByLeGnrm_Q at mail dot gmail dot com> <1432676355 dot 2757 dot 4 dot camel at gnopaine> <1432676452 dot 2757 dot 5 dot camel at gnopaine> <1432740267 dot 7344 dot 5 dot camel at otta>
On Wed, May 27, 2015 at 8:24 AM, Peter Bergner <bergner@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 bootstraps completed with no
> errors and the without --enable-default-pie regtested without any
> regressions.
>
> The --enable-default-pie regtesting shows massive failures that I
> have to look into. I'm haven't determined yet whether these are
> all -m32 FAILs or -m64 FAILS or both. I'll report back with more
> info after I dig into some of the failures.
Does --enable-default-pie work on powerpc64-linux? Do you
get working PIE by default? Some GCC tests expect non-PIE.
I fixed some of them:
commit 82923064d660e4183933b014ee3f645799a945b0
Author: hjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Thu Jan 15 16:33:37 2015 +0000
Ignore additional linker messages on Linux/x86 with PIE
g++.dg/other/anon5.C is expected to fail to link. On Linux/x86 with PIE
and the new linker, there are additional messages from linker:
[hjl@gnu-tools-1 gcc]$ g++ -fPIE -pie
/export/gnu/import/git/sources/gcc/gcc/testsuite/g++.dg/other/anon5.C
/tmp/ccwg53fj.o: In function `f()': anon5.C:(.text+0x7): undefined
reference to `(anonymous namespace)::c::t'
/usr/local/bin/ld: /tmp/ccwg53fj.o: relocation R_X86_64_PC32
against undefined symbol `_ZN12_GLOBAL__N_11c1tE' can not be used when
making a shared object; recompile with -fPIC
/usr/local/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
[hjl@gnu-tools-1 gcc]$
This patch ignores additional linker messages on Linux/x86 with PIE.
* g++.dg/other/anon5.C: Ignore additional messages on Linux/x86
with PIE.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@219667
138bc75d-0d04-0410-961f-82ee72b054a4
--
H.J.