From nobody Mon Feb 9 09:29:41 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1608198894; cv=none; d=zohomail.com; s=zohoarc; b=RD+ATPJfLRlPdOeEBkxBCCGJpaZ5ZIROf+8BsbHWFhWNgFjCRHLl+bgLrVLC5GXVFVJg2mpe+z1V1UfIEesnZgxNOFp0orAh1oxxLzll689wQnw8ppyfejyLX4/1HFjdTBT6ZNcHXuWcG1EyYpkPbGp8sXbGiuOhRtH5S1+1Jrk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1608198894; h=Content-Transfer-Encoding:Cc: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=kfiov3tZ0m7QpUN64F+t6W9nkhHG9RCaQOMRa8dZVP4=; b=fm2YBD38R1AdiSNijfem+zUPjM+fY+4SnC5zhb3Urz0yJJ4kNq7Q54G0sIPmed+L9XtY2TuAI6RZYuthnc2CcAaGN2d1AFQVQV19eEFmz3Lrm9/60jMjbPoYlgf7UJOFYj6VMldqfzNLdnhyWho42EMlunrJ0+1smhxuCTYcTC0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16081988945061019.1306501305816; Thu, 17 Dec 2020 01:54:54 -0800 (PST) Received: from localhost ([::1]:53798 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kppzp-0002r9-Ct for importer@patchew.org; Thu, 17 Dec 2020 04:54:53 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:47884) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kppmb-000526-Jp for qemu-devel@nongnu.org; Thu, 17 Dec 2020 04:41:13 -0500 Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]:33319) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kppmR-0007mA-1a for qemu-devel@nongnu.org; Thu, 17 Dec 2020 04:41:13 -0500 Received: by mail-ed1-x533.google.com with SMTP id j16so5507179edr.0 for ; Thu, 17 Dec 2020 01:41:01 -0800 (PST) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id rs27sm3463677ejb.21.2020.12.17.01.40.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Dec 2020 01:41:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=kfiov3tZ0m7QpUN64F+t6W9nkhHG9RCaQOMRa8dZVP4=; b=jOCCOpEg+DBK55dWBXjXfOtnb+1C4LJ4nJJiPBLCfsvikhvQ5On9rQc1tFYlN7VTPP OZNI+J9a/fDe0REYH/hnCiUy50KsPoXxjDkMhSH+B4fY9pRi+C+PLMUX/qHrZb6PRiuA HNYUAbcU1cZb0TrBUTyKCOiuY3lta6uaYp39jmV8ZjVpzq1vVqF98SxAC3leyxVbOZa/ 1GNLVWxu+/Dazs6KYdd9cMQmUewGfQ2If45S+MaduPwTGjxXfMxngl2QJJVFJsLxr60n Aho18DcXrTSBjMWvF5XFaGE9vKcisQ6b7llt39hnnP3/xdl9dt9+Tg0SYnr+np11KUBI tjYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=kfiov3tZ0m7QpUN64F+t6W9nkhHG9RCaQOMRa8dZVP4=; b=FN5JXa0l8u4cahGQYvQRau29JA2IrA8oMRZfsNLOOIfQ4kIN/i6pr/6e1OLwE2g5k/ Khdn2Z3cL1aOgoiqdlHEot30autywAAoav+CXVRqzbY3ola3hqKLVG4aADwOnixTcqD5 h5XHr39b3EUB7qiXtBn8EdTd/fHqxAK5P3vqEvfUgqKMW8PVfINJsrDQaj1mK13eG3ro +bfRc5mA4wlrc4KkAURZePl9+4mDr3y4ZImhzCWByxMly++MLvppAVGxdOv7n9Xu7RDI 44pNLbZ+Ix6V8a6sT3tDXOKlq7CYMGDKxukNga5GYHdLQLrWMlXEQ8kY9OfR21g+kF06 JkNw== X-Gm-Message-State: AOAM532ShSheia/o5kik7I6T2zHO7/x7vmos2l8e4L/NtAYwSCPBhD8c kjOI+0f4cEnyCcqex1YhqiFhvmIEFSU= X-Google-Smtp-Source: ABdhPJxyi/skR7jqwqJQKbXvxKw18Gt435EsCW2DFqAaQjUU/eVVUEx3hqty5kVCmqiB/rkatyuN2A== X-Received: by 2002:a50:cd57:: with SMTP id d23mr37387349edj.95.1608198060760; Thu, 17 Dec 2020 01:41:00 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 16/18] cap_ng: convert to meson Date: Thu, 17 Dec 2020 10:40:42 +0100 Message-Id: <20201217094044.46462-17-pbonzini@redhat.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201217094044.46462-1-pbonzini@redhat.com> References: <20201217094044.46462-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=2a00:1450:4864:20::533; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x533.google.com X-Spam_score_int: -11 X-Spam_score: -1.2 X-Spam_bar: - X-Spam_report: (-1.2 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Marc-Andr=C3=83=C2=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Signed-off-by: Paolo Bonzini Reviewed-by: Marc-Andr=C3=A9 Lureau --- configure | 34 ++++------------------------------ meson.build | 24 ++++++++++++++++++++---- meson_options.txt | 2 ++ tools/meson.build | 4 ++-- 4 files changed, 28 insertions(+), 36 deletions(-) diff --git a/configure b/configure index 11d6f40f92..faee71612f 100755 --- a/configure +++ b/configure @@ -331,7 +331,7 @@ xen_ctrl_version=3D"$default_feature" xen_pci_passthrough=3D"auto" linux_aio=3D"$default_feature" linux_io_uring=3D"$default_feature" -cap_ng=3D"$default_feature" +cap_ng=3D"auto" attr=3D"$default_feature" libattr=3D"$default_feature" xfs=3D"$default_feature" @@ -1123,9 +1123,9 @@ for opt do ;; --enable-tcg-interpreter) tcg_interpreter=3D"yes" ;; - --disable-cap-ng) cap_ng=3D"no" + --disable-cap-ng) cap_ng=3D"disabled" ;; - --enable-cap-ng) cap_ng=3D"yes" + --enable-cap-ng) cap_ng=3D"enabled" ;; --disable-tcg) tcg=3D"disabled" ;; @@ -3193,28 +3193,6 @@ EOF fi fi =20 -########################################## -# libcap-ng library probe -if test "$cap_ng" !=3D "no" ; then - cap_libs=3D"-lcap-ng" - cat > $TMPC << EOF -#include -int main(void) -{ - capng_capability_to_name(CAPNG_EFFECTIVE); - return 0; -} -EOF - if compile_prog "" "$cap_libs" ; then - cap_ng=3Dyes - else - if test "$cap_ng" =3D "yes" ; then - feature_not_found "cap_ng" "Install libcap-ng devel" - fi - cap_ng=3Dno - fi -fi - ########################################## # Sound support libraries probe =20 @@ -5671,10 +5649,6 @@ fi if test "$gprof" =3D "yes" ; then echo "CONFIG_GPROF=3Dy" >> $config_host_mak fi -if test "$cap_ng" =3D "yes" ; then - echo "CONFIG_LIBCAP_NG=3Dy" >> $config_host_mak - echo "LIBCAP_NG_LIBS=3D$cap_libs" >> $config_host_mak -fi echo "CONFIG_AUDIO_DRIVERS=3D$audio_drv_list" >> $config_host_mak for drv in $audio_drv_list; do def=3DCONFIG_AUDIO_$(echo $drv | LC_ALL=3DC tr '[a-z]' '[A-Z]') @@ -6561,7 +6535,7 @@ NINJA=3D$ninja $meson setup \ -Dcurl=3D$curl -Dglusterfs=3D$glusterfs -Dbzip2=3D$bzip2 -Dlibiscs= i=3D$libiscsi \ -Dlibnfs=3D$libnfs -Diconv=3D$iconv -Dcurses=3D$curses -Dlibudev= =3D$libudev\ -Dlibssh=3D$libssh -Drbd=3D$rbd -Dlzo=3D$lzo -Dsnappy=3D$snappy -D= lzfse=3D$lzfse \ - -Dzstd=3D$zstd -Dseccomp=3D$seccomp -Dvirtfs=3D$virtfs \ + -Dzstd=3D$zstd -Dseccomp=3D$seccomp -Dvirtfs=3D$virtfs -Dcap_ng=3D= $cap_ng \ -Ddocs=3D$docs -Dsphinx_build=3D$sphinx_build -Dinstall_blobs=3D$b= lobs \ -Dvhost_user_blk_server=3D$vhost_user_blk_server \ -Dfuse=3D$fuse -Dfuse_lseek=3D$fuse_lseek \ diff --git a/meson.build b/meson.build index 08d3586df5..56ab291d87 100644 --- a/meson.build +++ b/meson.build @@ -334,10 +334,25 @@ if not get_option('libiscsi').auto() or have_system o= r have_tools required: get_option('seccomp'), method: 'pkg-config', static: enable_static) endif -libcap_ng =3D not_found -if 'CONFIG_LIBCAP_NG' in config_host - libcap_ng =3D declare_dependency(link_args: config_host['LIBCAP_NG_LIBS'= ].split()) + +libcap_ng =3D cc.find_library('cap-ng', has_headers: ['cap-ng.h'], + required: get_option('cap_ng'), + static: enable_static) +if libcap_ng.found() and not cc.links(''' + #include + int main(void) + { + capng_capability_to_name(CAPNG_EFFECTIVE); + return 0; + }''', dependencies: libcap_ng) + libcap_ng =3D not_found + if get_option('cap_ng').enabled() + error('could not link libcap-ng') + else + warning('could not link libcap-ng, disabling') + endif endif + if get_option('xkbcommon').auto() and not have_system and not have_tools xkbcommon =3D not_found else @@ -1006,6 +1021,7 @@ config_host_data.set('CONFIG_GLUSTERFS_FALLOCATE', gl= usterfs.version().version_c config_host_data.set('CONFIG_GLUSTERFS_ZEROFILL', glusterfs.version().vers= ion_compare('>=3D6')) config_host_data.set('CONFIG_GLUSTERFS_FTRUNCATE_HAS_STAT', glusterfs_ftru= ncate_has_stat) config_host_data.set('CONFIG_GLUSTERFS_IOCB_HAS_STAT', glusterfs_iocb_has_= stat) +config_host_data.set('CONFIG_LIBCAP_NG', libcap_ng.found()) config_host_data.set('CONFIG_LIBISCSI', libiscsi.found()) config_host_data.set('CONFIG_LIBNFS', libnfs.found()) config_host_data.set('CONFIG_LIBSSH', libssh.found()) @@ -2348,7 +2364,7 @@ summary_info +=3D {'fdatasync': config_host.h= as_key('CONFIG_FDATASYNC')} summary_info +=3D {'madvise': config_host.has_key('CONFIG_MADVIS= E')} summary_info +=3D {'posix_madvise': config_host.has_key('CONFIG_POSIX_= MADVISE')} summary_info +=3D {'posix_memalign': config_host.has_key('CONFIG_POSIX_= MEMALIGN')} -summary_info +=3D {'libcap-ng support': config_host.has_key('CONFIG_LIBCAP= _NG')} +summary_info +=3D {'libcap-ng support': libcap_ng.found()} summary_info +=3D {'vhost-kernel support': config_host.has_key('CONFIG_VHO= ST_KERNEL')} summary_info +=3D {'vhost-net support': config_host.has_key('CONFIG_VHOST_= NET')} summary_info +=3D {'vhost-crypto support': config_host.has_key('CONFIG_VHO= ST_CRYPTO')} diff --git a/meson_options.txt b/meson_options.txt index 59a8a50e5b..12a1872f20 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -44,6 +44,8 @@ option('brlapi', type : 'feature', value : 'auto', description: 'brlapi character device driver') option('bzip2', type : 'feature', value : 'auto', description: 'bzip2 support for DMG images') +option('cap_ng', type : 'feature', value : 'auto', + description: 'cap_ng support') option('cocoa', type : 'feature', value : 'auto', description: 'Cocoa user interface (macOS only)') option('curl', type : 'feature', value : 'auto', diff --git a/tools/meson.build b/tools/meson.build index 5c52d79fe4..fdce66857d 100644 --- a/tools/meson.build +++ b/tools/meson.build @@ -1,14 +1,14 @@ have_virtiofsd =3D (targetos =3D=3D 'linux' and have_tools and seccomp.found() and - 'CONFIG_LIBCAP_NG' in config_host and + libcap_ng.found() and 'CONFIG_VHOST_USER' in config_host) =20 if get_option('virtiofsd').enabled() if not have_virtiofsd if targetos !=3D 'linux' error('virtiofsd requires Linux') - elif not seccomp.found() or 'CONFIG_LIBCAP_NG' not in config_host + elif not seccomp.found() or not libcap_ng.found() error('virtiofsd requires libcap-ng-devel and seccomp-devel') elif not have_tools or 'CONFIG_VHOST_USER' not in config_host error('virtiofsd needs tools and vhost-user support') --=20 2.29.2