[{"id":25559,"web_url":"https://patchwork.libcamera.org/comment/25559/","msgid":"<Y1ci+tMrHv1aJFnm@pendragon.ideasonboard.com>","date":"2022-10-24T23:42:50","subject":"Re: [libcamera-devel] [PATCH 07/11] Makes libdl optional when the\n\truntime includes a dynamic loader.","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Nicholas,\n\nThank you for the patch.\n\nOn Mon, Oct 24, 2022 at 12:55:39AM -0500, Nicholas Roth via libcamera-devel wrote:\n> From: Nicholas Roth <nicholas@rothemail.net>\n> \n> ---\n>  src/libcamera/meson.build | 7 ++++++-\n>  1 file changed, 6 insertions(+), 1 deletion(-)\n> \n> diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build\n> index 5f39d2e2..0494e808 100644\n> --- a/src/libcamera/meson.build\n> +++ b/src/libcamera/meson.build\n> @@ -65,7 +65,12 @@ subdir('ipa')\n>  subdir('pipeline')\n>  subdir('proxy')\n>  \n> -libdl = cc.find_library('dl')\n> +null_dep = dependency('', required : false)\n> +\n> +libdl = null_dep\n> +if not cc.has_function('dlopen')\n> +    libdl = cc.find_library('dl')\n> +endif\n\nI would have written that\n\nif not cc.has_function('dlopen')\n    libdl = cc.find_library('dl')\nelse\n    libdl = null_dep\nendif\n\nbut it's a matter of personal preference I suppose, I'm fine either way.\n\nIt would be nice to use dependency('dl') instead, but that has been\nadded in meson 0.62.0, and upgrading the minimum meson version would be\ninconvenient as 0.62.0 isn't shipped by the latest Debian stable. Let's\ncapture that in a comment to simplify the code when we'll update the\nrequirement:\n\n# TODO: Use dependency('dl') when updating to meson 0.62.0.\nlibdl = null_dep\nif not cc.has_function('dlopen')\n    libdl = cc.find_library('dl')\nendif\n\nApart from that, this looks good.\n\n>  libudev = dependency('libudev', required : false)\n>  libyaml = dependency('yaml-0.1', required : false)\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 5F1FABD16B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 24 Oct 2022 23:43:18 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B296262F25;\n\tTue, 25 Oct 2022 01:43:17 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id E640462EAE\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 25 Oct 2022 01:43:16 +0200 (CEST)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 5B289D3C;\n\tTue, 25 Oct 2022 01:43:16 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1666654997;\n\tbh=qCq61cN1Nf1asHykHThyZCZvG1blegGgM6sz6n/erZQ=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=nQZnZXMmeO8ikeUxLnYLWxWs7pzubh2WCSfgZlQTMyakadrBkHXOEqgsZrN9YyLp/\n\tdDKroLXij6x27MUT6XdE9tdVUqwf5lHfP29DCJ96kbb6oKByp/eTErF7mNvKzQnIx0\n\tNLwGYCFCPlQjXb5gLILgTkHBflrJxUU0KIURK23Qb/aeEfDFzEpArKtPM1eX5krEoU\n\tBSaVrk7Go1qFSbv+Ii6DUVoTTfWwHvkLLcSWIo1nL8HG3KZONpt+ZX4rjdVg+Umn/F\n\t/vmVCjfnuT3JjToKMdVm0eZiaQRWi7yjJhdc/1zHsuM0id1yxmWhldbCrRjT3pYeCn\n\tLS0liG7yohDPw==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1666654996;\n\tbh=qCq61cN1Nf1asHykHThyZCZvG1blegGgM6sz6n/erZQ=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=BsSj4/ihXY/XDDgt2QcuX4hlOh8FUoMkbl4jUaImXosLNPgIlAihiZ4jUz/Jq8Xu6\n\tnIFf5joO6SDqW6odGhRmyJcKhHMdNX9KQUjFKr+EqIw0iWSaij7pBcW/re6PGHDfa/\n\t1mWE9bhNyonatNIl+E5CUY545Hk55Wpk16DPOWr4="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"BsSj4/ih\"; dkim-atps=neutral","Date":"Tue, 25 Oct 2022 02:42:50 +0300","To":"Nicholas Roth via libcamera-devel <libcamera-devel@lists.libcamera.org>","Message-ID":"<Y1ci+tMrHv1aJFnm@pendragon.ideasonboard.com>","References":"<20221024055543.116040-1-nicholas@rothemail.net>\n\t<20221024055543.116040-8-nicholas@rothemail.net>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20221024055543.116040-8-nicholas@rothemail.net>","Subject":"Re: [libcamera-devel] [PATCH 07/11] Makes libdl optional when the\n\truntime includes a dynamic loader.","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"nicholas@rothemail.net","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]