From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46867) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WTb9F-0000md-BZ for qemu-devel@nongnu.org; Fri, 28 Mar 2014 14:05:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WTb99-0007bE-7F for qemu-devel@nongnu.org; Fri, 28 Mar 2014 14:04:57 -0400 Received: from smtp-fw-2101.amazon.com ([72.21.196.25]:14379) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WTb99-0007au-2Y for qemu-devel@nongnu.org; Fri, 28 Mar 2014 14:04:51 -0400 From: "Noonan, Steven" Date: Fri, 28 Mar 2014 18:04:37 +0000 Message-ID: References: <1396023542-19667-1-git-send-email-pbonzini@redhat.com> <5335B68F.8050504@redhat.com> In-Reply-To: <5335B68F.8050504@redhat.com> Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-ID: <6743888D3124794296CF781C6C780A09@ant.amazon.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH for-2.0] configure: add option to disable -fstack-protector flags List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , Laurent Desnogues Cc: Steven Noonan , "qemu-devel@nongnu.org" , "Liguori, Anthony" On 3/28/14, 10:51 AM, "Paolo Bonzini" wrote: >Il 28/03/2014 18:41, Laurent Desnogues ha scritto: >>> > + gcc_flags=3D"-fstack-protector-strong -fstack-protector-all" >>> > + for flag in $gcc_flags; do >>> > + if compile_prog "-Werror $flag" "" ; then >>> > + QEMU_CFLAGS=3D"$QEMU_CFLAGS $flag" >>> > + LIBTOOLFLAGS=3D"$LIBTOOLFLAGS -Wc,$flag" >>> > + break >>> > + fi >>> > + done >>> > fi >> My understanding is that -fstack-protector, -fstack-protector-strong, >> and -fstack-protector-all are strictly ordered in terms of the number >> of functions that are checked, so you have changed the default >> behavior to check less functions for compilers that support >> -fstack-protector-strong. Is that what you had in mind? > >Yes. -fstack-protector-all adds protection in places where it doesn't >really matter, and that's why it has such a high cost. Correct, -fstack-protector-all was too high impact. Sadly -fstack-protector-strong seems to only exist in RedHat-provided compilers, which I don't always use -- thus the new default this change provides doesn't really help, so I'd need to just do 'configure --disable-stack-protector' to avoid the performance penalty.