From nobody Mon Sep 16 19:01:33 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1693822430; cv=none; d=zohomail.com; s=zohoarc; b=OTgCHUjkA5Tv7LxpppOvC0KsrK2KqafJClkt21iWk/Wk2TuOp21gzTWrV/0ltqS5oTDjXTRN/DuOA/A+rvKRbH0w2AZ9ytuFULMroHCL/Xw/cfFFLjOVVLtxkkcB91c35fOEzSya6Z67JptdCcZR6UxeH+z+H4BPWH+06Qd0Zjw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693822430; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=nijQYlUudLyjhipGNqFG4VTpmSfmZuTA+YDiizKTlIk=; b=Jv6EvJfVqtQDGcZz49UJt2QelimSlKodCw8syho7TPz4ZwLDAYfzfxlct3S+Zsn7Lo/Gxbr/KmIX1g+WyfpOf+CjH/qfzGSfp4tmxS/EsUkkOSh0YnuBJ8aKnI2aqhpoXF2eyRoHdmjJtVh1uZxU1NvLMUHsqaIJJcUcy2p1ofI= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1693822430262637.8456359599729; Mon, 4 Sep 2023 03:13:50 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-630-P72pc2SYMN-QSmpTLsk9tw-1; Mon, 04 Sep 2023 06:13:46 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CE3311C04327; Mon, 4 Sep 2023 10:13:42 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id B6C7F493114; Mon, 4 Sep 2023 10:13:42 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id DB77019465B7; Mon, 4 Sep 2023 10:13:41 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id C87F619472AB for ; Mon, 4 Sep 2023 10:13:40 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 990924043CCD; Mon, 4 Sep 2023 10:13:40 +0000 (UTC) Received: from speedmetal.lan (unknown [10.45.242.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2395A40C206F for ; Mon, 4 Sep 2023 10:13:39 +0000 (UTC) X-MC-Unique: P72pc2SYMN-QSmpTLsk9tw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 2/2] build: Work around clang's stack size calculation without optimization Date: Mon, 4 Sep 2023 12:13:37 +0200 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1693822431085100005 Content-Type: text/plain; charset="utf-8" When building without optimization on clang, certain big functions trip the stack size limit despite not actually reaching it. Relax the stack limit size for clang without optimization. Signed-off-by: Peter Krempa Reviewed-by: Daniel P. Berrang=C3=A9 --- meson.build | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 6b6f7ccb7c..d29761bc71 100644 --- a/meson.build +++ b/meson.build @@ -247,8 +247,17 @@ alloc_max =3D run_command( check: true, ) +stack_frame_size =3D 2048 + +# clang without optimization enlarges stack frames in certain corner cases +if cc.get_id() =3D=3D 'clang' and get_option('optimization') =3D=3D '0' + stack_frame_size =3D 4096 +endif + # sanitizer instrumentation may enlarge stack frames -stack_frame_size =3D get_option('b_sanitize') =3D=3D 'none' ? 2048 : 32768 +if get_option('b_sanitize') =3D=3D 'none' + stack_frame_size =3D=3D 32768 +endif # array_bounds=3D2 check triggers false positive on some GCC # versions when using sanitizers. Seen on Fedora 34 with --=20 2.41.0