From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51788) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vq0G4-0002kx-LB for qemu-devel@nongnu.org; Mon, 09 Dec 2013 07:48:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vq0Fy-0003ko-Px for qemu-devel@nongnu.org; Mon, 09 Dec 2013 07:48:20 -0500 Received: from omzsmtpe03.verizonbusiness.com ([199.249.25.208]:41456) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vq0Fy-0003ki-Km for qemu-devel@nongnu.org; Mon, 09 Dec 2013 07:48:14 -0500 From: Don Slutz Message-ID: <52A5BBE6.9070000@terremark.com> Date: Mon, 9 Dec 2013 07:47:34 -0500 MIME-Version: 1.0 References: <20131202223641.6000.456.malonedeb@chaenomeles.canonical.com> <20131202223641.6000.456.malonedeb@chaenomeles.canonical.com> <529E1194.9060504@redhat.com> <529E8638.2010102@terremark.com> <52A09933.5090302@redhat.com> <52A0EF2B.9000905@twiddle.net> <52A1427D.6000307@terremark.com> In-Reply-To: <52A1427D.6000307@terremark.com> Content-Type: multipart/mixed; boundary="------------070309050003000001060303" Subject: Re: [Qemu-devel] [Bug 1257099] [NEW] QEMU fails to build on CentOS 5.10 with relocation R_X86_64_PC32 error List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson Cc: xen-devel@lists.xensource.com, Ian Campbell , Stefano Stabellini , qemu-devel@nongnu.org, Don Slutz , 1257099@bugs.launchpad.net, Paolo Bonzini --------------070309050003000001060303 Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit On 12/05/13 22:20, Don Slutz wrote: > On 12/05/13 16:24, Richard Henderson wrote: >> On 12/06/2013 04:18 AM, Paolo Bonzini wrote: >>> $ gcc -shared -o f.so f.c -fPIE -fPIC >>> /usr/bin/ld: /tmp/ccQc9els.o: relocation R_X86_64_PC32 against `f' >>> can not be used when making a shared object; recompile with -fPIC >>> /usr/bin/ld: final link failed: Bad value >>> collect2: ld returned 1 exit status >>> >>> >>> The bug is simply that "-fPIE -fPIC" counts as -fPIE rather than -fPIC: >>> >>> $ gcc -S -o - f.c -fPIE |grep call >>> call f # PC32 relocation >>> $ gcc -S -o - f.c -fPIC |grep call >>> call f@PLT # PLT32 relocation >> The easy workaround is to drop -fPIE when we're adding -fPIC. >> >> >> r~ [snip] Attached is a much better version. It drops -fPIE and adds -fPIC for libtool. -Don Slutz --------------070309050003000001060303 Content-Type: text/x-patch; name="0001-configure-Switch-libtool-from-fPIE-to-fPIC-bug-12570.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0001-configure-Switch-libtool-from-fPIE-to-fPIC-bug-12570.pa"; filename*1="tch" >>From 82bc02f2bd5e02e341f9c86c9915707dc4edb778 Mon Sep 17 00:00:00 2001 From: Don Slutz Date: Sat, 7 Dec 2013 17:33:52 +0000 Subject: [PATCH] configure: Switch libtool from -fPIE to -fPIC (bug #1257099) Add new config-host variable LIBTOOL_CFLAGS Signed-off-by: Don Slutz --- configure | 2 ++ rules.mak | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/configure b/configure index 18fa608..7d32364 100755 --- a/configure +++ b/configure @@ -4113,11 +4113,13 @@ echo "WINDRES=$windres" >> $config_host_mak echo "LIBTOOL=$libtool" >> $config_host_mak echo "CFLAGS=$CFLAGS" >> $config_host_mak echo "QEMU_CFLAGS=$QEMU_CFLAGS" >> $config_host_mak +echo "LIBTOOL_CFLAGS="$(echo $QEMU_CFLAGS | sed -e 's/-fPIE -DPIE/-fPIC -DPIC/') >>$config_host_mak echo "QEMU_INCLUDES=$QEMU_INCLUDES" >> $config_host_mak if test "$sparse" = "yes" ; then echo "CC := REAL_CC=\"\$(CC)\" cgcc" >> $config_host_mak echo "HOST_CC := REAL_CC=\"\$(HOST_CC)\" cgcc" >> $config_host_mak echo "QEMU_CFLAGS += -Wbitwise -Wno-transparent-union -Wno-old-initializer -Wno-non-pointer-null" >> $config_host_mak + echo "LIBTOOL_CFLAGS += -Wbitwise -Wno-transparent-union -Wno-old-initializer -Wno-non-pointer-null" >> $config_host_mak fi if test "$cross_prefix" != ""; then echo "AUTOCONF_HOST := --host=${cross_prefix%-}" >> $config_host_mak diff --git a/rules.mak b/rules.mak index 4499745..e4dea9c 100644 --- a/rules.mak +++ b/rules.mak @@ -29,7 +29,7 @@ LINK = $(call quiet-command,$(CC) $(QEMU_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ \ else LIBTOOL += $(if $(V),,--quiet) %.lo: %.c - $(call quiet-command,$(LIBTOOL) --mode=compile --tag=CC $(CC) $(QEMU_INCLUDES) $(QEMU_CFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) -c -o $@ $<," lt CC $@") + $(call quiet-command,$(LIBTOOL) --mode=compile --tag=CC $(CC) $(QEMU_INCLUDES) $(LIBTOOL_CFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) -c -o $@ $<," lt CC $@") %.lo: %.rc $(call quiet-command,$(LIBTOOL) --mode=compile --tag=RC $(WINDRES) -I. -o $@ $<,"lt RC $(TARGET_DIR)$@") %.lo: %.dtrace -- 1.7.11.7 --------------070309050003000001060303-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Don Slutz Subject: Re: [Bug 1257099] [NEW] QEMU fails to build on CentOS 5.10 with relocation R_X86_64_PC32 error Date: Mon, 9 Dec 2013 07:47:34 -0500 Message-ID: <52A5BBE6.9070000@terremark.com> References: <20131202223641.6000.456.malonedeb@chaenomeles.canonical.com> <20131202223641.6000.456.malonedeb@chaenomeles.canonical.com> <529E1194.9060504@redhat.com> <529E8638.2010102@terremark.com> <52A09933.5090302@redhat.com> <52A0EF2B.9000905@twiddle.net> <52A1427D.6000307@terremark.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------070309050003000001060303" Return-path: In-Reply-To: <52A1427D.6000307@terremark.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org Sender: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org To: Richard Henderson Cc: xen-devel@lists.xensource.com, Ian Campbell , Stefano Stabellini , qemu-devel@nongnu.org, Don Slutz , 1257099@bugs.launchpad.net, Paolo Bonzini List-Id: xen-devel@lists.xenproject.org --------------070309050003000001060303 Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit On 12/05/13 22:20, Don Slutz wrote: > On 12/05/13 16:24, Richard Henderson wrote: >> On 12/06/2013 04:18 AM, Paolo Bonzini wrote: >>> $ gcc -shared -o f.so f.c -fPIE -fPIC >>> /usr/bin/ld: /tmp/ccQc9els.o: relocation R_X86_64_PC32 against `f' >>> can not be used when making a shared object; recompile with -fPIC >>> /usr/bin/ld: final link failed: Bad value >>> collect2: ld returned 1 exit status >>> >>> >>> The bug is simply that "-fPIE -fPIC" counts as -fPIE rather than -fPIC: >>> >>> $ gcc -S -o - f.c -fPIE |grep call >>> call f # PC32 relocation >>> $ gcc -S -o - f.c -fPIC |grep call >>> call f@PLT # PLT32 relocation >> The easy workaround is to drop -fPIE when we're adding -fPIC. >> >> >> r~ [snip] Attached is a much better version. It drops -fPIE and adds -fPIC for libtool. -Don Slutz --------------070309050003000001060303 Content-Type: text/x-patch; name="0001-configure-Switch-libtool-from-fPIE-to-fPIC-bug-12570.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0001-configure-Switch-libtool-from-fPIE-to-fPIC-bug-12570.pa"; filename*1="tch" >>From 82bc02f2bd5e02e341f9c86c9915707dc4edb778 Mon Sep 17 00:00:00 2001 From: Don Slutz Date: Sat, 7 Dec 2013 17:33:52 +0000 Subject: [PATCH] configure: Switch libtool from -fPIE to -fPIC (bug #1257099) Add new config-host variable LIBTOOL_CFLAGS Signed-off-by: Don Slutz --- configure | 2 ++ rules.mak | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/configure b/configure index 18fa608..7d32364 100755 --- a/configure +++ b/configure @@ -4113,11 +4113,13 @@ echo "WINDRES=$windres" >> $config_host_mak echo "LIBTOOL=$libtool" >> $config_host_mak echo "CFLAGS=$CFLAGS" >> $config_host_mak echo "QEMU_CFLAGS=$QEMU_CFLAGS" >> $config_host_mak +echo "LIBTOOL_CFLAGS="$(echo $QEMU_CFLAGS | sed -e 's/-fPIE -DPIE/-fPIC -DPIC/') >>$config_host_mak echo "QEMU_INCLUDES=$QEMU_INCLUDES" >> $config_host_mak if test "$sparse" = "yes" ; then echo "CC := REAL_CC=\"\$(CC)\" cgcc" >> $config_host_mak echo "HOST_CC := REAL_CC=\"\$(HOST_CC)\" cgcc" >> $config_host_mak echo "QEMU_CFLAGS += -Wbitwise -Wno-transparent-union -Wno-old-initializer -Wno-non-pointer-null" >> $config_host_mak + echo "LIBTOOL_CFLAGS += -Wbitwise -Wno-transparent-union -Wno-old-initializer -Wno-non-pointer-null" >> $config_host_mak fi if test "$cross_prefix" != ""; then echo "AUTOCONF_HOST := --host=${cross_prefix%-}" >> $config_host_mak diff --git a/rules.mak b/rules.mak index 4499745..e4dea9c 100644 --- a/rules.mak +++ b/rules.mak @@ -29,7 +29,7 @@ LINK = $(call quiet-command,$(CC) $(QEMU_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ \ else LIBTOOL += $(if $(V),,--quiet) %.lo: %.c - $(call quiet-command,$(LIBTOOL) --mode=compile --tag=CC $(CC) $(QEMU_INCLUDES) $(QEMU_CFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) -c -o $@ $<," lt CC $@") + $(call quiet-command,$(LIBTOOL) --mode=compile --tag=CC $(CC) $(QEMU_INCLUDES) $(LIBTOOL_CFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) -c -o $@ $<," lt CC $@") %.lo: %.rc $(call quiet-command,$(LIBTOOL) --mode=compile --tag=RC $(WINDRES) -I. -o $@ $<,"lt RC $(TARGET_DIR)$@") %.lo: %.dtrace -- 1.7.11.7 --------------070309050003000001060303--