Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MjVUv-0004Ek-MW for qemu-devel@nongnu.org; Fri, 04 Sep 2009 05:54:25 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MjVUu-0004DZ-23 for qemu-devel@nongnu.org; Fri, 04 Sep 2009 05:54:24 -0400 Received: from [199.232.76.173] (port=53041 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MjVUt-0004DU-C0 for qemu-devel@nongnu.org; Fri, 04 Sep 2009 05:54:23 -0400 Received: from lechat.rtp-net.org ([88.191.19.38]:47863) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MjVUs-0007op-OQ for qemu-devel@nongnu.org; Fri, 04 Sep 2009 05:54:22 -0400 From: Arnaud Patard (Rtp) Subject: Re: [Qemu-devel] [PATCH v4 2/2] Build usermode targets as PIE References: <1252067286-21758-1-git-send-email-kirill@shutemov.name> <1252067286-21758-2-git-send-email-kirill@shutemov.name> Date: Fri, 04 Sep 2009 11:58:37 +0200 In-Reply-To: <1252067286-21758-2-git-send-email-kirill@shutemov.name> (Kirill A. Shutemov's message of "Fri\, 4 Sep 2009 15\:28\:06 +0300") Message-ID: <877hwfhvzm.fsf@lechat.rtp-net.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Kirill A. Shutemov" Cc: Paolo Bonzini , Riku Voipio , qemu-devel@nongnu.org, Paul Brook , Juan Quintela "Kirill A. Shutemov" writes: Hi, [...] > +cat > $TMPC < +int main() { > + static __thread int i = 0; > + i++; > + return 0; > +} > +EOF > + > +if test "$user_pie" != "no" ; then > + if compile_prog "-fpie" "-pie -Wl,--fatal-warnings -Wl,--warn-shared-textrel"; then > + user_pie="yes" > + else > + if test "$user_pie" = "yes"; then > + echo "Toolchain has no proper PIE support" > + exit 1 > + else > + user_pie="no" > + fi > + fi > +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=526961 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... Arnaud