From nobody Sat Nov 15 20:49:59 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1747137442; cv=none; d=zohomail.com; s=zohoarc; b=YzHQIPDNMHUwpm/zlUgkLItbGs1AiXSRjiM5uSpgseJ7Hl26Ji+dnl2QcyIJUHjhb8TXXu+hg/fz8GJmHPgQNeZ3KUMdyR+ouuK+g7FE5PbfIKnpykPXGpsep0qN+dvBCVZH1e0QrQrJRlC71wJ8AWaR2yXiIrFv3h2b80b1/bg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1747137442; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=N1iB5gvmLzqgimGLRjWOz8X1HYfCPTyJ1LadMmLJHh8=; b=I06fHZpKXZDtYuvZJdC1snfW/URP7rQ1sS+6937QdF3K1Cxw3VmrYk7ssdNX+a63UwCNJjOxgUUaZloRzv/t7MfSl58yAMaVK04IjbxgWkJkapN7DpQ3q2Vg+Br+vIBRdXLSVUDpJ9DuPQqXKv7wh8Qi/owKt8K7iGOLyI8DsWo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1747137442162612.5402775042013; Tue, 13 May 2025 04:57:22 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uEoFg-0003nn-R0; Tue, 13 May 2025 07:56:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uEoFe-0003nY-Pf for qemu-devel@nongnu.org; Tue, 13 May 2025 07:56:50 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uEoFc-00038v-QY for qemu-devel@nongnu.org; Tue, 13 May 2025 07:56:50 -0400 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-624-s0X6PC2vObGEfUJXOzx54Q-1; Tue, 13 May 2025 07:56:46 -0400 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (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 mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 9FC361955D82; Tue, 13 May 2025 11:56:44 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.44.32.62]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id A572E1953B82; Tue, 13 May 2025 11:56:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1747137407; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=N1iB5gvmLzqgimGLRjWOz8X1HYfCPTyJ1LadMmLJHh8=; b=EbQzpIASehPM9lzMevjC+FdhJMI9k3xcXA/afjLREUnBb8HDt7m+x4fTTPL3/wsq355Td8 TY8QgLnnSKExYXPkmOyux5ItIFZJs7aUEeiF1Mb9flYYJATbwcaNhWVkQ32HAw3RCXgARr KDLXrbDYIW6DvQ1WbGmkfwV8dZc+d38= X-MC-Unique: s0X6PC2vObGEfUJXOzx54Q-1 X-Mimecast-MFC-AGG-ID: s0X6PC2vObGEfUJXOzx54Q_1747137404 From: Thomas Huth To: Paolo Bonzini , qemu-devel@nongnu.org, Peter Maydell Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-arm@nongnu.org, Brad Smith , Pierrick Bouvier Subject: [PATCH v2] meson.build: Compile hw_common_arch_libs files with right header include paths Date: Tue, 13 May 2025 13:56:37 +0200 Message-ID: <20250513115637.184940-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.549, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1747137443043019000 Content-Type: text/plain; charset="utf-8" From: Thomas Huth Since commit 6f4e8a92bbd ("hw/arm: make most of the compilation units common"), compilation of some arm machines (like musicpal) fails on certain host systems like OpenBSD 7.6/7.7 since headers like don't reside in /usr/include and we currently don't add the right CFLAGS for the common files to include the additional header search paths. Add a loop similar to what we already did in commit 727bb5b477e6 to fix it. With this fix applied, we can now also drop the explicit dependency on pixman for the arm musicpal machine. Fixes: 6f4e8a92bbd ("hw/arm: make most of the compilation units common") Signed-off-by: Paolo Bonzini [thuth: Add commit message + changes in hw/arm/meson.build] Signed-off-by: Thomas Huth --- v2: Change the subject of the patch according to Paolo's suggestion meson.build | 27 ++++++++++++++++----------- hw/arm/meson.build | 2 +- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/meson.build b/meson.build index 5ac64075be7..7131aa2b21d 100644 --- a/meson.build +++ b/meson.build @@ -3228,6 +3228,7 @@ config_devices_mak_list =3D [] config_devices_h =3D {} config_target_h =3D {} config_target_mak =3D {} +config_base_arch_mak =3D {} =20 disassemblers =3D { 'alpha' : ['CONFIG_ALPHA_DIS'], @@ -3419,6 +3420,11 @@ foreach target : target_dirs config_all_devices +=3D config_devices endif config_target_mak +=3D {target: config_target} + + # build a merged config for all targets with the same TARGET_BASE_ARCH + target_base_arch =3D config_target['TARGET_BASE_ARCH'] + config_base_arch =3D config_base_arch_mak.get(target_base_arch, {}) + co= nfig_target + config_base_arch_mak +=3D {target_base_arch: config_base_arch} endforeach target_dirs =3D actual_target_dirs =20 @@ -4099,28 +4105,27 @@ common_all =3D static_library('common', =20 # construct common libraries per base architecture hw_common_arch_libs =3D {} -foreach target : target_dirs - config_target =3D config_target_mak[target] - target_base_arch =3D config_target['TARGET_BASE_ARCH'] +foreach target_base_arch, config_base_arch : config_base_arch_mak + if target_base_arch in hw_common_arch + base_arch_hw =3D hw_common_arch[target_base_arch].apply(config_base_ar= ch, strict: false) + base_arch_common =3D common_ss.apply(config_base_arch, strict: false) =20 - # check if already generated - if target_base_arch in hw_common_arch_libs - continue - endif + lib_deps =3D base_arch_hw.dependencies() + foreach dep : base_arch_common.dependencies() + lib_deps +=3D dep.partial_dependency(compile_args: true, includes: t= rue) + endforeach =20 - if target_base_arch in hw_common_arch target_inc =3D [include_directories('target' / target_base_arch)] - src =3D hw_common_arch[target_base_arch] lib =3D static_library( 'hw_' + target_base_arch, build_by_default: false, - sources: src.all_sources() + genh, + sources: base_arch_hw.sources() + genh, include_directories: common_user_inc + target_inc, implicit_include_directories: false, # prevent common code to access cpu compile time # definition, but still allow access to cpu.h c_args: ['-DCPU_DEFS_H', '-DCOMPILING_SYSTEM_VS_USER', '-DCONFIG_SOF= TMMU'], - dependencies: src.all_dependencies()) + dependencies: lib_deps) hw_common_arch_libs +=3D {target_base_arch: lib} endif endforeach diff --git a/hw/arm/meson.build b/hw/arm/meson.build index 5098795f61d..8e3bf495dbf 100644 --- a/hw/arm/meson.build +++ b/hw/arm/meson.build @@ -8,7 +8,7 @@ arm_common_ss.add(when: 'CONFIG_HIGHBANK', if_true: files('= highbank.c')) arm_common_ss.add(when: 'CONFIG_INTEGRATOR', if_true: files('integratorcp.= c')) arm_common_ss.add(when: 'CONFIG_MICROBIT', if_true: files('microbit.c')) arm_common_ss.add(when: 'CONFIG_MPS3R', if_true: files('mps3r.c')) -arm_common_ss.add(when: 'CONFIG_MUSICPAL', if_true: [pixman, files('musicp= al.c')]) +arm_common_ss.add(when: 'CONFIG_MUSICPAL', if_true: files('musicpal.c')) arm_common_ss.add(when: 'CONFIG_NETDUINOPLUS2', if_true: files('netduinopl= us2.c')) arm_common_ss.add(when: 'CONFIG_OLIMEX_STM32_H405', if_true: files('olimex= -stm32-h405.c')) arm_common_ss.add(when: 'CONFIG_NPCM7XX', if_true: files('npcm7xx.c', 'npc= m7xx_boards.c')) --=20 2.49.0