From patchwork Sun Oct 19 14:07:38 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 24704 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 AC5ADBE080 for ; Sun, 19 Oct 2025 14:07:49 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id B4AFD606E8; Sun, 19 Oct 2025 16:07:48 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="rYrf2xn3"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 1D6AE606AC for ; Sun, 19 Oct 2025 16:07:47 +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 99208766 for ; Sun, 19 Oct 2025 16:06:04 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1760882764; bh=JhbswliOXOYyQCFRbqrdmrKs9MbhBsRZ2uW32j3IQVw=; h=From:To:Subject:Date:From; b=rYrf2xn3L6sp5TWS20mx4vaPIO3ybt/xCQwpvVG1YpGBXVshWe+r7llC1t07hsIe/ U85gze0kNyJfFYzBH/UETSHl/m396tkZE/jdn18kNfq1f0D7b2SHpIvrrL850Dbp8f RiqbWu7IFbAw2y/9jjRUdxicDnULqrF3wTor5JcE= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Subject: [PATCH] subprojects: libyuv: Bump to version 1908 Date: Sun, 19 Oct 2025 17:07:38 +0300 Message-ID: <20251019140738.30325-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 1908, which is the oldest that requires CMake 3.5 or newer. This introduces another 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 --- src/meson.build | 16 +++++++++++++++- subprojects/libyuv.wrap | 2 +- 2 files changed, 16 insertions(+), 2 deletions(-) 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..70039b705925 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 = 23d416d6f32539bc7e44afa2bec6ce0128dbed0b