[{"id":36362,"web_url":"https://patchwork.libcamera.org/comment/36362/","msgid":"<20251020131238.GA27485@pendragon.ideasonboard.com>","date":"2025-10-20T13:12:38","subject":"Re: [PATCH v2] subprojects: libyuv: Bump to version 1921","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Mon, Oct 20, 2025 at 04:10:34PM +0300, Laurent Pinchart wrote:\n> The libyuv wrap uses a libyuv commit between versions 1770 and 1772,\n> more than 5 years old. This specifies CMake 2.8 as the minimum required\n> version.\n> \n> The most recent CMake has dropped compatibility with versions older than\n> 3.5 in CMake 4.0. CMake 3.5 was released in 2016, and all distributions\n> we care about ship more recent versions. With CMake 4.0 or newer,\n> shipped for instance by Gentoo, compilation of the libyuv wrap fails.\n> \n> Update the wrap to version 1921, which is the latest numbered version\n> (libyuv doesn't tag release by increases a version number in the\n> README.chromium file). This requires CMake 3.16, released 6 years ago,\n> and available in at least the last two LTS of major distributions.\n> \n> This update introduces an issue: due to a bug in Meson (see\n> https://github.com/mesonbuild/meson/issues/10764), PIC handling is\n> broken when a CMake project wraps a static library into another static\n> library that has no additional source file. Work around it by wrapping\n> the libyuv static library again, manually setting 'pic' to true.\n> \n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nI forgot to add the tags from v1:\n\nReviewed-by: Stefan Klug <stefan.klug@ideasonboard.com>\nAcked-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n> ---\n> Changes since v1:\n> \n> - Update to version 1921\n> ---\n>  src/meson.build         | 16 +++++++++++++++-\n>  subprojects/libyuv.wrap |  2 +-\n>  2 files changed, 16 insertions(+), 2 deletions(-)\n> \n> diff --git a/src/meson.build b/src/meson.build\n> index 8eb8f05b362f..9b63c8e845d8 100644\n> --- a/src/meson.build\n> +++ b/src/meson.build\n> @@ -55,7 +55,21 @@ if (pipelines.contains('virtual') or get_option('android').allowed()) and \\\n>           '-Wno-unused-parameter')\n>      libyuv_vars.append_link_args('-ljpeg')\n>      libyuv = cmake.subproject('libyuv', options : libyuv_vars)\n> -    libyuv_dep = libyuv.dependency('yuv')\n> +\n> +    # Meson fails to apply the -fPIC flag to static libraries produced by CMake\n> +    # that wraps other static libraries without adding any source file, despite\n> +    # setting CMAKE_POSITION_INDEPENDENT_CODE to ON. See\n> +    # https://github.com/mesonbuild/meson/issues/10764.\n> +    #\n> +    # Work around the issue by wrapping the libyuv static library into another\n> +    # static library with 'pic' set to true.\n> +    libyuv_static = static_library('libyuv-static',\n> +                                   dependencies : libyuv.dependency('yuv'),\n> +                                   pic : true,\n> +                                   install : false)\n> +    libyuv_include = libyuv.include_directories('yuv')\n> +    libyuv_dep = declare_dependency(link_with : libyuv_static,\n> +                                    include_directories : libyuv_include)\n>  endif\n> \n>  # libcamera must be built first as a dependency to the other components.\n> diff --git a/subprojects/libyuv.wrap b/subprojects/libyuv.wrap\n> index 3417e73f376c..c85b96b77345 100644\n> --- a/subprojects/libyuv.wrap\n> +++ b/subprojects/libyuv.wrap\n> @@ -3,4 +3,4 @@\n>  [wrap-git]\n>  directory = libyuv\n>  url = https://chromium.googlesource.com/libyuv/libyuv.git\n> -revision = 93b1b332cd60b56ab90aea14182755e379c28a80\n> +revision = 2b4453d46faebcad72d744d763a4e3b1e97d338d\n> \n> base-commit: 06aee9135f9fd135a8c0bc0b55971b29f7617d02","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 C183EC3259\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 20 Oct 2025 13:12:50 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 0FE6760750;\n\tMon, 20 Oct 2025 15:12:50 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id F2FE260728\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 20 Oct 2025 15:12:47 +0200 (CEST)","from pendragon.ideasonboard.com (87-94-110-32.bb.dnainternet.fi\n\t[87.94.110.32])\n\tby perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id 131C86F9\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 20 Oct 2025 15:11:04 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"RuW9Zfq/\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1760965865;\n\tbh=w0rEyzbuG/RZ2pXbgawv8cvHnzWZEwAzzmoBOcCoAJk=;\n\th=Date:From:To:Subject:References:In-Reply-To:From;\n\tb=RuW9Zfq/3HxeE7GYEiXryhutN0JFB512Ki66lmB7sIfsXbLwpPWYgr5Q49goRcP7B\n\t8iaIOkJGz3ghdYZe1ZGexhmlHRp2yoPK399pk6B7jQmA7hmiu0s8kqgJv6pJtKglzl\n\tsWRAVWh9ZDvjt9wIVZg0Cj/AeAPAYQasIVpave8k=","Date":"Mon, 20 Oct 2025 16:12:38 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH v2] subprojects: libyuv: Bump to version 1921","Message-ID":"<20251020131238.GA27485@pendragon.ideasonboard.com>","References":"<20251020131034.26278-1-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20251020131034.26278-1-laurent.pinchart@ideasonboard.com>","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]