From nobody Fri Apr 19 10:54:27 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.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=1599738793; cv=none; d=zohomail.com; s=zohoarc; b=C1f7uRPlCQsoqkhfz/y0ZbWf7u13YM+BbZ1VPPUQKnPzovbfYe2BCvhIUUPSwjIlnigvwLiz8M7EEQbWfv32CJcpkBhxrRQ2E7JFo59H3PIaTDiGgK+9p4gN4y28QApFgEDZqxWLZJRQQII3lll00iZaHz4rpfKZkHUSo8BQwrc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599738793; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=VWMFsoI11j5URWoK/kZwYY2BTBCMhzX+QDyKuVwu5Bs=; b=WgmVgoBilRSb5hDeVX4V0uR6QBVG5YCFB3tvz+YiP9A2JTY6x52BL2vrrsWasQh/+i/d2214DWp4Y7UIY2JZCbbWYPMz8hWuclJJTKo5NfW2mSWo3QqPUwD8joKzsYZGKqvbudFjur4Bxmlf/lxeUER5pCfbBgoDO28yiel4EkI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 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-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1599738793334210.30697250291496; Thu, 10 Sep 2020 04:53:13 -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-22-nnQje9W_OEWyWlMiPH4ByA-1; Thu, 10 Sep 2020 07:53:10 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C1ABA10BBED2; Thu, 10 Sep 2020 11:53:04 +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 6DE465C1CF; Thu, 10 Sep 2020 11:53:03 +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 7F1B1922F1; Thu, 10 Sep 2020 11:53:01 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08ABr1Nt030545 for ; Thu, 10 Sep 2020 07:53:01 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2538C7EB7A; Thu, 10 Sep 2020 11:53:01 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-112-4.ams2.redhat.com [10.36.112.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 524CA7EB74; Thu, 10 Sep 2020 11:52:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599738792; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=VWMFsoI11j5URWoK/kZwYY2BTBCMhzX+QDyKuVwu5Bs=; b=WGya+ygpfD7qYFrZNNJu+dn1XbTzNPWfaMaV4LJTzpGlNNovjOV/eawSYIKbKNOWmkLY1L 5QpsGnaub4/vGdi6rLY0TasXdcCph8+/zsqDAVbJ4FBGuAYRGOJ/s81UXM5bmgWzbEHjdK vVX7E/ldt8SntolLhgjlgoD8NUocV0c= X-MC-Unique: nnQje9W_OEWyWlMiPH4ByA-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [PATCH v2] Fix linkage to libutil and libkvm on FreeBSD 11 Date: Thu, 10 Sep 2020 12:52:52 +0100 Message-Id: <20200910115252.1095147-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) We are currently adding -lutil and -lkvm to the linker using the add_project_link_arguments method. On FreeBSD 11.4, this results in build errors because the args appear too early in the command line. We need to pass the libraries as dependencies so that they get placed at the same point in the linker args as other dependencies. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Pavel Hrdina Reviewed-by: Roman Bogorodskiy --- meson.build | 17 ++++++++--------- src/bhyve/meson.build | 2 ++ src/util/meson.build | 2 ++ 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/meson.build b/meson.build index 33eaa9ff56..bcb978292b 100644 --- a/meson.build +++ b/meson.build @@ -1086,7 +1086,8 @@ endif # Check for BSD kvm (kernel memory interface) if host_machine.system() =3D=3D 'freebsd' kvm_dep =3D cc.find_library('kvm') - add_project_link_arguments('-lkvm', language: 'c') +else + kvm_dep =3D dependency('', required: false) endif =20 libiscsi_version =3D '1.18.0' @@ -1203,11 +1204,10 @@ have_gnu_gettext_tools =3D false if not get_option('nls').disabled() have_gettext =3D cc.has_function('gettext') if not have_gettext - intl_lib =3D cc.find_library('intl', required: false) - have_gettext =3D intl_lib.found() - if have_gettext - add_project_link_arguments('-lintl', language: 'c') - endif + intl_dep =3D cc.find_library('intl', required: false) + have_gettext =3D intl_dep.found() + else + intl_dep =3D dependency('', required: false) endif if not have_gettext and get_option('nls').enabled() error('gettext() is required to build libvirt') @@ -1235,6 +1235,8 @@ if not get_option('nls').disabled() have_gnu_gettext_tools =3D true endif endif +else + intl_dep =3D dependency('', required: false) endif =20 numactl_dep =3D cc.find_library('numa', required: get_option('numactl')) @@ -1402,9 +1404,6 @@ if udev_dep.found() endif =20 util_dep =3D cc.find_library('util', required: false) -if util_dep.found() - add_project_link_arguments('-lutil', language: 'c') -endif =20 if not get_option('virtualport').disabled() if cc.has_header_symbol('linux/if_link.h', 'IFLA_PORT_MAX') diff --git a/src/bhyve/meson.build b/src/bhyve/meson.build index 7d54718820..975f93a9c0 100644 --- a/src/bhyve/meson.build +++ b/src/bhyve/meson.build @@ -21,7 +21,9 @@ if conf.has('WITH_BHYVE') ], dependencies: [ access_dep, + kvm_dep, src_dep, + util_dep, ], include_directories: [ conf_inc_dir, diff --git a/src/util/meson.build b/src/util/meson.build index f7092cc3f1..bf556e7ae6 100644 --- a/src/util/meson.build +++ b/src/util/meson.build @@ -187,12 +187,14 @@ virt_util_lib =3D static_library( dbus_dep, devmapper_dep, gnutls_dep, + intl_dep, libnl_dep, m_dep, numactl_dep, secdriver_dep, src_dep, thread_dep, + util_dep, win32_dep, yajl_dep, ], --=20 2.26.2