From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MjVoj-0006Yw-Cu for qemu-devel@nongnu.org; Fri, 04 Sep 2009 06:14:53 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MjVod-0006Lc-UB for qemu-devel@nongnu.org; Fri, 04 Sep 2009 06:14:52 -0400 Received: from [199.232.76.173] (port=37023 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MjVod-0006Ky-MS for qemu-devel@nongnu.org; Fri, 04 Sep 2009 06:14:47 -0400 Received: from mail-yx0-f176.google.com ([209.85.210.176]:45876) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MjVod-0002l1-Cs for qemu-devel@nongnu.org; Fri, 04 Sep 2009 06:14:47 -0400 Received: by yxe6 with SMTP id 6so447589yxe.22 for ; Fri, 04 Sep 2009 03:14:47 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <877hwfhvzm.fsf@lechat.rtp-net.org> References: <1252067286-21758-1-git-send-email-kirill@shutemov.name> <1252067286-21758-2-git-send-email-kirill@shutemov.name> <877hwfhvzm.fsf@lechat.rtp-net.org> Date: Fri, 4 Sep 2009 13:14:45 +0300 Message-ID: Subject: Re: [Qemu-devel] [PATCH v4 2/2] Build usermode targets as PIE From: "Kirill A. Shutemov" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Arnaud Patard Cc: Paolo Bonzini , Riku Voipio , qemu-devel@nongnu.org, Paul Brook , Juan Quintela On Fri, Sep 4, 2009 at 12:58 PM, Arnaud Patard w= rote: > "Kirill A. Shutemov" writes: > > Hi, > > [...] > >> +cat > $TMPC <> +int main() { >> + =C2=A0 =C2=A0 static __thread int i =3D 0; >> + =C2=A0 =C2=A0 i++; >> + =C2=A0 =C2=A0 return 0; >> +} >> +EOF >> + >> +if test "$user_pie" !=3D "no" ; then >> + =C2=A0 =C2=A0if compile_prog "-fpie" "-pie -Wl,--fatal-warnings -Wl,--= warn-shared-textrel"; then >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0user_pie=3D"yes" >> + =C2=A0 =C2=A0else >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0if test "$user_pie" =3D "yes"; then >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0echo "Toolchain has no proper= PIE support" >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0exit 1 >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0else >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0user_pie=3D"no" >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0fi >> + =C2=A0 =C2=A0fi >> +fi > > Unfortunately, the broken mips toolchain pass this test. When you > compile, you're getting no warning at all. Moreover, the failure is > triggered at run-time (and this test doesn't trigger it). See > http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=3D526961 if you want > something which segfault with pie. > I don't know if there are some other non-mips toolchains with broken pie > and what's their behaviour. I hope it's crashing too... Where can I get a mips cross-compiler with this issue to play?