From patchwork Wed Oct 5 15:40:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 17530 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 1D617C0DA4 for ; Wed, 5 Oct 2022 15:40:49 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 5C65862CB1; Wed, 5 Oct 2022 17:40:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1664984448; bh=YnZ6kHfxbrNtbGZ0j+Xyq9uzML3/5k3QhtvjNtva3qs=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=oEPy3Byss8fbpr/hLSVp724OImYAIbrpvbhLSM6IZ4fO77RoFf0m3keO1cZcIR1oM rTtopobnLmqkOSGLMLNzpRNnwiTK3W0fPWI/zsUz1HV+stW+bsW+oCUIl/ykmsFcQm vWmjAXDmeBvKpvkwB4MVfhHpMWwukW3ppzKjm+zVxNFkLqo0Icw4WvoxVM9nvVBLJ1 in6Gr0HiT9NbWFgUEotZ3/tcTzDnZw+FhzEod0gKL0T1qRVRWkZNFE7eRdDNNZBbmV Z6IN43ASxBx5JPQnHlsjckSU1B7lebs35f0EBBLfUSzoF5ANoyv/Pp+EuPkuL557HA qq0d5JOqFTElA== 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 892D6601C7 for ; Wed, 5 Oct 2022 17:40:46 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="quFfWRLV"; 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 D3F24415; Wed, 5 Oct 2022 17:40:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1664984446; bh=YnZ6kHfxbrNtbGZ0j+Xyq9uzML3/5k3QhtvjNtva3qs=; h=From:To:Cc:Subject:Date:From; b=quFfWRLVlaFIgvYWi7mCHuXnL8+7nr0eshQ8VeuCW73UKlsb5E+wKCbsr8oBZU+pj YjGscN0xffmWR4TgS7o/qbMOQihU5mEcR5j3qJYdVptxZbhE14U7/3rp2LKkCs6vE5 vnWUrBm50OdJo9Cgs27kqK055ApoMLwNsc11dPdw= To: libcamera-devel@lists.libcamera.org Date: Wed, 5 Oct 2022 18:40:42 +0300 Message-Id: <20221005154042.7302-1-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2] 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 The threads test binary needs to be linked with the pthread library. To keep meson.build simple, link all internal tests to pthread unconditionally. 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 Reviewed-by: Umang Jain --- By popular request, a simplified version. I personally think it's much more of a quick & dirty solution than v1, which I still prefer over v2. --- src/libcamera/base/meson.build | 2 +- src/libcamera/meson.build | 1 + test/meson.build | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) base-commit: 487989eec64aa9f57f39b3bdcf619a5d435efac6 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..f39f537035be 100644 --- a/test/meson.build +++ b/test/meson.build @@ -75,7 +75,7 @@ endforeach foreach t : internal_tests exe = executable(t[0], t[1], - dependencies : libcamera_private, + dependencies : [libcamera_private, libthreads], link_with : test_libraries, include_directories : test_includes_internal)