From patchwork Wed Oct 5 10:56:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 17528 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 957D8C327C for ; Wed, 5 Oct 2022 10:56:27 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 0FF10621F8; Wed, 5 Oct 2022 12:56:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1664967386; bh=ua5riu3ilu4tB+opcUOnpEmJh1fyFwkYD80l5SiXopw=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=Nfgd/ff8RjySx5utNo6OlM/xpY6bHfD3ewTK/AEe262nOGCZTM6/cOPg9hkEwPH9i uIvi3ysBN6ji7mEpzbGhBZ0txIzITi8Ck4iCvzp9rRsj6EGiY05L7UJI0rjGzweYlz uqnWI1fAgacpeNFKqiDMJEDZZxQDCq2PkP/ZE+bCVJwYb2BlvSHycdAuAd4Geg0WK4 Q0tnZ8/UUTXRn2LfIFh9wV860vYNDCvM4vH31bBhijsmggzG0sr+JiOr1fhsnimFbX oTlhyusmY3RS2JKwAKYXTkrq7INARMgUWNeWs9d5qZU6R5ybR+XDcVNJCntNtOfkCB 7GOrYTFqfx0Ig== 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 8098B621BC for ; Wed, 5 Oct 2022 12:56:24 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="QscEJNWs"; dkim-atps=neutral Received: from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 0017E997; Wed, 5 Oct 2022 12:56:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1664967384; bh=ua5riu3ilu4tB+opcUOnpEmJh1fyFwkYD80l5SiXopw=; h=From:To:Cc:Subject:Date:From; b=QscEJNWsdh+rKLtGWSuG9jkWaJp5dELdBN9cDkHrioZVNYBys4IXnMMjd+VzQV6ga oeUkc40+uyDabefYGIWQjg8I+PtX/Kbb59npC48SR1sVMrhcBBKje6pfDzv/9SYNSX zgIzebQjuHMsDyc/UULgINhjj58sVqsp47Zq0cvE= To: libcamera-devel@lists.libcamera.org Date: Wed, 5 Oct 2022 13:56:21 +0300 Message-Id: <20221005105621.9658-1-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] test: threads: Fix link failure due to missing dependency 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: , X-Patchwork-Original-From: Laurent Pinchart via libcamera-devel From: Laurent Pinchart Reply-To: Laurent Pinchart Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Commit 036d26d6677e ("test: threads: Test thread cleanup upon abnormal termination") added calls to functions provided by the pthread library in the threads test, but didn't add the corresponding dependency. This caused a link breakage on some platforms: /usr/bin/ld: test/threads.p/threads.cpp.o: undefined reference to symbol 'pthread_cancel@@GLIBC_2.4' /usr/bin/ld: /lib/arm-linux-gnueabihf/libpthread.so.0: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status Fix it by adding the missing dependency. Fixes: 036d26d6677e ("test: threads: Test thread cleanup upon abnormal termination") Reported-by: Naushir Patuck Signed-off-by: Laurent Pinchart Reviewed-by: Naushir Patuck Tested-by: Naushir Patuck Acked-by: Jacopo Mondi --- src/libcamera/base/meson.build | 2 +- src/libcamera/meson.build | 1 + test/meson.build | 23 +++++++++++++++++++---- 3 files changed, 21 insertions(+), 5 deletions(-) base-commit: 12f4708e35cde15ff9607d59eb053ece1b2bd081 diff --git a/src/libcamera/base/meson.build b/src/libcamera/base/meson.build index 3b9d74efe935..7a75914ab2a8 100644 --- a/src/libcamera/base/meson.build +++ b/src/libcamera/base/meson.build @@ -38,9 +38,9 @@ if libunwind.found() endif libcamera_base_deps = [ - dependency('threads'), libatomic, libdw, + libthreads, libunwind, ] diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build index 63b47b177fd2..7fcbb2ddc9e7 100644 --- a/src/libcamera/meson.build +++ b/src/libcamera/meson.build @@ -58,6 +58,7 @@ includes = [ ] libatomic = cc.find_library('atomic', required : false) +libthreads = dependency('threads') subdir('base') subdir('ipa') diff --git a/test/meson.build b/test/meson.build index 6cc778415dc8..9bf7bf34e796 100644 --- a/test/meson.build +++ b/test/meson.build @@ -51,7 +51,7 @@ internal_tests = [ ['pixel-format', 'pixel-format.cpp'], ['shared-fd', 'shared-fd.cpp'], ['signal-threads', 'signal-threads.cpp'], - ['threads', 'threads.cpp'], + ['threads', 'threads.cpp', [libthreads]], ['timer', 'timer.cpp'], ['timer-thread', 'timer-thread.cpp'], ['unique-fd', 'unique-fd.cpp'], @@ -65,8 +65,13 @@ internal_non_parallel_tests = [ ] foreach t : public_tests + deps = [libcamera_public] + if t.length() > 2 + deps += t[2] + endif + exe = executable(t[0], t[1], - dependencies : libcamera_public, + dependencies : deps, link_with : test_libraries, include_directories : test_includes_public) @@ -74,8 +79,13 @@ foreach t : public_tests endforeach foreach t : internal_tests + deps = [libcamera_private] + if t.length() > 2 + deps += t[2] + endif + exe = executable(t[0], t[1], - dependencies : libcamera_private, + dependencies : deps, link_with : test_libraries, include_directories : test_includes_internal) @@ -83,8 +93,13 @@ foreach t : internal_tests endforeach foreach t : internal_non_parallel_tests + deps = [libcamera_private] + if t.length() > 2 + deps += t[2] + endif + exe = executable(t[0], t[1], - dependencies : libcamera_private, + dependencies : deps, link_with : test_libraries, include_directories : test_includes_internal)