From nobody Sun Feb 8 19:43:19 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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=1594894348; cv=none; d=zohomail.com; s=zohoarc; b=ManQZFVc0xdwD2uyNOessCospPhAh49jh4lb7vHRDCTYNzlh3tI2A33mqYr0kIyVeHG9KXn+senHyn/nadIX2cOk4NGZRG/saI4RkLr+YfyiELDMYmDTuX/AxudjrLLdyIgHPb95eqKA03co32hwYsLXp9xBisc2aRgoVLc7QX4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594894348; 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=TRqu5HsIkQkS5BtIcFavUlOjFO6RtDNsSrHYfgc9208=; b=Mfckwvj2mKJKBojwVnkvFpe8HzNbB4bwFsXj5yyhgMOkh73YqEgEfrVi7gSK+FP4ghUpX/W8YE9Vm5Z8zoz9ArG4At3lh7Dd4C1n3pBUmcQ57sK6nLdacimNWGoW4ixlLnupp7xuUjGfppTvZPI93VVBVFzCeFmrDvinxxEmdmA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1594894348209772.5522467640103; Thu, 16 Jul 2020 03:12:28 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-272-CuX2xG71M3qveWxgBdPlwQ-1; Thu, 16 Jul 2020 06:03:01 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 82DEE1E01; Thu, 16 Jul 2020 10:02:33 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6007978A59; Thu, 16 Jul 2020 10:02:33 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 30C7C96238; Thu, 16 Jul 2020 10:02:33 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 06GA2TvK016450 for ; Thu, 16 Jul 2020 06:02:29 -0400 Received: by smtp.corp.redhat.com (Postfix) id B36CC2B6E6; Thu, 16 Jul 2020 10:02:29 +0000 (UTC) Received: from antique-work.redhat.com (unknown [10.40.194.85]) by smtp.corp.redhat.com (Postfix) with ESMTP id 17BB32B6DB for ; Thu, 16 Jul 2020 10:02:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1594894347; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=TRqu5HsIkQkS5BtIcFavUlOjFO6RtDNsSrHYfgc9208=; b=df2uUGuv0DGN+B9pyByL03npxqoLL961LEnCQihuU4XfE+yA91Y3IwHDpWo2+gKbKE8FtT wmFTVxSoOWR4lc/18omoYq06X/wgnLXRQfXXAswko/VG3nF1c4K/3MCIwra2Iv2g/f4rQ7 tttW7IuAVjsfran6cT3TD2vQXZo1l1M= X-MC-Unique: CuX2xG71M3qveWxgBdPlwQ-1 From: Pavel Hrdina To: libvir-list@redhat.com Subject: [libvirt PATCH 072/351] meson: add thread build dependency Date: Thu, 16 Jul 2020 11:55:08 +0200 Message-Id: <19297ee6e169433d0a51733c6c0225aa0f8563e5.1594891445.git.phrdina@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Pavel Hrdina --- configure.ac | 1 - m4/virt-pthread.m4 | 58 ---------------------------------------------- meson.build | 18 ++++++++++++++ 3 files changed, 18 insertions(+), 59 deletions(-) delete mode 100644 m4/virt-pthread.m4 diff --git a/configure.ac b/configure.ac index 0a51a07be0e..60cde7c3da7 100644 --- a/configure.ac +++ b/configure.ac @@ -116,7 +116,6 @@ LIBVIRT_ARG_YAJL =20 LIBVIRT_CHECK_NWFILTER LIBVIRT_CHECK_PM_UTILS -LIBVIRT_CHECK_PTHREAD LIBVIRT_CHECK_UDEV LIBVIRT_CHECK_VIRTUALPORT LIBVIRT_CHECK_WIRESHARK diff --git a/m4/virt-pthread.m4 b/m4/virt-pthread.m4 deleted file mode 100644 index 0b52b40bb82..00000000000 --- a/m4/virt-pthread.m4 +++ /dev/null @@ -1,58 +0,0 @@ -dnl The libpthread.so library -dnl -dnl Copyright (C) 2016 Red Hat, Inc. -dnl -dnl This library is free software; you can redistribute it and/or -dnl modify it under the terms of the GNU Lesser General Public -dnl License as published by the Free Software Foundation; either -dnl version 2.1 of the License, or (at your option) any later version. -dnl -dnl This library is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY; without even the implied warranty of -dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -dnl Lesser General Public License for more details. -dnl -dnl You should have received a copy of the GNU Lesser General Public -dnl License along with this library. If not, see -dnl . -dnl - -AC_DEFUN([LIBVIRT_CHECK_PTHREAD], [ - dnl Availability of pthread functions - - AC_SEARCH_LIBS([pthread_mutexattr_init],[pthread ""]) - - if test "$ac_cv_func_pthread_mutexattr_init" =3D "no" - then - AC_MSG_ERROR([libpthread is required for building libvirt]) - fi - THREAD_LIBS=3D"" - if test "x$ac_cv_func_pthread_mutexattr_init" !=3D "x" - then - THREAD_LIBS=3D"-l$ac_cv_func_pthread_mutexattr_init" - fi - AC_SUBST([THREAD_LIBS]) - - AC_CHECK_HEADER([pthread.h],,[ - AC_MSG_ERROR([pthread.h is required for building libvirt]) - ]) - - dnl At least mingw64-winpthreads #defines pthread_sigmask to 0, - dnl which in turn causes compilation to complain about unused variables. - dnl Expose this broken implementation, so we can work around it. - AC_CACHE_CHECK([whether pthread_sigmask does anything], - [lv_cv_pthread_sigmask_works], - [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ - #include - #include - ]], [[ - #ifdef pthread_sigmask - int (*foo)(int, const sigset_t *, sigset_t *) =3D &pthread_sigmask; - return !foo; - #endif - ]])], [lv_cv_pthread_sigmask_works=3Dyes], [lv_cv_pthread_sigmask_work= s=3Dno])]) - if test "x$lv_cv_pthread_sigmask_works" !=3D xyes; then - AC_DEFINE([FUNC_PTHREAD_SIGMASK_BROKEN], [1], - [Define to 1 if pthread_sigmask is not a real function]) - fi -]) diff --git a/meson.build b/meson.build index fa4dbee3ef3..41c6075985d 100644 --- a/meson.build +++ b/meson.build @@ -1346,6 +1346,24 @@ if selinux_dep.found() conf.set('WITH_SELINUX', 1) endif =20 +thread_dep =3D dependency('threads', required: true) +pthread_sigmask_code =3D ''' + #include + #include + + int main() { + #ifdef pthread_sigmask + int (*foo)(int, const sigset_t *, sigset_t *) =3D &pthread_sigmask; + return !foo; + #endif + + return 0; + } +''' +if not cc.compiles(pthread_sigmask_code) + conf.set('FUNC_PTHREAD_SIGMASK_BROKEN', 1) +endif + =20 # generic build dependencies checks =20 --=20 2.26.2