From nobody Thu May 9 04:34:23 2024 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 8.43.85.245 is neither permitted nor denied by domain of lists.libvirt.org) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; spf=none (zohomail.com: 8.43.85.245 is neither permitted nor denied by domain of lists.libvirt.org) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1706638599198504.20844153511325; Tue, 30 Jan 2024 10:16:39 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id E89BA1E55; Tue, 30 Jan 2024 13:16:37 -0500 (EST) Received: from lists.libvirt.org.85.43.8.in-addr.arpa (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id ECE0B1E37; Tue, 30 Jan 2024 13:05:06 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id 9A3DA1D64; Tue, 30 Jan 2024 13:04:28 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 028F81D69 for ; Tue, 30 Jan 2024 13:03:42 -0500 (EST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-288-D1N7LKIXNjqL3MDacJE5PA-1; Tue, 30 Jan 2024 13:03:41 -0500 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id DF43F83B832 for ; Tue, 30 Jan 2024 18:03:40 +0000 (UTC) Received: from harajuku.usersys.redhat.com (unknown [10.45.226.113]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 70FD7492BC6 for ; Tue, 30 Jan 2024 18:03:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.4 X-MC-Unique: D1N7LKIXNjqL3MDacJE5PA-1 From: Andrea Bolognani To: devel@lists.libvirt.org Subject: [PATCH v2] meson: Adjust -fstack-protector use Date: Tue, 30 Jan 2024 19:03:38 +0100 Message-ID: <20240130180338.1326940-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Message-ID-Hash: 5CG3ZG6JTFIGL25DZNEEJ2RHEIIXSMJ7 X-Message-ID-Hash: 5CG3ZG6JTFIGL25DZNEEJ2RHEIIXSMJ7 X-MailFrom: abologna@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="utf-8"; x-default="true" Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1706638599708100001 Back in 2014, -fstack-protector was reported not to work on aarch64, so fe881ae086ec disabled it on that target. OS-wise, its use is currently limited to just Linux, FreeBSD and Windows. Looking at the situation today, it seems that whatever issue was affecting aarch64 a decade ago has been resolved; moreover, macOS can also use the feature these days. I haven't checked any of the other BSDs, but since the feature works on FreeBSD it's pretty safe to the assume that they can use it too. If we get reports that it's not the case, we can always further restrict its usage accordingly. Best viewed with 'git show -w'. Signed-off-by: Andrea Bolognani Reviewed-by: J=C3=A1n Tomko --- Test pipeline: https://gitlab.com/abologna/libvirt/-/pipelines/1157984478 Changes from [v1]: * drop alpha-specific exception. [v1] https://lists.libvirt.org/archives/list/devel@lists.libvirt.org/thread= /R5C57PJM3JPTXAK5Q25DS6J3CCEUTLVA/ meson.build | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/meson.build b/meson.build index 611cc582c0..e1c70fce92 100644 --- a/meson.build +++ b/meson.build @@ -442,22 +442,17 @@ supported_cc_flags =3D [] if get_option('warning_level') =3D=3D '2' supported_cc_flags =3D cc.get_supported_arguments(cc_flags) =20 - # on aarch64 error: -fstack-protector not supported for this target - if host_machine.cpu_family() !=3D 'aarch64' - if host_machine.system() in [ 'linux', 'freebsd', 'windows' ] - # we prefer -fstack-protector-strong but fallback to -fstack-protect= or-all - fstack_cflags =3D cc.first_supported_argument([ - '-fstack-protector-strong', - '-fstack-protector-all', - ]) - supported_cc_flags +=3D fstack_cflags - - # When building with mingw using -fstack-protector requires libssp l= ibrary - # which is included by using -fstack-protector with linker. - if fstack_cflags.length() =3D=3D 1 and host_machine.system() =3D=3D = 'windows' - add_project_link_arguments(fstack_cflags, language: 'c') - endif - endif + # we prefer -fstack-protector-strong but fallback to -fstack-protector-a= ll + fstack_cflags =3D cc.first_supported_argument([ + '-fstack-protector-strong', + '-fstack-protector-all', + ]) + supported_cc_flags +=3D fstack_cflags + + # When building with mingw using -fstack-protector requires libssp libra= ry + # which is included by using -fstack-protector with linker. + if fstack_cflags.length() =3D=3D 1 and host_machine.system() =3D=3D 'win= dows' + add_project_link_arguments(fstack_cflags, language: 'c') endif =20 if supported_cc_flags.contains('-Wlogical-op') --=20 2.43.0 _______________________________________________ Devel mailing list -- devel@lists.libvirt.org To unsubscribe send an email to devel-leave@lists.libvirt.org