From nobody Sun May 12 07:29:13 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 1708703665168927.8335998683846; Fri, 23 Feb 2024 07:54:25 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id 978111A12; Fri, 23 Feb 2024 10:54:23 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 4BB421A0E; Fri, 23 Feb 2024 10:53:00 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id 75F511A00; Fri, 23 Feb 2024 10:52:55 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.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 92B2C19EF for ; Fri, 23 Feb 2024 10:52:54 -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-321-zQ1FEv1qMIqxPIcmNzibIA-1; Fri, 23 Feb 2024 10:52:52 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (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 57EDD8630C5 for ; Fri, 23 Feb 2024 15:52:52 +0000 (UTC) Received: from harajuku.usersys.redhat.com.homenet.telecomitalia.it (unknown [10.45.224.85]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D91FE112132A for ; Fri, 23 Feb 2024 15:52:51 +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_H2,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.4 X-MC-Unique: zQ1FEv1qMIqxPIcmNzibIA-1 From: Andrea Bolognani To: devel@lists.libvirt.org Subject: [PATCH] meson: Skip detection of sched_* functionality on Hurd Date: Fri, 23 Feb 2024 16:52:49 +0100 Message-ID: <20240223155249.8605-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Message-ID-Hash: TAON2B5MWGR6OFVGPUHLUPMZBDLIYFRO X-Message-ID-Hash: TAON2B5MWGR6OFVGPUHLUPMZBDLIYFRO 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: 1708703666702100017 We use the presence of sched_setscheduler() and cpu_set_t as witnesses for whether we can set process affinity and the like. This entire class of functionality is missing on Hurd, but unfortunately it still gets advertised, so the end result is that a number of warnings are produced during build: sched_get_priority_max is not implemented and will always fail sched_get_priority_min is not implemented and will always fail sched_getaffinity is not implemented and will always fail sched_setaffinity is not implemented and will always fail Don't even attempt to detect the known-broken APIs, so that we don't get compiler warnings and can report the missing functionality correctly at runtime if attempts to use it are made. Signed-off-by: Andrea Bolognani --- meson.build | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/meson.build b/meson.build index 7845f60ff7..eef00ee32a 100644 --- a/meson.build +++ b/meson.build @@ -584,13 +584,19 @@ functions =3D [ 'posix_fallocate', 'posix_memalign', 'prlimit', - 'sched_setscheduler', 'setgroups', 'setrlimit', 'symlink', 'sysctlbyname', ] =20 +# sched_* APIs are know to be broken on Hurd +if host_machine.system() !=3D 'gnu' + functions +=3D [ + 'sched_setscheduler', + ] +endif + stat_functions =3D [ '__lxstat', '__lxstat64', @@ -669,8 +675,6 @@ symbols =3D [ =20 # Check for BSD approach for setting MAC addr [ 'net/if_dl.h', 'link_addr', '#include \n#include ' ], - - [ 'sched.h', 'cpu_set_t' ], ] =20 if host_machine.system() =3D=3D 'linux' @@ -680,6 +684,13 @@ if host_machine.system() =3D=3D 'linux' ] endif =20 +# sched_* APIs are know to be broken on Hurd +if host_machine.system() !=3D 'gnu' + symbols +=3D [ + [ 'sched.h', 'cpu_set_t' ], + ] +endif + foreach symbol : symbols if cc.has_header_symbol(symbol[0], symbol[1], args: '-D_GNU_SOURCE', pre= fix: symbol.get(2, '')) conf.set('WITH_DECL_@0@'.format(symbol[1].to_upper()), 1) --=20 2.43.2 _______________________________________________ Devel mailing list -- devel@lists.libvirt.org To unsubscribe send an email to devel-leave@lists.libvirt.org