[{"id":37653,"web_url":"https://patchwork.libcamera.org/comment/37653/","msgid":"<20260114132035.GI30544@pendragon.ideasonboard.com>","date":"2026-01-14T13:20:35","subject":"Re: [libcamera-ci] [PATCH v1] Force libc++ with meson native files","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Barnabás,\n\nThank you for the patch.\n\nOn Mon, Jan 05, 2026 at 10:31:30AM +0100, Barnabás Pőcze wrote:\n> Currently libcamera's meson scripts force the usage of libc++ if clang\n> is detected as the compiler. This is not ideal because it cannot be\n> overridden by the user. So instead of depending on this behaviour\n> for libc++ testing, use meson native files to force the use of\n> libc++ with clang.\n> \n> Unfortunately on debian 13, due a meson bug, a workaround is needed\n> to avoid a macro redefinition error[0].\n> \n> [0]: https://github.com/mesonbuild/meson/issues/13812\n> \n> Link: https://gitlab.freedesktop.org/camera/libcamera/-/issues/226\n> Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\n> ---\n>  .gitlab-ci/meson/clang.native  | 3 +++\n>  .gitlab-ci/meson/libc++.native | 3 +++\n>  gitlab-ci.yml                  | 4 ++++\n>  3 files changed, 10 insertions(+)\n>  create mode 100644 .gitlab-ci/meson/clang.native\n>  create mode 100644 .gitlab-ci/meson/libc++.native\n> \n> diff --git a/.gitlab-ci/meson/clang.native b/.gitlab-ci/meson/clang.native\n> new file mode 100644\n> index 0000000..f00b0f0\n> --- /dev/null\n> +++ b/.gitlab-ci/meson/clang.native\n> @@ -0,0 +1,3 @@\n> +[binaries]\n> +c = ['clang']\n> +cpp = ['clang++']\n\nWhy is this needed ? We select the compiler through the CC and CXX\nenvironment variables.\n\n> diff --git a/.gitlab-ci/meson/libc++.native b/.gitlab-ci/meson/libc++.native\n> new file mode 100644\n> index 0000000..9c99d5a\n> --- /dev/null\n> +++ b/.gitlab-ci/meson/libc++.native\n> @@ -0,0 +1,3 @@\n> +[built-in options]\n> +cpp_args = ['-stdlib=libc++']\n> +cpp_link_args = ['-stdlib=libc++']\n> diff --git a/gitlab-ci.yml b/gitlab-ci.yml\n> index 262d519..2e2c4c9 100644\n> --- a/gitlab-ci.yml\n> +++ b/gitlab-ci.yml\n> @@ -30,6 +30,8 @@ variables:\n>    # clang fails to link with ASan if --no-undefined is enabled.\n>    MESON_CLANG_OPTIONS: >-\n>      -D b_lundef=false\n> +    --native-file $CI_PROJECT_DIR/.gitlab-ci/meson/clang.native\n> +    --native-file $CI_PROJECT_DIR/.gitlab-ci/meson/libc++.native\n>    PACKAGES: >-\n>      ca-certificates\n>      git\n> @@ -322,6 +324,8 @@ build-full:debian:13:\n>            ${MESON_ALL_OPTIONS}\n>            ${MESON_CLANG_OPTIONS}\n>            -D qcam=disabled\n> +          -D cpp_debugstl=false\n> +        # `cpp_debugstl=false` needed due to https://github.com/mesonbuild/meson/issues/13812\n\nIt would be nice to list the affected meson versions:\n\n          # Work around a bug in meson prior to 1.10.0, see\n\t  # https://github.com/mesonbuild/meson/issues/13812\n          -D cpp_debugstl=false\n\n(also moving the comment above the line to avoid mentioning the option\nname).\n\n> \n>  build-full:arch:\n>    extends:","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 D5A47BDCBF\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 14 Jan 2026 13:20:56 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 3515F61FBC;\n\tWed, 14 Jan 2026 14:20:56 +0100 (CET)","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 ADCE161F9F\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 14 Jan 2026 14:20:55 +0100 (CET)","from pendragon.ideasonboard.com (81-175-209-152.bb.dnainternet.fi\n\t[81.175.209.152])\n\tby perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id BC6B6316;\n\tWed, 14 Jan 2026 14:20:28 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"e64qEm5Y\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1768396828;\n\tbh=xNEmV2yHK4iKVRZTZh/siD5ul9CIVo4x+gVXXSAsD+o=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=e64qEm5YKEEv/ffnr1fVZPCEkB0o5gqKXK/3FSDcghEL+yyF6B+bKS649WzuC7mPM\n\tyVVjVXWIllUeATXyfAih8JXDn8jWG7cdTGLGnHRUp4ghURwcLNojtG+cet4vztjdh1\n\tIB9GK3FX3h3zza2osYxk+1c2XB0fnLKic32W1n3o=","Date":"Wed, 14 Jan 2026 15:20:35 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Subject":"Re: [libcamera-ci] [PATCH v1] Force libc++ with meson native files","Message-ID":"<20260114132035.GI30544@pendragon.ideasonboard.com>","References":"<20260105093130.1177121-1-barnabas.pocze@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20260105093130.1177121-1-barnabas.pocze@ideasonboard.com>","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":37655,"web_url":"https://patchwork.libcamera.org/comment/37655/","msgid":"<7e301fbe-3a78-4d05-b3f5-eef3b155b861@ideasonboard.com>","date":"2026-01-14T13:30:44","subject":"Re: [libcamera-ci] [PATCH v1] Force libc++ with meson native files","submitter":{"id":216,"url":"https://patchwork.libcamera.org/api/people/216/","name":"Barnabás Pőcze","email":"barnabas.pocze@ideasonboard.com"},"content":"2026. 01. 14. 14:20 keltezéssel, Laurent Pinchart írta:\n> Hi Barnabás,\n> \n> Thank you for the patch.\n> \n> On Mon, Jan 05, 2026 at 10:31:30AM +0100, Barnabás Pőcze wrote:\n>> Currently libcamera's meson scripts force the usage of libc++ if clang\n>> is detected as the compiler. This is not ideal because it cannot be\n>> overridden by the user. So instead of depending on this behaviour\n>> for libc++ testing, use meson native files to force the use of\n>> libc++ with clang.\n>>\n>> Unfortunately on debian 13, due a meson bug, a workaround is needed\n>> to avoid a macro redefinition error[0].\n>>\n>> [0]: https://github.com/mesonbuild/meson/issues/13812\n>>\n>> Link: https://gitlab.freedesktop.org/camera/libcamera/-/issues/226\n>> Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\n>> ---\n>>   .gitlab-ci/meson/clang.native  | 3 +++\n>>   .gitlab-ci/meson/libc++.native | 3 +++\n>>   gitlab-ci.yml                  | 4 ++++\n>>   3 files changed, 10 insertions(+)\n>>   create mode 100644 .gitlab-ci/meson/clang.native\n>>   create mode 100644 .gitlab-ci/meson/libc++.native\n>>\n>> diff --git a/.gitlab-ci/meson/clang.native b/.gitlab-ci/meson/clang.native\n>> new file mode 100644\n>> index 0000000..f00b0f0\n>> --- /dev/null\n>> +++ b/.gitlab-ci/meson/clang.native\n>> @@ -0,0 +1,3 @@\n>> +[binaries]\n>> +c = ['clang']\n>> +cpp = ['clang++']\n> \n> Why is this needed ? We select the compiler through the CC and CXX\n> environment variables.\n\nTrue, I suppose it's not actually needed.\n\n\n> \n>> diff --git a/.gitlab-ci/meson/libc++.native b/.gitlab-ci/meson/libc++.native\n>> new file mode 100644\n>> index 0000000..9c99d5a\n>> --- /dev/null\n>> +++ b/.gitlab-ci/meson/libc++.native\n>> @@ -0,0 +1,3 @@\n>> +[built-in options]\n>> +cpp_args = ['-stdlib=libc++']\n>> +cpp_link_args = ['-stdlib=libc++']\n>> diff --git a/gitlab-ci.yml b/gitlab-ci.yml\n>> index 262d519..2e2c4c9 100644\n>> --- a/gitlab-ci.yml\n>> +++ b/gitlab-ci.yml\n>> @@ -30,6 +30,8 @@ variables:\n>>     # clang fails to link with ASan if --no-undefined is enabled.\n>>     MESON_CLANG_OPTIONS: >-\n>>       -D b_lundef=false\n>> +    --native-file $CI_PROJECT_DIR/.gitlab-ci/meson/clang.native\n>> +    --native-file $CI_PROJECT_DIR/.gitlab-ci/meson/libc++.native\n>>     PACKAGES: >-\n>>       ca-certificates\n>>       git\n>> @@ -322,6 +324,8 @@ build-full:debian:13:\n>>             ${MESON_ALL_OPTIONS}\n>>             ${MESON_CLANG_OPTIONS}\n>>             -D qcam=disabled\n>> +          -D cpp_debugstl=false\n>> +        # `cpp_debugstl=false` needed due to https://github.com/mesonbuild/meson/issues/13812\n> \n> It would be nice to list the affected meson versions:\n> \n>            # Work around a bug in meson prior to 1.10.0, see\n\nI think it will also be released in 1.9.3.\n\n\n> \t  # https://github.com/mesonbuild/meson/issues/13812\n>            -D cpp_debugstl=false\n> \n> (also moving the comment above the line to avoid mentioning the option\n> name).\n\nYAML does not accept that, so I think it has to be either before or after\n`MESON_OPTIONS`, but it cannot be in the string itself.\n\n> \n>>\n>>   build-full:arch:\n>>     extends:\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 C8CE6C3226\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 14 Jan 2026 13:30:48 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 4087561FBC;\n\tWed, 14 Jan 2026 14:30:48 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 6899761F9F\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 14 Jan 2026 14:30:47 +0100 (CET)","from [192.168.33.18] (185.221.143.114.nat.pool.zt.hu\n\t[185.221.143.114])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 96CA9316;\n\tWed, 14 Jan 2026 14:30:20 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"GMu18dbN\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1768397420;\n\tbh=Obrtn8qJcUnlPGN0PLjEV1Vqun7omXex1YUka7WWRIc=;\n\th=Date:Subject:To:Cc:References:From:In-Reply-To:From;\n\tb=GMu18dbNFK34xQ4NXIjh+2G23Uo9uHeaVCrYBw5oxe3jRlf9KFD9bhTE1BFDlcuQb\n\tVT2/3rA4FTkFG5rKif/10u/gqOBRd+QGDTdo+mFPgaV/d5oQvrQNB7F7RUZkIAV/4U\n\tmwFwTpphxi24M7HeOrB5OzXLgHE+dKsvSucSAFsE=","Message-ID":"<7e301fbe-3a78-4d05-b3f5-eef3b155b861@ideasonboard.com>","Date":"Wed, 14 Jan 2026 14:30:44 +0100","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [libcamera-ci] [PATCH v1] Force libc++ with meson native files","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","References":"<20260105093130.1177121-1-barnabas.pocze@ideasonboard.com>\n\t<20260114132035.GI30544@pendragon.ideasonboard.com>","From":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Content-Language":"en-US, hu-HU","In-Reply-To":"<20260114132035.GI30544@pendragon.ideasonboard.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"8bit","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":37656,"web_url":"https://patchwork.libcamera.org/comment/37656/","msgid":"<20260114134116.GK30544@pendragon.ideasonboard.com>","date":"2026-01-14T13:41:16","subject":"Re: [libcamera-ci] [PATCH v1] Force libc++ with meson native files","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Wed, Jan 14, 2026 at 02:30:44PM +0100, Barnabás Pőcze wrote:\n> 2026. 01. 14. 14:20 keltezéssel, Laurent Pinchart írta:\n> > On Mon, Jan 05, 2026 at 10:31:30AM +0100, Barnabás Pőcze wrote:\n> >> Currently libcamera's meson scripts force the usage of libc++ if clang\n> >> is detected as the compiler. This is not ideal because it cannot be\n> >> overridden by the user. So instead of depending on this behaviour\n> >> for libc++ testing, use meson native files to force the use of\n> >> libc++ with clang.\n> >>\n> >> Unfortunately on debian 13, due a meson bug, a workaround is needed\n> >> to avoid a macro redefinition error[0].\n> >>\n> >> [0]: https://github.com/mesonbuild/meson/issues/13812\n> >>\n> >> Link: https://gitlab.freedesktop.org/camera/libcamera/-/issues/226\n> >> Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\n> >> ---\n> >>   .gitlab-ci/meson/clang.native  | 3 +++\n> >>   .gitlab-ci/meson/libc++.native | 3 +++\n> >>   gitlab-ci.yml                  | 4 ++++\n> >>   3 files changed, 10 insertions(+)\n> >>   create mode 100644 .gitlab-ci/meson/clang.native\n> >>   create mode 100644 .gitlab-ci/meson/libc++.native\n> >>\n> >> diff --git a/.gitlab-ci/meson/clang.native b/.gitlab-ci/meson/clang.native\n> >> new file mode 100644\n> >> index 0000000..f00b0f0\n> >> --- /dev/null\n> >> +++ b/.gitlab-ci/meson/clang.native\n> >> @@ -0,0 +1,3 @@\n> >> +[binaries]\n> >> +c = ['clang']\n> >> +cpp = ['clang++']\n> > \n> > Why is this needed ? We select the compiler through the CC and CXX\n> > environment variables.\n> \n> True, I suppose it's not actually needed.\n> \n> >> diff --git a/.gitlab-ci/meson/libc++.native b/.gitlab-ci/meson/libc++.native\n> >> new file mode 100644\n> >> index 0000000..9c99d5a\n> >> --- /dev/null\n> >> +++ b/.gitlab-ci/meson/libc++.native\n> >> @@ -0,0 +1,3 @@\n> >> +[built-in options]\n> >> +cpp_args = ['-stdlib=libc++']\n> >> +cpp_link_args = ['-stdlib=libc++']\n> >> diff --git a/gitlab-ci.yml b/gitlab-ci.yml\n> >> index 262d519..2e2c4c9 100644\n> >> --- a/gitlab-ci.yml\n> >> +++ b/gitlab-ci.yml\n> >> @@ -30,6 +30,8 @@ variables:\n> >>     # clang fails to link with ASan if --no-undefined is enabled.\n> >>     MESON_CLANG_OPTIONS: >-\n> >>       -D b_lundef=false\n> >> +    --native-file $CI_PROJECT_DIR/.gitlab-ci/meson/clang.native\n> >> +    --native-file $CI_PROJECT_DIR/.gitlab-ci/meson/libc++.native\n> >>     PACKAGES: >-\n> >>       ca-certificates\n> >>       git\n> >> @@ -322,6 +324,8 @@ build-full:debian:13:\n> >>             ${MESON_ALL_OPTIONS}\n> >>             ${MESON_CLANG_OPTIONS}\n> >>             -D qcam=disabled\n> >> +          -D cpp_debugstl=false\n> >> +        # `cpp_debugstl=false` needed due to https://github.com/mesonbuild/meson/issues/13812\n> > \n> > It would be nice to list the affected meson versions:\n> > \n> >            # Work around a bug in meson prior to 1.10.0, see\n> \n> I think it will also be released in 1.9.3.\n> \n> > \t  # https://github.com/mesonbuild/meson/issues/13812\n> >            -D cpp_debugstl=false\n> > \n> > (also moving the comment above the line to avoid mentioning the option\n> > name).\n> \n> YAML does not accept that, so I think it has to be either before or after\n> `MESON_OPTIONS`, but it cannot be in the string itself.\n\nToo bad :-(\n\nBy the way, is meson on Debian 12 unaffected ? If you know when the\nissue was introduced it would be nice to list the minimum version too.\n\nWith those small issues fixed (in particular the clang.native file),\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> >>\n> >>   build-full:arch:\n> >>     extends:","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 1B1E5C3226\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 14 Jan 2026 13:41:49 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 4CC8B61FA3;\n\tWed, 14 Jan 2026 14:41:48 +0100 (CET)","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 F058461F9F\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 14 Jan 2026 14:41:36 +0100 (CET)","from pendragon.ideasonboard.com (81-175-209-152.bb.dnainternet.fi\n\t[81.175.209.152])\n\tby perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id E3D7E316;\n\tWed, 14 Jan 2026 14:41:09 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"L/XdJMrQ\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1768398070;\n\tbh=7DM3wFRrYpr2AHJHtRirj+de6pGRzAV4kGpLRpQpnRc=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=L/XdJMrQY5JZLPRxZlerlU1G5QWf/Xb8n0Ebpli541EbaQNEgIJq7ynTHFZ7A174Z\n\tekxtk9MPUiH4xUlmsnpIdxZbD6/yIPNlefl/oNzmPsn/HRejiSWYr8dGSaIjBI0Afw\n\tgId8xPO8iFKdn65LT70zin1PqunYAvuyBqJO8hNc=","Date":"Wed, 14 Jan 2026 15:41:16 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Subject":"Re: [libcamera-ci] [PATCH v1] Force libc++ with meson native files","Message-ID":"<20260114134116.GK30544@pendragon.ideasonboard.com>","References":"<20260105093130.1177121-1-barnabas.pocze@ideasonboard.com>\n\t<20260114132035.GI30544@pendragon.ideasonboard.com>\n\t<7e301fbe-3a78-4d05-b3f5-eef3b155b861@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<7e301fbe-3a78-4d05-b3f5-eef3b155b861@ideasonboard.com>","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":37657,"web_url":"https://patchwork.libcamera.org/comment/37657/","msgid":"<16085227-7713-458d-9fa6-b511a62e982a@ideasonboard.com>","date":"2026-01-14T14:38:06","subject":"Re: [libcamera-ci] [PATCH v1] Force libc++ with meson native files","submitter":{"id":216,"url":"https://patchwork.libcamera.org/api/people/216/","name":"Barnabás Pőcze","email":"barnabas.pocze@ideasonboard.com"},"content":"2026. 01. 14. 14:41 keltezéssel, Laurent Pinchart írta:\n> On Wed, Jan 14, 2026 at 02:30:44PM +0100, Barnabás Pőcze wrote:\n>> 2026. 01. 14. 14:20 keltezéssel, Laurent Pinchart írta:\n>>> On Mon, Jan 05, 2026 at 10:31:30AM +0100, Barnabás Pőcze wrote:\n>>>> Currently libcamera's meson scripts force the usage of libc++ if clang\n>>>> is detected as the compiler. This is not ideal because it cannot be\n>>>> overridden by the user. So instead of depending on this behaviour\n>>>> for libc++ testing, use meson native files to force the use of\n>>>> libc++ with clang.\n>>>>\n>>>> Unfortunately on debian 13, due a meson bug, a workaround is needed\n>>>> to avoid a macro redefinition error[0].\n>>>>\n>>>> [0]: https://github.com/mesonbuild/meson/issues/13812\n>>>>\n>>>> Link: https://gitlab.freedesktop.org/camera/libcamera/-/issues/226\n>>>> Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\n>>>> ---\n>>>>    .gitlab-ci/meson/clang.native  | 3 +++\n>>>>    .gitlab-ci/meson/libc++.native | 3 +++\n>>>>    gitlab-ci.yml                  | 4 ++++\n>>>>    3 files changed, 10 insertions(+)\n>>>>    create mode 100644 .gitlab-ci/meson/clang.native\n>>>>    create mode 100644 .gitlab-ci/meson/libc++.native\n>>>>\n>>>> diff --git a/.gitlab-ci/meson/clang.native b/.gitlab-ci/meson/clang.native\n>>>> new file mode 100644\n>>>> index 0000000..f00b0f0\n>>>> --- /dev/null\n>>>> +++ b/.gitlab-ci/meson/clang.native\n>>>> @@ -0,0 +1,3 @@\n>>>> +[binaries]\n>>>> +c = ['clang']\n>>>> +cpp = ['clang++']\n>>>\n>>> Why is this needed ? We select the compiler through the CC and CXX\n>>> environment variables.\n>>\n>> True, I suppose it's not actually needed.\n>>\n>>>> diff --git a/.gitlab-ci/meson/libc++.native b/.gitlab-ci/meson/libc++.native\n>>>> new file mode 100644\n>>>> index 0000000..9c99d5a\n>>>> --- /dev/null\n>>>> +++ b/.gitlab-ci/meson/libc++.native\n>>>> @@ -0,0 +1,3 @@\n>>>> +[built-in options]\n>>>> +cpp_args = ['-stdlib=libc++']\n>>>> +cpp_link_args = ['-stdlib=libc++']\n>>>> diff --git a/gitlab-ci.yml b/gitlab-ci.yml\n>>>> index 262d519..2e2c4c9 100644\n>>>> --- a/gitlab-ci.yml\n>>>> +++ b/gitlab-ci.yml\n>>>> @@ -30,6 +30,8 @@ variables:\n>>>>      # clang fails to link with ASan if --no-undefined is enabled.\n>>>>      MESON_CLANG_OPTIONS: >-\n>>>>        -D b_lundef=false\n>>>> +    --native-file $CI_PROJECT_DIR/.gitlab-ci/meson/clang.native\n>>>> +    --native-file $CI_PROJECT_DIR/.gitlab-ci/meson/libc++.native\n>>>>      PACKAGES: >-\n>>>>        ca-certificates\n>>>>        git\n>>>> @@ -322,6 +324,8 @@ build-full:debian:13:\n>>>>              ${MESON_ALL_OPTIONS}\n>>>>              ${MESON_CLANG_OPTIONS}\n>>>>              -D qcam=disabled\n>>>> +          -D cpp_debugstl=false\n>>>> +        # `cpp_debugstl=false` needed due to https://github.com/mesonbuild/meson/issues/13812\n>>>\n>>> It would be nice to list the affected meson versions:\n>>>\n>>>             # Work around a bug in meson prior to 1.10.0, see\n>>\n>> I think it will also be released in 1.9.3.\n>>\n>>> \t  # https://github.com/mesonbuild/meson/issues/13812\n>>>             -D cpp_debugstl=false\n>>>\n>>> (also moving the comment above the line to avoid mentioning the option\n>>> name).\n>>\n>> YAML does not accept that, so I think it has to be either before or after\n>> `MESON_OPTIONS`, but it cannot be in the string itself.\n> \n> Too bad :-(\n> \n> By the way, is meson on Debian 12 unaffected ? If you know when the\n> issue was introduced it would be nice to list the minimum version too.\n\nI believe it was introduced by\n   * https://github.com/mesonbuild/meson/pull/12683\n   * https://github.com/mesonbuild/meson/pull/12684\nsince after those change if `n_debug=false` (default), `cpp_debugstl=true`,\nand clang version >= 18, then `_LIBCPP_HARDENING_MODE` is set twice.\n\nI am not sure why it was previously not present. I presume because `-stdlib=libc++`\nwas added later in the meson script, so meson detected libstdc++ and omitted\n`_LIBCPP_HARDENING_MODE`.\n\nSo my guess is that it was introduced in 1.4.0 or so, I will add that.\n\n\n> \n> With those small issues fixed (in particular the clang.native file),\n> \n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> \n>>>>\n>>>>    build-full:arch:\n>>>>      extends:\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 0C87BC3226\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 14 Jan 2026 14:38:13 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id DB3CD61FBC;\n\tWed, 14 Jan 2026 15:38:11 +0100 (CET)","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 C9C2C61F9F\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 14 Jan 2026 15:38:10 +0100 (CET)","from [192.168.33.18] (185.221.143.114.nat.pool.zt.hu\n\t[185.221.143.114])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id C3D751D1C;\n\tWed, 14 Jan 2026 15:37:43 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"usOirEML\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1768401463;\n\tbh=aCcjZlPE/RC5vaS2dMqZuRYQvWtCN3Z9pxEWPBAfeIs=;\n\th=Date:Subject:To:Cc:References:From:In-Reply-To:From;\n\tb=usOirEMLCLKx5cqNWocrK4EZEzhj7w/lwLolZ5BF1B04w3YcfZAoRETeElzmG8KQd\n\tpF1VCBDBu+3l93aVv5ZNQN0GJ92wUJp9BhI5rqJO0XPLiRHf9sIdzPk8afAKYmuP//\n\tjbc1VQWoe0CTSKWFTu6eHOu9iR2i6v3W4hnPVCBw=","Message-ID":"<16085227-7713-458d-9fa6-b511a62e982a@ideasonboard.com>","Date":"Wed, 14 Jan 2026 15:38:06 +0100","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [libcamera-ci] [PATCH v1] Force libc++ with meson native files","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","References":"<20260105093130.1177121-1-barnabas.pocze@ideasonboard.com>\n\t<20260114132035.GI30544@pendragon.ideasonboard.com>\n\t<7e301fbe-3a78-4d05-b3f5-eef3b155b861@ideasonboard.com>\n\t<20260114134116.GK30544@pendragon.ideasonboard.com>","From":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Content-Language":"en-US, hu-HU","In-Reply-To":"<20260114134116.GK30544@pendragon.ideasonboard.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"8bit","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]