From patchwork Mon Oct 20 13:10:34 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 24707 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 18E90BE080 for ; Mon, 20 Oct 2025 13:10:46 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 57E0C60728; Mon, 20 Oct 2025 15:10:45 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="dWEiIED/"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 405A760728 for ; Mon, 20 Oct 2025 15:10:44 +0200 (CEST) Received: from pendragon.ideasonboard.com (87-94-110-32.bb.dnainternet.fi [87.94.110.32]) by perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id 3453A6F9 for ; Mon, 20 Oct 2025 15:09:01 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1760965741; bh=fprQVUMKx5gRr+HRRIdbiildZHWriLt5CtH/oKUIUXg=; h=From:To:Subject:Date:From; b=dWEiIED/JMsWtUo7vIjpe6n6olleBH57oUPVco6/s4nPQah3+bVF+hU2UZ1ySf/IN 6n0enJ7NV/lDfa+Eljh+NvFLh4j4vW9Dc1L2SuOUbCfWpeZTjfz2iY/iJ0RHOQ7M3d 5gN2ouy3QCh2r+93PJi3y8NFdmB8DfFhUfIKSZMY= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Subject: [PATCH v2] subprojects: libyuv: Bump to version 1921 Date: Mon, 20 Oct 2025 16:10:34 +0300 Message-ID: <20251020131034.26278-1-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.51.0 MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The libyuv wrap uses a libyuv commit between versions 1770 and 1772, more than 5 years old. This specifies CMake 2.8 as the minimum required version. The most recent CMake has dropped compatibility with versions older than 3.5 in CMake 4.0. CMake 3.5 was released in 2016, and all distributions we care about ship more recent versions. With CMake 4.0 or newer, shipped for instance by Gentoo, compilation of the libyuv wrap fails. Update the wrap to version 1921, which is the latest numbered version (libyuv doesn't tag release by increases a version number in the README.chromium file). This requires CMake 3.16, released 6 years ago, and available in at least the last two LTS of major distributions. This update introduces an issue: due to a bug in Meson (see https://github.com/mesonbuild/meson/issues/10764), PIC handling is broken when a CMake project wraps a static library into another static library that has no additional source file. Work around it by wrapping the libyuv static library again, manually setting 'pic' to true. Signed-off-by: Laurent Pinchart Reviewed-by: Stefan Klug Acked-by: Kieran Bingham --- Changes since v1: - Update to version 1921 --- src/meson.build | 16 +++++++++++++++- subprojects/libyuv.wrap | 2 +- 2 files changed, 16 insertions(+), 2 deletions(-) base-commit: 06aee9135f9fd135a8c0bc0b55971b29f7617d02 -- Regards, Laurent Pinchart diff --git a/src/meson.build b/src/meson.build index 8eb8f05b362f..9b63c8e845d8 100644 --- a/src/meson.build +++ b/src/meson.build @@ -55,7 +55,21 @@ if (pipelines.contains('virtual') or get_option('android').allowed()) and \ '-Wno-unused-parameter') libyuv_vars.append_link_args('-ljpeg') libyuv = cmake.subproject('libyuv', options : libyuv_vars) - libyuv_dep = libyuv.dependency('yuv') + + # Meson fails to apply the -fPIC flag to static libraries produced by CMake + # that wraps other static libraries without adding any source file, despite + # setting CMAKE_POSITION_INDEPENDENT_CODE to ON. See + # https://github.com/mesonbuild/meson/issues/10764. + # + # Work around the issue by wrapping the libyuv static library into another + # static library with 'pic' set to true. + libyuv_static = static_library('libyuv-static', + dependencies : libyuv.dependency('yuv'), + pic : true, + install : false) + libyuv_include = libyuv.include_directories('yuv') + libyuv_dep = declare_dependency(link_with : libyuv_static, + include_directories : libyuv_include) endif # libcamera must be built first as a dependency to the other components. diff --git a/subprojects/libyuv.wrap b/subprojects/libyuv.wrap index 3417e73f376c..c85b96b77345 100644 --- a/subprojects/libyuv.wrap +++ b/subprojects/libyuv.wrap @@ -3,4 +3,4 @@ [wrap-git] directory = libyuv url = https://chromium.googlesource.com/libyuv/libyuv.git -revision = 93b1b332cd60b56ab90aea14182755e379c28a80 +revision = 2b4453d46faebcad72d744d763a4e3b1e97d338d