[{"id":25301,"web_url":"https://patchwork.libcamera.org/comment/25301/","msgid":"<CAEmqJPrBVP20-QTX=MrjSEyGouhSx20=jrG9WpORGTvgoFwoxQ@mail.gmail.com>","date":"2022-10-05T11:27:33","subject":"Re: [libcamera-devel] [PATCH] test: threads: Fix link failure due\n\tto missing dependency","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/people/34/","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"content":"Hi Laurent,\n\nThank you for the fix!\n\n\nOn Wed, 5 Oct 2022 at 11:56, Laurent Pinchart <\nlaurent.pinchart@ideasonboard.com> wrote:\n\n> Commit 036d26d6677e (\"test: threads: Test thread cleanup upon abnormal\n> termination\") added calls to functions provided by the pthread library\n> in the threads test, but didn't add the corresponding dependency. This\n> caused a link breakage on some platforms:\n>\n> /usr/bin/ld: test/threads.p/threads.cpp.o: undefined reference to symbol\n> 'pthread_cancel@@GLIBC_2.4'\n> /usr/bin/ld: /lib/arm-linux-gnueabihf/libpthread.so.0: error adding\n> symbols: DSO missing from command line\n> collect2: error: ld returned 1 exit status\n>\n> Fix it by adding the missing dependency.\n>\n> Fixes: 036d26d6677e (\"test: threads: Test thread cleanup upon abnormal\n> termination\")\n> Reported-by: Naushir Patuck <naush@raspberrypi.com>\n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n>\n\nReviewed-by: Naushir Patuck <naush@raspberrypi.com>\nTested-by: Naushir Patuck <naush@raspberrypi.com>\n\n---\n>  src/libcamera/base/meson.build |  2 +-\n>  src/libcamera/meson.build      |  1 +\n>  test/meson.build               | 23 +++++++++++++++++++----\n>  3 files changed, 21 insertions(+), 5 deletions(-)\n>\n> diff --git a/src/libcamera/base/meson.build\n> b/src/libcamera/base/meson.build\n> index 3b9d74efe935..7a75914ab2a8 100644\n> --- a/src/libcamera/base/meson.build\n> +++ b/src/libcamera/base/meson.build\n> @@ -38,9 +38,9 @@ if libunwind.found()\n>  endif\n>\n>  libcamera_base_deps = [\n> -    dependency('threads'),\n>      libatomic,\n>      libdw,\n> +    libthreads,\n>      libunwind,\n>  ]\n>\n> diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build\n> index 63b47b177fd2..7fcbb2ddc9e7 100644\n> --- a/src/libcamera/meson.build\n> +++ b/src/libcamera/meson.build\n> @@ -58,6 +58,7 @@ includes = [\n>  ]\n>\n>  libatomic = cc.find_library('atomic', required : false)\n> +libthreads = dependency('threads')\n>\n>  subdir('base')\n>  subdir('ipa')\n> diff --git a/test/meson.build b/test/meson.build\n> index 6cc778415dc8..9bf7bf34e796 100644\n> --- a/test/meson.build\n> +++ b/test/meson.build\n> @@ -51,7 +51,7 @@ internal_tests = [\n>      ['pixel-format',                    'pixel-format.cpp'],\n>      ['shared-fd',                       'shared-fd.cpp'],\n>      ['signal-threads',                  'signal-threads.cpp'],\n> -    ['threads',                         'threads.cpp'],\n> +    ['threads',                         'threads.cpp', [libthreads]],\n>      ['timer',                           'timer.cpp'],\n>      ['timer-thread',                    'timer-thread.cpp'],\n>      ['unique-fd',                       'unique-fd.cpp'],\n> @@ -65,8 +65,13 @@ internal_non_parallel_tests = [\n>  ]\n>\n>  foreach t : public_tests\n> +    deps = [libcamera_public]\n> +    if t.length() > 2\n> +        deps += t[2]\n> +    endif\n> +\n>      exe = executable(t[0], t[1],\n> -                     dependencies : libcamera_public,\n> +                     dependencies : deps,\n>                       link_with : test_libraries,\n>                       include_directories : test_includes_public)\n>\n> @@ -74,8 +79,13 @@ foreach t : public_tests\n>  endforeach\n>\n>  foreach t : internal_tests\n> +    deps = [libcamera_private]\n> +    if t.length() > 2\n> +        deps += t[2]\n> +    endif\n> +\n>      exe = executable(t[0], t[1],\n> -                     dependencies : libcamera_private,\n> +                     dependencies : deps,\n>                       link_with : test_libraries,\n>                       include_directories : test_includes_internal)\n>\n> @@ -83,8 +93,13 @@ foreach t : internal_tests\n>  endforeach\n>\n>  foreach t : internal_non_parallel_tests\n> +    deps = [libcamera_private]\n> +    if t.length() > 2\n> +        deps += t[2]\n> +    endif\n> +\n>      exe = executable(t[0], t[1],\n> -                     dependencies : libcamera_private,\n> +                     dependencies : deps,\n>                       link_with : test_libraries,\n>                       include_directories : test_includes_internal)\n>\n>\n> base-commit: 12f4708e35cde15ff9607d59eb053ece1b2bd081\n> --\n> Regards,\n>\n> Laurent Pinchart\n>\n>","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 272E1C0DA4\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  5 Oct 2022 11:27:52 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 7267A622EE;\n\tWed,  5 Oct 2022 13:27:51 +0200 (CEST)","from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com\n\t[IPv6:2a00:1450:4864:20::12f])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 3A3B6601C7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  5 Oct 2022 13:27:50 +0200 (CEST)","by mail-lf1-x12f.google.com with SMTP id 25so14834202lft.9\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 05 Oct 2022 04:27:50 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1664969271;\n\tbh=3cp2YZQ82scbebjf0iHldg4QDCkUcz8IA5xRBWEnrq8=;\n\th=References:In-Reply-To:Date:To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=N2p/gfev3ISoCCcxvYCGHOyfB1m10nBs9q3kofOS82VdtWHHCigjG4b879tDDGsaS\n\tLMZd8uQOR8FNMxBOIk1dwmpwhehHku1ZzNkDC8j9v0FNgrbiO7ZDsnmuBvdy5dUra8\n\txghcyogH5/Xs/5I40lnNmfYlnlVSKj5X9DAsHxQQJuJ5qtDvRgrwJmaOBA+aiIIjbA\n\tVhypvzV7WqXqihOqnCjN5I34rkDt/FKYEFt9Y6bPpgcnFKlcYoaLxbFqFZn/4Chibp\n\tGQxMvdMSjRHje1C5dh0Cj60fTiWZ90f62uAUcNtevoY9TgTs6gaN1WhBr7dJZXztcF\n\tqu0dS1C5/5zHw==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:from:to:cc:subject:date;\n\tbh=PY/B2Eq0IOrAYMCyc9SDJpCUWO6VVriYpmO8e79K/2Y=;\n\tb=TL0UzSoCLqJ0pf489UOzbzEgKOOeSkrtXhLlE6uWj1CijqGFAxOymzWJ0cmmPq7hG0\n\tL6cHoaiUzZ27Nn5o/YQUGW61SOcY4tnf2zs3kogh9mrYzgvAOoASy1S4CCYe/oct1ZET\n\tnr0BCCSE4O0DbB0xmy+ELFOabGXTXbuOuJ8DEBOnbTa3eaow7DDPOI3DTAr6JS0V+5mx\n\ts7d6PexHDtE+943m0ZeKOajLQaDc6ILx54w+gkwOvdkhKZ60oFi10PH8fVuaQXkbghwc\n\tLD7nK9ANmlhzeOaKj2JB/Mo9aluJYTY5Nw/ibY5bZpAi8NsJklw+801829Ywdsb68r9G\n\tQ5fw=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"TL0UzSoC\"; dkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:x-gm-message-state:from:to:cc:subject:date;\n\tbh=PY/B2Eq0IOrAYMCyc9SDJpCUWO6VVriYpmO8e79K/2Y=;\n\tb=3xm0Yxq/s8YayUFfAj/9radTN78l3kbvXTlKDVewykbbLgp3vIix3/gpPCfNr3K9en\n\tvdALUkg/Q/vvNsb7H9gejyu+QV/EgLNGHei3nnml4nMsLd5J7WZWG0uv6yVqhgt1xlPY\n\tNYkDRDKMd98LIZp64SynKSXvXoU8gG0aQUiAS9Ms2ZtaNuFY4jqJ2s1sSCKWYQ2blLBb\n\t997n95rpdh1AN+kepZtYMKvAl+WGW3Rp/WKitgVWbL32MfSHBfgr9b/fBoCbpg44Ra/x\n\tP0DmM32uftDvsDzTJJR+2aOgbHa/FDpO9au5TdKycxcmPLMo8E95n23r1QjT0T2n4Dgx\n\tPmxg==","X-Gm-Message-State":"ACrzQf3PJ2urQ6t/XXhD1SpVeFDIFcL2/6/tTYGcWUKcej2cN+OchoQp\n\tndLyY8/rHQFgDQ8Bl/3HW1BUWiXdzcq4H5q7kFoQUV2KvfdjCQ==","X-Google-Smtp-Source":"AMsMyM5qGVZ6lr32pfwA6YqHhccPCVfAmGy3n8KSBRwrbNOciuxiOGYmlMFgySzxf34g1Nt67mH8+b0PgMFLDusnvKY=","X-Received":"by 2002:a05:6512:3409:b0:499:faa6:edb0 with SMTP id\n\ti9-20020a056512340900b00499faa6edb0mr9949642lfr.682.1664969269499;\n\tWed, 05 Oct 2022 04:27:49 -0700 (PDT)","MIME-Version":"1.0","References":"<20221005105621.9658-1-laurent.pinchart@ideasonboard.com>","In-Reply-To":"<20221005105621.9658-1-laurent.pinchart@ideasonboard.com>","Date":"Wed, 5 Oct 2022 12:27:33 +0100","Message-ID":"<CAEmqJPrBVP20-QTX=MrjSEyGouhSx20=jrG9WpORGTvgoFwoxQ@mail.gmail.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Content-Type":"multipart/alternative; boundary=\"000000000000deed0205ea47dd0c\"","Subject":"Re: [libcamera-devel] [PATCH] test: threads: Fix link failure due\n\tto missing dependency","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>","From":"Naushir Patuck via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Naushir Patuck <naush@raspberrypi.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":25302,"web_url":"https://patchwork.libcamera.org/comment/25302/","msgid":"<mailman.5.1664969351.871.libcamera-devel@lists.libcamera.org>","date":"2022-10-05T11:29:05","subject":"Re: [libcamera-devel] [PATCH] test: threads: Fix link failure due\n\tto missing dependency","submitter":{"id":121,"url":"https://patchwork.libcamera.org/api/people/121/","name":"Quentin Schulz","email":"quentin.schulz@theobroma-systems.com"},"content":"Hi Laurent,\n\nOn 10/5/22 12:56, Laurent Pinchart via libcamera-devel wrote:\n> Commit 036d26d6677e (\"test: threads: Test thread cleanup upon abnormal\n> termination\") added calls to functions provided by the pthread library\n> in the threads test, but didn't add the corresponding dependency. This\n> caused a link breakage on some platforms:\n> \n> /usr/bin/ld: test/threads.p/threads.cpp.o: undefined reference to symbol 'pthread_cancel@@GLIBC_2.4'\n> /usr/bin/ld: /lib/arm-linux-gnueabihf/libpthread.so.0: error adding symbols: DSO missing from command line\n> collect2: error: ld returned 1 exit status\n> \n> Fix it by adding the missing dependency.\n> \n\nShouldn't the README.rst be updated to add this hard dependency too?\n\nCheers,\nQuentin","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 51BAEBD16B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  5 Oct 2022 11:29:12 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 0B7D4622F1;\n\tWed,  5 Oct 2022 13:29:12 +0200 (CEST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1664969352;\n\tbh=D3zXV8Q5aRYU0cS92m06rE99M1vBzOP7Q2E5HV5CkoA=;\n\th=Date:To:References:In-Reply-To:List-Id:List-Post:From:\n\tList-Subscribe:List-Unsubscribe:List-Archive:Reply-To:List-Help:\n\tSubject:From;\n\tb=QysF4L+G/WZ33UB3bVuZo6rsq7qm7NYB0HFyOBCWb/lFZssmnTpHbNVkgNYM6qE9D\n\tWsaEk1pOb+yTOM/5FvnGI2SugT9fGtFgRsPLwaWSSa8g6bujahG22qUtafSRLrT3yY\n\tnGdS6hltKIE3ttiUUGA7+RJhEC1gzfj+LNGKR7XzZ5z663cLw7/dPxTYzH6eQQFZ1f\n\twDex8WF727aOInMyagi1l9EbOR4pa37585J32+bJbakqyVTBLT5eFHmMScKFkP8VD3\n\t95jFhRnNsoksO/s1Ab0JZUmiN5t/1BBQILYiOY7XN9mEb3ML9H0Cf6NpCoLb60txTh\n\tIKTF7BiNiPFXg==","Date":"Wed, 5 Oct 2022 13:29:05 +0200","To":"libcamera-devel@lists.libcamera.org","References":"<20221005105621.9658-1-laurent.pinchart@ideasonboard.com>","In-Reply-To":"<20221005105621.9658-1-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Message-ID":"<mailman.5.1664969351.871.libcamera-devel@lists.libcamera.org>","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","From":"Quentin Schulz via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Precedence":"list","X-Mailman-Version":"2.1.29","X-BeenThere":"libcamera-devel@lists.libcamera.org","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","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/>","Reply-To":"Quentin Schulz <quentin.schulz@theobroma-systems.com>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","Subject":"Re: [libcamera-devel] [PATCH] test: threads: Fix link failure due\n\tto missing dependency","Content-Type":"message/rfc822","Content-Disposition":"inline","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":25306,"web_url":"https://patchwork.libcamera.org/comment/25306/","msgid":"<Yz13AQDHApmxd3sn@pendragon.ideasonboard.com>","date":"2022-10-05T12:22:25","subject":"Re: [libcamera-devel] [PATCH] test: threads: Fix link failure due\n\tto missing dependency","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Quentin,\n\nOn Wed, Oct 05, 2022 at 01:29:05PM +0200, Quentin Schulz wrote:\n> On 10/5/22 12:56, Laurent Pinchart via libcamera-devel wrote:\n> > Commit 036d26d6677e (\"test: threads: Test thread cleanup upon abnormal\n> > termination\") added calls to functions provided by the pthread library\n> > in the threads test, but didn't add the corresponding dependency. This\n> > caused a link breakage on some platforms:\n> > \n> > /usr/bin/ld: test/threads.p/threads.cpp.o: undefined reference to symbol 'pthread_cancel@@GLIBC_2.4'\n> > /usr/bin/ld: /lib/arm-linux-gnueabihf/libpthread.so.0: error adding symbols: DSO missing from command line\n> > collect2: error: ld returned 1 exit status\n> > \n> > Fix it by adding the missing dependency.\n> \n> Shouldn't the README.rst be updated to add this hard dependency too?\n\nlibpthread is part of glibc these days, I think we can rely on that\nbeing present :-)","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 58E58BD16B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  5 Oct 2022 12:22:31 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 972326236A;\n\tWed,  5 Oct 2022 14:22:30 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 434AE601C7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  5 Oct 2022 14:22:29 +0200 (CEST)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 92D0A415;\n\tWed,  5 Oct 2022 14:22:28 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1664972550;\n\tbh=fnr6wb7+Xlza13V9mX3qCErWK+O0R50et0XV3O/7Ml0=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=bt9yIQ9SXlSlXi2hgcgHVnpfbKPhBs0cInpl8yPl9M6ECNnxkKVlQg8omOjbbCYte\n\thwOWSFyBidbElYB9C3iqnVZzZr7tGns1QetC0ZweY2QzJbEb+krRYuOqGwFG6uJ1B/\n\tGsEhOKrI5ZzWcgoqQhCZYdbkXiYm2v5Kw0LvgX117rK+Xq2lSImZdXOBT90IWIJFMn\n\t0TeOK8OG+y8v35NtDh3utgvxBGd/wCioUxK44wXmNBvD0bdbWEW2WY8eDR6pAFjddD\n\tk2fh4Kb31yVCOyJui3EmfwULbDxUJSq+ggdjQdKbGWxfVL3JaVJMzbJEdKfnUj4qkS\n\tPDseA0r/cpZZg==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1664972548;\n\tbh=fnr6wb7+Xlza13V9mX3qCErWK+O0R50et0XV3O/7Ml0=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=hIVTlc1HZO/PxrQ6MUsjorc5vAVq4C6+cpc9PFehzZ26mv5eHvMfCOsWZMWObff0Z\n\tTN8d/yhBQKIkKffYoZyCKI8CODFItShR90jug0S/Oi+bJeEfVgJc4wlIp23lf0V3zm\n\tHXpzH2PXl9x9dlG1bh1IQVWYiv5ZP/UOtuBlyhjU="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"hIVTlc1H\"; dkim-atps=neutral","Date":"Wed, 5 Oct 2022 15:22:25 +0300","To":"Quentin Schulz <quentin.schulz@theobroma-systems.com>","Message-ID":"<Yz13AQDHApmxd3sn@pendragon.ideasonboard.com>","References":"<20221005105621.9658-1-laurent.pinchart@ideasonboard.com>\n\t<3d4b2f10-dea4-f90b-7585-c4fad0258459@theobroma-systems.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<3d4b2f10-dea4-f90b-7585-c4fad0258459@theobroma-systems.com>","Subject":"Re: [libcamera-devel] [PATCH] test: threads: Fix link failure due\n\tto missing dependency","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>","From":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":25310,"web_url":"https://patchwork.libcamera.org/comment/25310/","msgid":"<20221005130216.7hrka652hh564qoe@uno.localdomain>","date":"2022-10-05T13:02:16","subject":"Re: [libcamera-devel] [PATCH] test: threads: Fix link failure due\n\tto missing dependency","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Hi Laurent\n\nOn Wed, Oct 05, 2022 at 01:56:21PM +0300, Laurent Pinchart via libcamera-devel wrote:\n> Commit 036d26d6677e (\"test: threads: Test thread cleanup upon abnormal\n> termination\") added calls to functions provided by the pthread library\n> in the threads test, but didn't add the corresponding dependency. This\n> caused a link breakage on some platforms:\n>\n> /usr/bin/ld: test/threads.p/threads.cpp.o: undefined reference to symbol 'pthread_cancel@@GLIBC_2.4'\n> /usr/bin/ld: /lib/arm-linux-gnueabihf/libpthread.so.0: error adding symbols: DSO missing from command line\n> collect2: error: ld returned 1 exit status\n>\n> Fix it by adding the missing dependency.\n>\n> Fixes: 036d26d6677e (\"test: threads: Test thread cleanup upon abnormal termination\")\n> Reported-by: Naushir Patuck <naush@raspberrypi.com>\n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> ---\n>  src/libcamera/base/meson.build |  2 +-\n>  src/libcamera/meson.build      |  1 +\n>  test/meson.build               | 23 +++++++++++++++++++----\n>  3 files changed, 21 insertions(+), 5 deletions(-)\n>\n> diff --git a/src/libcamera/base/meson.build b/src/libcamera/base/meson.build\n> index 3b9d74efe935..7a75914ab2a8 100644\n> --- a/src/libcamera/base/meson.build\n> +++ b/src/libcamera/base/meson.build\n> @@ -38,9 +38,9 @@ if libunwind.found()\n>  endif\n>\n>  libcamera_base_deps = [\n> -    dependency('threads'),\n>      libatomic,\n>      libdw,\n> +    libthreads,\n>      libunwind,\n>  ]\n>\n> diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build\n> index 63b47b177fd2..7fcbb2ddc9e7 100644\n> --- a/src/libcamera/meson.build\n> +++ b/src/libcamera/meson.build\n> @@ -58,6 +58,7 @@ includes = [\n>  ]\n>\n>  libatomic = cc.find_library('atomic', required : false)\n> +libthreads = dependency('threads')\n>\n>  subdir('base')\n>  subdir('ipa')\n> diff --git a/test/meson.build b/test/meson.build\n> index 6cc778415dc8..9bf7bf34e796 100644\n> --- a/test/meson.build\n> +++ b/test/meson.build\n> @@ -51,7 +51,7 @@ internal_tests = [\n>      ['pixel-format',                    'pixel-format.cpp'],\n>      ['shared-fd',                       'shared-fd.cpp'],\n>      ['signal-threads',                  'signal-threads.cpp'],\n> -    ['threads',                         'threads.cpp'],\n> +    ['threads',                         'threads.cpp', [libthreads]],\n>      ['timer',                           'timer.cpp'],\n>      ['timer-thread',                    'timer-thread.cpp'],\n>      ['unique-fd',                       'unique-fd.cpp'],\n> @@ -65,8 +65,13 @@ internal_non_parallel_tests = [\n>  ]\n>\n>  foreach t : public_tests\n> +    deps = [libcamera_public]\n> +    if t.length() > 2\n> +        deps += t[2]\n> +    endif\n> +\n\nThis seems very fragile.\nCan't we had libthreads to the list of test dependencies\nunconditionally ? Seems like it's something that should be easily\navailable everywhere, isn't it ?\n\n>      exe = executable(t[0], t[1],\n> -                     dependencies : libcamera_public,\n> +                     dependencies : deps,\n>                       link_with : test_libraries,\n>                       include_directories : test_includes_public)\n>\n> @@ -74,8 +79,13 @@ foreach t : public_tests\n>  endforeach\n>\n>  foreach t : internal_tests\n> +    deps = [libcamera_private]\n> +    if t.length() > 2\n> +        deps += t[2]\n> +    endif\n> +\n>      exe = executable(t[0], t[1],\n> -                     dependencies : libcamera_private,\n> +                     dependencies : deps,\n>                       link_with : test_libraries,\n>                       include_directories : test_includes_internal)\n>\n> @@ -83,8 +93,13 @@ foreach t : internal_tests\n>  endforeach\n>\n>  foreach t : internal_non_parallel_tests\n> +    deps = [libcamera_private]\n> +    if t.length() > 2\n> +        deps += t[2]\n> +    endif\n> +\n>      exe = executable(t[0], t[1],\n> -                     dependencies : libcamera_private,\n> +                     dependencies : deps,\n>                       link_with : test_libraries,\n>                       include_directories : test_includes_internal)\n>\n>\n> base-commit: 12f4708e35cde15ff9607d59eb053ece1b2bd081\n> --\n> Regards,\n>\n> Laurent Pinchart\n>","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 ECCC5C0DA4\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  5 Oct 2022 13:02:20 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 9B55F62379;\n\tWed,  5 Oct 2022 15:02:20 +0200 (CEST)","from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net\n\t[IPv6:2001:4b98:dc4:8::223])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 6041C601C7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  5 Oct 2022 15:02:19 +0200 (CEST)","(Authenticated sender: jacopo@jmondi.org)\n\tby mail.gandi.net (Postfix) with ESMTPSA id D38CB60017;\n\tWed,  5 Oct 2022 13:02:18 +0000 (UTC)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1664974940;\n\tbh=+T6Z1be29w+hPHMHf6C9DvR7+/ZX6xbYE7CVYM3T5KE=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=L8R0YeIVXjne0QGvw35OKCsR06yEHQV7rU4RTPvQpwQrIUjMdoruLvhanj31y2QKg\n\tPS+ODR4WLnfsLoArIGSAnXtvRXvuevX1BbXit+LUh+iiXpvntHGds6NvaCLAVg1yWc\n\t97N9ImVgJzPh+Ht5tT3IQ/tBbDbSHNzaivORjs0vnNkeQm+kuN5Y8tZnoBFJUXr1UV\n\t4YRCAOzpgMnn9jMLtRTbQn11CE28cdnmVjaKaLdRfJXZRakg2hZsYrcTMOUYrQKwzA\n\t9Xtwur/dVhHaCpPqk1uUWD8fVV1h771t61HV/UpktsnBArAe6udQpiaGAF9VYoyf6n\n\t4NuHbLjXnlOug==","Date":"Wed, 5 Oct 2022 15:02:16 +0200","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Message-ID":"<20221005130216.7hrka652hh564qoe@uno.localdomain>","References":"<20221005105621.9658-1-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20221005105621.9658-1-laurent.pinchart@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH] test: threads: Fix link failure due\n\tto missing dependency","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>","From":"Jacopo Mondi via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Jacopo Mondi <jacopo@jmondi.org>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":25313,"web_url":"https://patchwork.libcamera.org/comment/25313/","msgid":"<Yz2Nr7unSab+zkRt@pendragon.ideasonboard.com>","date":"2022-10-05T13:59:11","subject":"Re: [libcamera-devel] [PATCH] test: threads: Fix link failure due\n\tto missing dependency","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Jacopo,\n\nOn Wed, Oct 05, 2022 at 03:02:16PM +0200, Jacopo Mondi wrote:\n> On Wed, Oct 05, 2022 at 01:56:21PM +0300, Laurent Pinchart via libcamera-devel wrote:\n> > Commit 036d26d6677e (\"test: threads: Test thread cleanup upon abnormal\n> > termination\") added calls to functions provided by the pthread library\n> > in the threads test, but didn't add the corresponding dependency. This\n> > caused a link breakage on some platforms:\n> >\n> > /usr/bin/ld: test/threads.p/threads.cpp.o: undefined reference to symbol 'pthread_cancel@@GLIBC_2.4'\n> > /usr/bin/ld: /lib/arm-linux-gnueabihf/libpthread.so.0: error adding symbols: DSO missing from command line\n> > collect2: error: ld returned 1 exit status\n> >\n> > Fix it by adding the missing dependency.\n> >\n> > Fixes: 036d26d6677e (\"test: threads: Test thread cleanup upon abnormal termination\")\n> > Reported-by: Naushir Patuck <naush@raspberrypi.com>\n> > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> > ---\n> >  src/libcamera/base/meson.build |  2 +-\n> >  src/libcamera/meson.build      |  1 +\n> >  test/meson.build               | 23 +++++++++++++++++++----\n> >  3 files changed, 21 insertions(+), 5 deletions(-)\n> >\n> > diff --git a/src/libcamera/base/meson.build b/src/libcamera/base/meson.build\n> > index 3b9d74efe935..7a75914ab2a8 100644\n> > --- a/src/libcamera/base/meson.build\n> > +++ b/src/libcamera/base/meson.build\n> > @@ -38,9 +38,9 @@ if libunwind.found()\n> >  endif\n> >\n> >  libcamera_base_deps = [\n> > -    dependency('threads'),\n> >      libatomic,\n> >      libdw,\n> > +    libthreads,\n> >      libunwind,\n> >  ]\n> >\n> > diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build\n> > index 63b47b177fd2..7fcbb2ddc9e7 100644\n> > --- a/src/libcamera/meson.build\n> > +++ b/src/libcamera/meson.build\n> > @@ -58,6 +58,7 @@ includes = [\n> >  ]\n> >\n> >  libatomic = cc.find_library('atomic', required : false)\n> > +libthreads = dependency('threads')\n> >\n> >  subdir('base')\n> >  subdir('ipa')\n> > diff --git a/test/meson.build b/test/meson.build\n> > index 6cc778415dc8..9bf7bf34e796 100644\n> > --- a/test/meson.build\n> > +++ b/test/meson.build\n> > @@ -51,7 +51,7 @@ internal_tests = [\n> >      ['pixel-format',                    'pixel-format.cpp'],\n> >      ['shared-fd',                       'shared-fd.cpp'],\n> >      ['signal-threads',                  'signal-threads.cpp'],\n> > -    ['threads',                         'threads.cpp'],\n> > +    ['threads',                         'threads.cpp', [libthreads]],\n> >      ['timer',                           'timer.cpp'],\n> >      ['timer-thread',                    'timer-thread.cpp'],\n> >      ['unique-fd',                       'unique-fd.cpp'],\n> > @@ -65,8 +65,13 @@ internal_non_parallel_tests = [\n> >  ]\n> >\n> >  foreach t : public_tests\n> > +    deps = [libcamera_public]\n> > +    if t.length() > 2\n> > +        deps += t[2]\n> > +    endif\n> > +\n> \n> This seems very fragile.\n> Can't we had libthreads to the list of test dependencies\n> unconditionally ? Seems like it's something that should be easily\n> available everywhere, isn't it ?\n\nThe library will be there, but there's no need to link each test to it.\nThis patch also prepares for adding other dependencies to individual\ntests in the future. Of course one could argue that we shouldn't prepare\nfor something that is not guaranteed to be needed.\n\n> >      exe = executable(t[0], t[1],\n> > -                     dependencies : libcamera_public,\n> > +                     dependencies : deps,\n> >                       link_with : test_libraries,\n> >                       include_directories : test_includes_public)\n> >\n> > @@ -74,8 +79,13 @@ foreach t : public_tests\n> >  endforeach\n> >\n> >  foreach t : internal_tests\n> > +    deps = [libcamera_private]\n> > +    if t.length() > 2\n> > +        deps += t[2]\n> > +    endif\n> > +\n> >      exe = executable(t[0], t[1],\n> > -                     dependencies : libcamera_private,\n> > +                     dependencies : deps,\n> >                       link_with : test_libraries,\n> >                       include_directories : test_includes_internal)\n> >\n> > @@ -83,8 +93,13 @@ foreach t : internal_tests\n> >  endforeach\n> >\n> >  foreach t : internal_non_parallel_tests\n> > +    deps = [libcamera_private]\n> > +    if t.length() > 2\n> > +        deps += t[2]\n> > +    endif\n> > +\n> >      exe = executable(t[0], t[1],\n> > -                     dependencies : libcamera_private,\n> > +                     dependencies : deps,\n> >                       link_with : test_libraries,\n> >                       include_directories : test_includes_internal)\n> >\n> >\n> > base-commit: 12f4708e35cde15ff9607d59eb053ece1b2bd081","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 8C9BBBD16B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  5 Oct 2022 13:59:17 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id D2715601C7;\n\tWed,  5 Oct 2022 15:59:16 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 241BA601C7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  5 Oct 2022 15:59:15 +0200 (CEST)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 45108415;\n\tWed,  5 Oct 2022 15:59:14 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1664978356;\n\tbh=Z4kK60Ia4gBNfBsjItnGSLHe26QBPrMUEY00cPUSggQ=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=Hxpn47IOjVrn/gI2ZPgRfXTFVw9jYuM0rExcX1tUtOD4ITaVzOP9p9BdMLdANmgun\n\tIYxgctLwVsV0jR0NgPm/ccYYE2myg2tY9qF1aLCL8S407ZPCeemihF6tJF2UghCf8Y\n\tIcH4tIQaITlJxdL0D6E7XQMbItDTi/1zjBa4Ntj0pO/rw7LIK98msRD4GQTAWFAq/3\n\t7vLGhKxsu6K4bMO8ZabjMuvt+JJCFy0X9QQWrxle4qmM1UPyjV3ovmF0Se5MHGmlOD\n\tN6swrLM/58qVsOLAsaisukBzzd4+xH4DzVtZ8ses+KXa+EW0yxA2vKOwgwcsdbBKvX\n\tuiBBPIaAemVnQ==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1664978354;\n\tbh=Z4kK60Ia4gBNfBsjItnGSLHe26QBPrMUEY00cPUSggQ=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=WyQfor4SbElebPjSXC2bbUbm7qzg9mJg31cJZEHPGQtBB8JKPBoxGZFjDP2CjdDK4\n\tzKnb0eMnNJGkepBugdb+bN51sflGTS8UDDoj8yBqQf9T9y/b25+UtMt/opn5vEm7pJ\n\t8r/aXSlqgkCTEz30xUKSpf6c1CvEpI+1C0ORzIXI="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"WyQfor4S\"; dkim-atps=neutral","Date":"Wed, 5 Oct 2022 16:59:11 +0300","To":"Jacopo Mondi <jacopo@jmondi.org>","Message-ID":"<Yz2Nr7unSab+zkRt@pendragon.ideasonboard.com>","References":"<20221005105621.9658-1-laurent.pinchart@ideasonboard.com>\n\t<20221005130216.7hrka652hh564qoe@uno.localdomain>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20221005130216.7hrka652hh564qoe@uno.localdomain>","Subject":"Re: [libcamera-devel] [PATCH] test: threads: Fix link failure due\n\tto missing dependency","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>","From":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":25314,"web_url":"https://patchwork.libcamera.org/comment/25314/","msgid":"<b66aebf0-917c-0991-3a1d-bdea0d60a324@ideasonboard.com>","date":"2022-10-05T14:00:37","subject":"Re: [libcamera-devel] [PATCH] test: threads: Fix link failure due\n\tto missing dependency","submitter":{"id":86,"url":"https://patchwork.libcamera.org/api/people/86/","name":"Umang Jain","email":"umang.jain@ideasonboard.com"},"content":"Hi\n\nOn 10/5/22 6:32 PM, Jacopo Mondi via libcamera-devel wrote:\n> Hi Laurent\n>\n> On Wed, Oct 05, 2022 at 01:56:21PM +0300, Laurent Pinchart via libcamera-devel wrote:\n>> Commit 036d26d6677e (\"test: threads: Test thread cleanup upon abnormal\n>> termination\") added calls to functions provided by the pthread library\n>> in the threads test, but didn't add the corresponding dependency. This\n>> caused a link breakage on some platforms:\n>>\n>> /usr/bin/ld: test/threads.p/threads.cpp.o: undefined reference to symbol 'pthread_cancel@@GLIBC_2.4'\n>> /usr/bin/ld: /lib/arm-linux-gnueabihf/libpthread.so.0: error adding symbols: DSO missing from command line\n>> collect2: error: ld returned 1 exit status\n>>\n>> Fix it by adding the missing dependency.\n>>\n>> Fixes: 036d26d6677e (\"test: threads: Test thread cleanup upon abnormal termination\")\n>> Reported-by: Naushir Patuck <naush@raspberrypi.com>\n>> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n>> ---\n>>   src/libcamera/base/meson.build |  2 +-\n>>   src/libcamera/meson.build      |  1 +\n>>   test/meson.build               | 23 +++++++++++++++++++----\n>>   3 files changed, 21 insertions(+), 5 deletions(-)\n>>\n>> diff --git a/src/libcamera/base/meson.build b/src/libcamera/base/meson.build\n>> index 3b9d74efe935..7a75914ab2a8 100644\n>> --- a/src/libcamera/base/meson.build\n>> +++ b/src/libcamera/base/meson.build\n>> @@ -38,9 +38,9 @@ if libunwind.found()\n>>   endif\n>>\n>>   libcamera_base_deps = [\n>> -    dependency('threads'),\n>>       libatomic,\n>>       libdw,\n>> +    libthreads,\n>>       libunwind,\n>>   ]\n>>\n>> diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build\n>> index 63b47b177fd2..7fcbb2ddc9e7 100644\n>> --- a/src/libcamera/meson.build\n>> +++ b/src/libcamera/meson.build\n>> @@ -58,6 +58,7 @@ includes = [\n>>   ]\n>>\n>>   libatomic = cc.find_library('atomic', required : false)\n>> +libthreads = dependency('threads')\n>>\n>>   subdir('base')\n>>   subdir('ipa')\n>> diff --git a/test/meson.build b/test/meson.build\n>> index 6cc778415dc8..9bf7bf34e796 100644\n>> --- a/test/meson.build\n>> +++ b/test/meson.build\n>> @@ -51,7 +51,7 @@ internal_tests = [\n>>       ['pixel-format',                    'pixel-format.cpp'],\n>>       ['shared-fd',                       'shared-fd.cpp'],\n>>       ['signal-threads',                  'signal-threads.cpp'],\n>> -    ['threads',                         'threads.cpp'],\n>> +    ['threads',                         'threads.cpp', [libthreads]],\n>>       ['timer',                           'timer.cpp'],\n>>       ['timer-thread',                    'timer-thread.cpp'],\n>>       ['unique-fd',                       'unique-fd.cpp'],\n>> @@ -65,8 +65,13 @@ internal_non_parallel_tests = [\n>>   ]\n>>\n>>   foreach t : public_tests\n>> +    deps = [libcamera_public]\n>> +    if t.length() > 2\n>> +        deps += t[2]\n>> +    endif\n>> +\n> This seems very fragile.\n> Can't we had libthreads to the list of test dependencies\n> unconditionally ? Seems like it's something that should be easily\n> available everywhere, isn't it ?\n\nI tend with agree with Jacopo here. It would be better if libthreads is \npart of test dependencies.\n\nI am not even sure if per-test dependency for the test-suite makes sense \nor not. Since, if someone is running the test suite, they are mostly \ninterested in the entire suite run (for e.g. distros)  rather than \nindividual tests?\n>\n>>       exe = executable(t[0], t[1],\n>> -                     dependencies : libcamera_public,\n>> +                     dependencies : deps,\n>>                        link_with : test_libraries,\n>>                        include_directories : test_includes_public)\n>>\n>> @@ -74,8 +79,13 @@ foreach t : public_tests\n>>   endforeach\n>>\n>>   foreach t : internal_tests\n>> +    deps = [libcamera_private]\n>> +    if t.length() > 2\n>> +        deps += t[2]\n>> +    endif\n>> +\n>>       exe = executable(t[0], t[1],\n>> -                     dependencies : libcamera_private,\n>> +                     dependencies : deps,\n>>                        link_with : test_libraries,\n>>                        include_directories : test_includes_internal)\n>>\n>> @@ -83,8 +93,13 @@ foreach t : internal_tests\n>>   endforeach\n>>\n>>   foreach t : internal_non_parallel_tests\n>> +    deps = [libcamera_private]\n>> +    if t.length() > 2\n>> +        deps += t[2]\n>> +    endif\n>> +\n>>       exe = executable(t[0], t[1],\n>> -                     dependencies : libcamera_private,\n>> +                     dependencies : deps,\n>>                        link_with : test_libraries,\n>>                        include_directories : test_includes_internal)\n>>\n>>\n>> base-commit: 12f4708e35cde15ff9607d59eb053ece1b2bd081\n>> --\n>> Regards,\n>>\n>> Laurent Pinchart\n>>","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 BC4B4BD16B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  5 Oct 2022 14:00:45 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 74D0B62851;\n\tWed,  5 Oct 2022 16:00:45 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 01CF3601C7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  5 Oct 2022 16:00:44 +0200 (CEST)","from [192.168.1.103] (unknown [103.86.18.245])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 98B23415;\n\tWed,  5 Oct 2022 16:00:42 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1664978445;\n\tbh=NjgPd9+ouCj2nqnP5MvwRP90uTBP+NNUdiHnWkpqp8k=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=yp4K+G1EAjjp0aAWD/+4gEtD09b4lGkCRxzfrPu9Gl7aNCQynbuaSnqRd7Vqk7R3G\n\tmkUAuOMLuJSgC2/PDuVETQvWXJQNRvLZqqheVTFl/5xjqabBPJL5yncuIuomYGYc89\n\tpo5zhhX8AYytb6B2Nr2vj8+nj1VCRhMreuNssLnUT3IIBlcCbXAGZSIfoRt/0SyDfM\n\trT2bOqNGqaB95bsfnd/cs0C4zZPR1tC2ocB+9rXhst1mIo4sS2t1VjLjNMO0rl69YP\n\tfwWxhQbiB9UPVgoEHbj997Ln+BzsWOlE3DGe9gISUhkGLS1Uom7PZjqpge0Vqqkk0D\n\tzTdcUW+L+k+Hw==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1664978443;\n\tbh=NjgPd9+ouCj2nqnP5MvwRP90uTBP+NNUdiHnWkpqp8k=;\n\th=Date:Subject:To:Cc:References:From:In-Reply-To:From;\n\tb=jFn3VD4UkhXb9ZU6cropdxqopr6GxtHebhIiQRyR+T5GZeeNBU3dLbtv9hqdQcSLY\n\tR/3QYWnV1LeatboPTp46Gf/jPbIP0GxtxAWPea+Vmlz7fG2FtKghm+wUJTdtq9cgfy\n\tS0oorRdbhT8iXX1Kbk1sFaWJ5ADAOKVTvcjNZf54="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"jFn3VD4U\"; dkim-atps=neutral","Message-ID":"<b66aebf0-917c-0991-3a1d-bdea0d60a324@ideasonboard.com>","Date":"Wed, 5 Oct 2022 19:30:37 +0530","MIME-Version":"1.0","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101\n\tThunderbird/102.2.1","To":"Jacopo Mondi <jacopo@jmondi.org>,\n\tLaurent Pinchart <laurent.pinchart@ideasonboard.com>","References":"<20221005105621.9658-1-laurent.pinchart@ideasonboard.com>\n\t<20221005130216.7hrka652hh564qoe@uno.localdomain>","Content-Language":"en-US","In-Reply-To":"<20221005130216.7hrka652hh564qoe@uno.localdomain>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"8bit","Subject":"Re: [libcamera-devel] [PATCH] test: threads: Fix link failure due\n\tto missing dependency","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>","From":"Umang Jain via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Umang Jain <umang.jain@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":25315,"web_url":"https://patchwork.libcamera.org/comment/25315/","msgid":"<20221005172524.cq75aoexdj5mz5vz@uno.localdomain>","date":"2022-10-05T17:25:24","subject":"Re: [libcamera-devel] [PATCH] test: threads: Fix link failure due\n\tto missing dependency","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Hi Laurent\n\nOn Wed, Oct 05, 2022 at 04:59:11PM +0300, Laurent Pinchart wrote:\n> Hi Jacopo,\n>\n> On Wed, Oct 05, 2022 at 03:02:16PM +0200, Jacopo Mondi wrote:\n> > On Wed, Oct 05, 2022 at 01:56:21PM +0300, Laurent Pinchart via libcamera-devel wrote:\n> > > Commit 036d26d6677e (\"test: threads: Test thread cleanup upon abnormal\n> > > termination\") added calls to functions provided by the pthread library\n> > > in the threads test, but didn't add the corresponding dependency. This\n> > > caused a link breakage on some platforms:\n> > >\n> > > /usr/bin/ld: test/threads.p/threads.cpp.o: undefined reference to symbol 'pthread_cancel@@GLIBC_2.4'\n> > > /usr/bin/ld: /lib/arm-linux-gnueabihf/libpthread.so.0: error adding symbols: DSO missing from command line\n> > > collect2: error: ld returned 1 exit status\n> > >\n> > > Fix it by adding the missing dependency.\n> > >\n> > > Fixes: 036d26d6677e (\"test: threads: Test thread cleanup upon abnormal termination\")\n> > > Reported-by: Naushir Patuck <naush@raspberrypi.com>\n> > > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> > > ---\n> > >  src/libcamera/base/meson.build |  2 +-\n> > >  src/libcamera/meson.build      |  1 +\n> > >  test/meson.build               | 23 +++++++++++++++++++----\n> > >  3 files changed, 21 insertions(+), 5 deletions(-)\n> > >\n> > > diff --git a/src/libcamera/base/meson.build b/src/libcamera/base/meson.build\n> > > index 3b9d74efe935..7a75914ab2a8 100644\n> > > --- a/src/libcamera/base/meson.build\n> > > +++ b/src/libcamera/base/meson.build\n> > > @@ -38,9 +38,9 @@ if libunwind.found()\n> > >  endif\n> > >\n> > >  libcamera_base_deps = [\n> > > -    dependency('threads'),\n> > >      libatomic,\n> > >      libdw,\n> > > +    libthreads,\n> > >      libunwind,\n> > >  ]\n> > >\n> > > diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build\n> > > index 63b47b177fd2..7fcbb2ddc9e7 100644\n> > > --- a/src/libcamera/meson.build\n> > > +++ b/src/libcamera/meson.build\n> > > @@ -58,6 +58,7 @@ includes = [\n> > >  ]\n> > >\n> > >  libatomic = cc.find_library('atomic', required : false)\n> > > +libthreads = dependency('threads')\n> > >\n> > >  subdir('base')\n> > >  subdir('ipa')\n> > > diff --git a/test/meson.build b/test/meson.build\n> > > index 6cc778415dc8..9bf7bf34e796 100644\n> > > --- a/test/meson.build\n> > > +++ b/test/meson.build\n> > > @@ -51,7 +51,7 @@ internal_tests = [\n> > >      ['pixel-format',                    'pixel-format.cpp'],\n> > >      ['shared-fd',                       'shared-fd.cpp'],\n> > >      ['signal-threads',                  'signal-threads.cpp'],\n> > > -    ['threads',                         'threads.cpp'],\n> > > +    ['threads',                         'threads.cpp', [libthreads]],\n> > >      ['timer',                           'timer.cpp'],\n> > >      ['timer-thread',                    'timer-thread.cpp'],\n> > >      ['unique-fd',                       'unique-fd.cpp'],\n> > > @@ -65,8 +65,13 @@ internal_non_parallel_tests = [\n> > >  ]\n> > >\n> > >  foreach t : public_tests\n> > > +    deps = [libcamera_public]\n> > > +    if t.length() > 2\n> > > +        deps += t[2]\n> > > +    endif\n> > > +\n> >\n> > This seems very fragile.\n> > Can't we had libthreads to the list of test dependencies\n> > unconditionally ? Seems like it's something that should be easily\n> > available everywhere, isn't it ?\n>\n> The library will be there, but there's no need to link each test to it.\n\nYou're right, even if we're talking about tests, and -lpthread is\ncertainly not the biggest dependency we have.\n\n> This patch also prepares for adding other dependencies to individual\n> tests in the future. Of course one could argue that we shouldn't prepare\n> for something that is not guaranteed to be needed.\n>\n\nAs discussed, moving to a dictionary would make this look less bad,\nbut for now\nAcked-by: Jacopo Mondi <jacopo@jmondi.org>\n\n> > >      exe = executable(t[0], t[1],\n> > > -                     dependencies : libcamera_public,\n> > > +                     dependencies : deps,\n> > >                       link_with : test_libraries,\n> > >                       include_directories : test_includes_public)\n> > >\n> > > @@ -74,8 +79,13 @@ foreach t : public_tests\n> > >  endforeach\n> > >\n> > >  foreach t : internal_tests\n> > > +    deps = [libcamera_private]\n> > > +    if t.length() > 2\n> > > +        deps += t[2]\n> > > +    endif\n> > > +\n> > >      exe = executable(t[0], t[1],\n> > > -                     dependencies : libcamera_private,\n> > > +                     dependencies : deps,\n> > >                       link_with : test_libraries,\n> > >                       include_directories : test_includes_internal)\n> > >\n> > > @@ -83,8 +93,13 @@ foreach t : internal_tests\n> > >  endforeach\n> > >\n> > >  foreach t : internal_non_parallel_tests\n> > > +    deps = [libcamera_private]\n> > > +    if t.length() > 2\n> > > +        deps += t[2]\n> > > +    endif\n> > > +\n> > >      exe = executable(t[0], t[1],\n> > > -                     dependencies : libcamera_private,\n> > > +                     dependencies : deps,\n> > >                       link_with : test_libraries,\n> > >                       include_directories : test_includes_internal)\n> > >\n> > >\n> > > base-commit: 12f4708e35cde15ff9607d59eb053ece1b2bd081\n>\n> --\n> Regards,\n>\n> Laurent Pinchart","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 09D7CBD16B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  5 Oct 2022 17:25:29 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 64E5D62CB1;\n\tWed,  5 Oct 2022 19:25:28 +0200 (CEST)","from relay11.mail.gandi.net (relay11.mail.gandi.net\n\t[217.70.178.231])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C3B5C601C7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  5 Oct 2022 19:25:26 +0200 (CEST)","(Authenticated sender: jacopo@jmondi.org)\n\tby mail.gandi.net (Postfix) with ESMTPSA id 35709100006;\n\tWed,  5 Oct 2022 17:25:25 +0000 (UTC)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1664990728;\n\tbh=00a/JuqUEGHc6m0HrwEqRvnpubWNOFDERo39nyEKq7c=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=KuEfpehmyK4ZXUrv0WfvYFMnnhOjyyFwcVqIPONbGx+QH28Jtn1mrV6GR+mnHvGpA\n\tzOU2O1cGyUWNuTma2lc0oZYEHqnG01495LIh7S5yQH3+q30HuKx0CvZQhdHOorzDJJ\n\t01QBGMgp4xQM+3zJrjIe3KVX/PuLibkEynH7LCVc1P7H7olDmYLanJsc0oG8PaSwc2\n\toG2gAp0JQXJcIgv02HFI+oG384X/LWGDu+8sdSY5yqMXN2KzBvbvwbwULKeJFo1JcJ\n\tXA+cll+c94Wkldpr6unG4YeaUT9KL3GivfA0YLP0eNXhLmRQSQ5QXIIVSFFRPsS4iw\n\tFAJuJUBxwTpsA==","Date":"Wed, 5 Oct 2022 19:25:24 +0200","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Message-ID":"<20221005172524.cq75aoexdj5mz5vz@uno.localdomain>","References":"<20221005105621.9658-1-laurent.pinchart@ideasonboard.com>\n\t<20221005130216.7hrka652hh564qoe@uno.localdomain>\n\t<Yz2Nr7unSab+zkRt@pendragon.ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<Yz2Nr7unSab+zkRt@pendragon.ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH] test: threads: Fix link failure due\n\tto missing dependency","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>","From":"Jacopo Mondi via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Jacopo Mondi <jacopo@jmondi.org>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]