From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16760 invoked by alias); 12 Jan 2015 21:51:57 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 16751 invoked by uid 89); 12 Jan 2015 21:51:54 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.0 required=5.0 tests=AWL,BAYES_00,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: smtp.gentoo.org Received: from smtp.gentoo.org (HELO smtp.gentoo.org) (140.211.166.183) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Mon, 12 Jan 2015 21:51:53 +0000 Received: from laptop1.gw.ume.nu (ip1-67.bon.riksnet.se [77.110.8.67]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: zorry) by smtp.gentoo.org (Postfix) with ESMTPSA id 1D527340654 for ; Mon, 12 Jan 2015 21:51:51 +0000 (UTC) From: Magnus Granberg To: gcc-patches@gcc.gnu.org Subject: Re: [testsuite] PATCH: Add check_effective_target_pie Date: Mon, 12 Jan 2015 22:01:00 -0000 Message-ID: <2219602.BYtQkL3Scp@laptop1.gw.ume.nu> User-Agent: KMail/4.14.3 (Linux/3.17.7-hardened-r1; KDE/4.14.3; x86_64; ; ) In-Reply-To: References: <20150111235837.GA26961@gmail.com> <54B42880.2040800@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="iso-8859-1" X-IsSubscribed: yes X-SW-Source: 2015-01/txt/msg00762.txt.bz2 m=E5ndag 12 januari 2015 12.11.17 skrev H.J. Lu: > On Mon, Jan 12, 2015 at 12:03 PM, Jeff Law wrote: > > On 01/12/15 12:59, H.J. Lu wrote: > >> I don't know if -pg will work PIE on any targets. For Linux/x86 > >> the choices of crt1.o are > >>=20 > >> %{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} > >>=20 > >> -shared, -pg and -pie are mutually exclusive. Those crt1 files are > >> only crt1 files provided by glibc. You can't even try -pg -pie on > >> Linux without changing glibc. > >=20 > > You're totally missing the point. What I care about is *why*. > >=20 With -pg it use gcrt1.o object file and that file is not compile with -fPIC= .=20 When you build a shared lib on x86_64 all the objects files need to be buii= t=20 with -fPIC else you get a error like that one abow and it is the same probl= ems=20 when you build bin with -fPIE and linke with -pie. Glibc do not provide one that is compile with -fPIC > > Showing me spec file fragments is totally unhelpful. What is the > > technical > > reason why pg and pie are mutually exclusive? >=20 > What kind of "technical" reason are you looking for? glibc doesn't > provide the right crt1 file for GCC to support this combination. You > can't define GNU_USER_TARGET_STARTFILE_SPEC to support > -pg and -pie. >=20 > If you are asking "why" glibc doesn't provide one, my guess is no > one has requested one before.