From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:60922) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UHZqb-0003q7-IV for qemu-devel@nongnu.org; Mon, 18 Mar 2013 09:11:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UHZqY-0000la-N5 for qemu-devel@nongnu.org; Mon, 18 Mar 2013 09:11:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:63057) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UHZqY-0000lI-Cl for qemu-devel@nongnu.org; Mon, 18 Mar 2013 09:11:26 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r2IDBPA9026463 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 18 Mar 2013 09:11:25 -0400 From: Alon Levy Date: Mon, 18 Mar 2013 15:10:53 +0200 Message-Id: <1363612272-13713-8-git-send-email-alevy@redhat.com> In-Reply-To: <1363612272-13713-1-git-send-email-alevy@redhat.com> References: <1363612272-13713-1-git-send-email-alevy@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH 07/26] build-sys: must link with -fstack-protector List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: mlureau@redhat.com From: Marc-Andr=C3=A9 Lureau It is needed to give that flag to the linker as well, but latest libtool 2.4.2 still swallows that argument, so let's pass it with libtool -Wc argument. qemu-1.4.0/stubs/arch-query-cpu-def.c:6: undefined reference to `__stack_= chk_guard' Signed-off-by: Marc-Andr=C3=A9 Lureau --- configure | 8 +++++++- rules.mak | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/configure b/configure index 46a7594..d76866a 100755 --- a/configure +++ b/configure @@ -1209,7 +1209,7 @@ fi gcc_flags=3D"-Wold-style-declaration -Wold-style-definition -Wtype-limit= s" gcc_flags=3D"-Wformat-security -Wformat-y2k -Winit-self -Wignored-qualif= iers $gcc_flags" gcc_flags=3D"-Wmissing-include-dirs -Wempty-body -Wnested-externs $gcc_f= lags" -gcc_flags=3D"-fstack-protector-all -Wendif-labels $gcc_flags" +gcc_flags=3D"-Wendif-labels $gcc_flags" gcc_flags=3D"-Wno-initializer-overrides $gcc_flags" # Note that we do not add -Werror to gcc_flags here, because that would # enable it for all configure tests. If a configure test failed due @@ -1228,6 +1228,11 @@ for flag in $gcc_flags; do fi done =20 +if compile_prog "-Werror -fstack-protector-all" "" ; then + QEMU_CFLAGS=3D"$QEMU_CFLAGS -fstack-protector-all" + LIBTOOLFLAGS=3D"$LIBTOOLFLAGS -Wc,-fstack-protector-all" +fi + # Workaround for http://gcc.gnu.org/PR55489. Happens with -fPIE/-fPIC a= nd # large functions that use global variables. The bug is in all releases= of # GCC, but it became particularly acute in 4.6.x and 4.7.x. It is fixed= in @@ -3890,6 +3895,7 @@ else echo "AUTOCONF_HOST :=3D " >> $config_host= _mak fi echo "LDFLAGS=3D$LDFLAGS" >> $config_host_mak +echo "LIBTOOLFLAGS=3D$LIBTOOLFLAGS" >> $config_host_mak echo "ARLIBS_BEGIN=3D$arlibs_begin" >> $config_host_mak echo "ARLIBS_END=3D$arlibs_end" >> $config_host_mak echo "LIBS+=3D$LIBS" >> $config_host_mak diff --git a/rules.mak b/rules.mak index edc2552..36aba2d 100644 --- a/rules.mak +++ b/rules.mak @@ -36,6 +36,7 @@ LINK =3D $(call quiet-command,\ $(if $(filter %.lo %.la,$^),$(LIBTOOL) --mode=3Dlink --tag=3DCC \ )$(CC) $(QEMU_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ \ $(sort $(filter %.o, $1)) $(filter-out %.o, $1) $(version-obj-y) = \ + $(if $(filter %.lo %.la,$^),$(LIBTOOLFLAGS)) \ $(LIBS),$(if $(filter %.lo %.la,$^),"lt LINK ", " LINK ")"$(TAR= GET_DIR)$@") endif =20 --=20 1.8.1.4