[{"id":2625,"web_url":"https://patchwork.libcamera.org/comment/2625/","msgid":"<3e8dab32-dc68-8101-d3eb-4385840222a9@ideasonboard.com>","date":"2019-09-06T13:50:38","subject":"Re: [libcamera-devel] [PATCH] src/libcamera/meson.build: link with\n\tatomic when needed","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Hi Fabrice,\n\nThank you for this patch,\n\nOn 05/09/2019 20:04, Fabrice Fontaine wrote:\n> On some architectures, atomic binutils are provided by the libatomic\n> library from gcc. Linking with libatomic is therefore necessary,\n> otherwise the build fails with:\n> \n> /home/buildroot/autobuild/run/instance-3/output/host/opt/ext-toolchain/bin/../lib/gcc/sparc-buildroot-linux-uclibc/7.4.0/../../../../sparc-buildroot-linux-uclibc/bin/ld: src/libcamera/4ab8042@@camera@sha/v4l2_videodevice.cpp.o: in function `libcamera::V4L2VideoDevice::queueBuffer(libcamera::Buffer*)':\n> v4l2_videodevice.cpp:(.text+0x1470): undefined reference to `__atomic_fetch_add_4'\n> \n> This is often for example the case on sparc v8 32 bits.\n> \n> Fixes:\n>  - http://autobuild.buildroot.org/results/1f0b8338f5f39aa86b9d432598dae2f53c5f7c84\n> \n> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>\n> ---\n>  src/libcamera/meson.build | 1 +\n>  1 file changed, 1 insertion(+)\n> \n> diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build\n> index c5d8f11..0706a08 100644\n> --- a/src/libcamera/meson.build\n> +++ b/src/libcamera/meson.build\n> @@ -99,6 +99,7 @@ version_cpp = vcs_tag(command : [gen_version, meson.build_root()],\n>  libcamera_sources += version_cpp\n>  \n>  libcamera_deps = [\n> +    cc.find_library('atomic', required: false),\n\nInterestingly, this adds the following clear message when I build on x86:\n\nLibrary atomic found: YES\n\nSo - my system finds 'libatomic' and now explicitly adds it as the\ndependencies. (I assumed it was a gcc builtin, for it not to be necessary)\n\nI wondered if this caused any ill-effect, but actually I believe this is\nperfectly safe. Thanks to using meson we have reproducible builds, and I\ncan see that both with and without this explicit linking we get\nidentical output binaries for libcamera.so\n\nWith that, and seeing the libcamera tests pass (which is not surprising\nwith no binary change - I've ensured that the git sha1 did not change\nbetween builds) then I believe this is a good fix to support the broken\ncompile issues reported.\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\nI'll give the others a chance to provide any feedback if necessary and\nthen we can push this into the master branch, and then get buildroot\npackage building the latest version.\n\n\n>      cc.find_library('dl'),\n>      libudev,\n>      dependency('threads'),\n>","headers":{"Return-Path":"<kieran.bingham@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 752CD60BD9\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  6 Sep 2019 15:50:41 +0200 (CEST)","from [192.168.0.20]\n\t(cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id CE304542;\n\tFri,  6 Sep 2019 15:50:40 +0200 (CEST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1567777841;\n\tbh=9AyJP76feNhgIwFh2/D0T1Ra9yHgkqaBmQf4BODIyqs=;\n\th=Reply-To:Subject:To:References:From:Date:In-Reply-To:From;\n\tb=mkOzZfJlIC+b06NCdyiIWdYiPbJCR9hIx5bmvcvlN8ebu5k/hAFn4rykwo99tr5RJ\n\ti7OJnKvr3HSoy7Zmnuzt4jRhQPo8JBOfGxSUKZBXVcP5Xl1aH+shs/TG4eWAk7HmT3\n\tlGTNx44p3L4AgWpTwS9e7cvvr2MMb+3WQT/M7w+o=","Reply-To":"kieran.bingham@ideasonboard.com","To":"Fabrice Fontaine <fontaine.fabrice@gmail.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20190905190457.19745-1-fontaine.fabrice@gmail.com>","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Openpgp":"preference=signencrypt","Autocrypt":"addr=kieran.bingham@ideasonboard.com; keydata=\n\tmQINBFYE/WYBEACs1PwjMD9rgCu1hlIiUA1AXR4rv2v+BCLUq//vrX5S5bjzxKAryRf0uHat\n\tV/zwz6hiDrZuHUACDB7X8OaQcwhLaVlq6byfoBr25+hbZG7G3+5EUl9cQ7dQEdvNj6V6y/SC\n\trRanWfelwQThCHckbobWiQJfK9n7rYNcPMq9B8e9F020LFH7Kj6YmO95ewJGgLm+idg1Kb3C\n\tpotzWkXc1xmPzcQ1fvQMOfMwdS+4SNw4rY9f07Xb2K99rjMwZVDgESKIzhsDB5GY465sCsiQ\n\tcSAZRxqE49RTBq2+EQsbrQpIc8XiffAB8qexh5/QPzCmR4kJgCGeHIXBtgRj+nIkCJPZvZtf\n\tKr2EAbc6tgg6DkAEHJb+1okosV09+0+TXywYvtEop/WUOWQ+zo+Y/OBd+8Ptgt1pDRyOBzL8\n\tRXa8ZqRf0Mwg75D+dKntZeJHzPRJyrlfQokngAAs4PaFt6UfS+ypMAF37T6CeDArQC41V3ko\n\tlPn1yMsVD0p+6i3DPvA/GPIksDC4owjnzVX9kM8Zc5Cx+XoAN0w5Eqo4t6qEVbuettxx55gq\n\t8K8FieAjgjMSxngo/HST8TpFeqI5nVeq0/lqtBRQKumuIqDg+Bkr4L1V/PSB6XgQcOdhtd36\n\tOe9X9dXB8YSNt7VjOcO7BTmFn/Z8r92mSAfHXpb07YJWJosQOQARAQABtDBLaWVyYW4gQmlu\n\tZ2hhbSA8a2llcmFuLmJpbmdoYW1AaWRlYXNvbmJvYXJkLmNvbT6JAlcEEwEKAEECGwMFCwkI\n\tBwIGFQgJCgsCBBYCAwECHgECF4ACGQEWIQSQLdeYP70o/eNy1HqhHkZyEKRh/QUCXWTtygUJ\n\tCyJXZAAKCRChHkZyEKRh/f8dEACTDsbLN2nioNZMwyLuQRUAFcXNolDX48xcUX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YbPGSL4AN3FVACb5CxuxEHwo029VcE5U3CSjzqtCoX12tm7A==","Organization":"Ideas on Board","Message-ID":"<3e8dab32-dc68-8101-d3eb-4385840222a9@ideasonboard.com>","Date":"Fri, 6 Sep 2019 14:50:38 +0100","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101\n\tThunderbird/60.8.0","MIME-Version":"1.0","In-Reply-To":"<20190905190457.19745-1-fontaine.fabrice@gmail.com>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-GB","Content-Transfer-Encoding":"8bit","Subject":"Re: [libcamera-devel] [PATCH] src/libcamera/meson.build: link with\n\tatomic when needed","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","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>","X-List-Received-Date":"Fri, 06 Sep 2019 13:50:41 -0000"}},{"id":2626,"web_url":"https://patchwork.libcamera.org/comment/2626/","msgid":"<20190908230112.GB4952@pendragon.ideasonboard.com>","date":"2019-09-08T23:01:12","subject":"Re: [libcamera-devel] [PATCH] src/libcamera/meson.build: link with\n\tatomic when needed","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Kieran,\n\nOn Fri, Sep 06, 2019 at 02:50:38PM +0100, Kieran Bingham wrote:\n> On 05/09/2019 20:04, Fabrice Fontaine wrote:\n> > On some architectures, atomic binutils are provided by the libatomic\n> > library from gcc. Linking with libatomic is therefore necessary,\n> > otherwise the build fails with:\n> > \n> > /home/buildroot/autobuild/run/instance-3/output/host/opt/ext-toolchain/bin/../lib/gcc/sparc-buildroot-linux-uclibc/7.4.0/../../../../sparc-buildroot-linux-uclibc/bin/ld: src/libcamera/4ab8042@@camera@sha/v4l2_videodevice.cpp.o: in function `libcamera::V4L2VideoDevice::queueBuffer(libcamera::Buffer*)':\n> > v4l2_videodevice.cpp:(.text+0x1470): undefined reference to `__atomic_fetch_add_4'\n> > \n> > This is often for example the case on sparc v8 32 bits.\n> > \n> > Fixes:\n> >  - http://autobuild.buildroot.org/results/1f0b8338f5f39aa86b9d432598dae2f53c5f7c84\n> > \n> > Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>\n> > ---\n> >  src/libcamera/meson.build | 1 +\n> >  1 file changed, 1 insertion(+)\n> > \n> > diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build\n> > index c5d8f11..0706a08 100644\n> > --- a/src/libcamera/meson.build\n> > +++ b/src/libcamera/meson.build\n> > @@ -99,6 +99,7 @@ version_cpp = vcs_tag(command : [gen_version, meson.build_root()],\n> >  libcamera_sources += version_cpp\n> >  \n> >  libcamera_deps = [\n> > +    cc.find_library('atomic', required: false),\n> \n> Interestingly, this adds the following clear message when I build on x86:\n> \n> Library atomic found: YES\n> \n> So - my system finds 'libatomic' and now explicitly adds it as the\n> dependencies. (I assumed it was a gcc builtin, for it not to be necessary)\n> \n> I wondered if this caused any ill-effect, but actually I believe this is\n> perfectly safe. Thanks to using meson we have reproducible builds, and I\n> can see that both with and without this explicit linking we get\n> identical output binaries for libcamera.so\n\nIs that because the linker doesn't find any symbol in libatomic.so that\nare required by libcamera, and thus skips it ?\n\n> With that, and seeing the libcamera tests pass (which is not surprising\n> with no binary change - I've ensured that the git sha1 did not change\n> between builds) then I believe this is a good fix to support the broken\n> compile issues reported.\n> \n> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> \n> I'll give the others a chance to provide any feedback if necessary and\n> then we can push this into the master branch, and then get buildroot\n> package building the latest version.\n\nI was initially a bit worried that we would link to libatomic.so\nunnecessarily, or that it would break on platforms not providing\nlibatomic.so, but as all that seems fine,\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nOut of curiosity I still would like to know what code in V4L2VideoDevice\ngenerates atomic calls.\n\n> >      cc.find_library('dl'),\n> >      libudev,\n> >      dependency('threads'),\n> >","headers":{"Return-Path":"<laurent.pinchart@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D7FF160BB2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  9 Sep 2019 01:01:22 +0200 (CEST)","from pendragon.ideasonboard.com (unknown [88.214.162.168])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 03C8423F;\n\tMon,  9 Sep 2019 01:01:20 +0200 (CEST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1567983682;\n\tbh=+QE84q0J/hlMDbU8sQYzaDemVsiDsqvAr47P1BleeCQ=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=c7ghki1Gp3G1TewG7RY+L5KIlpki2tSc3xYM90tHLO/D9Z9oKTTrtUPlCJGDJs7yy\n\tc2E2jyfY1XAlVdkQc8NlaVisE/VCcKtKiqvUPTBkuk0SAvsBCpjkM4JXPvZFRc1K4n\n\t6bX143eOWJAa5xUzNZrWZA/gdzqw/NGBruOoqcNw=","Date":"Mon, 9 Sep 2019 02:01:12 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"Fabrice Fontaine <fontaine.fabrice@gmail.com>,\n\tlibcamera-devel@lists.libcamera.org","Message-ID":"<20190908230112.GB4952@pendragon.ideasonboard.com>","References":"<20190905190457.19745-1-fontaine.fabrice@gmail.com>\n\t<3e8dab32-dc68-8101-d3eb-4385840222a9@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<3e8dab32-dc68-8101-d3eb-4385840222a9@ideasonboard.com>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [PATCH] src/libcamera/meson.build: link with\n\tatomic when needed","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","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>","X-List-Received-Date":"Sun, 08 Sep 2019 23:01:23 -0000"}},{"id":2628,"web_url":"https://patchwork.libcamera.org/comment/2628/","msgid":"<2ac033f7-3481-ab7c-f16a-6b1d995f2edc@ideasonboard.com>","date":"2019-09-09T10:42:00","subject":"Re: [libcamera-devel] [PATCH] src/libcamera/meson.build: link with\n\tatomic when needed","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Hi Laurent,\n\nOn 09/09/2019 00:01, Laurent Pinchart wrote:\n> Hi Kieran,\n> \n> On Fri, Sep 06, 2019 at 02:50:38PM +0100, Kieran Bingham wrote:\n>> On 05/09/2019 20:04, Fabrice Fontaine wrote:\n>>> On some architectures, atomic binutils are provided by the libatomic\n>>> library from gcc. Linking with libatomic is therefore necessary,\n>>> otherwise the build fails with:\n>>>\n>>> /home/buildroot/autobuild/run/instance-3/output/host/opt/ext-toolchain/bin/../lib/gcc/sparc-buildroot-linux-uclibc/7.4.0/../../../../sparc-buildroot-linux-uclibc/bin/ld: src/libcamera/4ab8042@@camera@sha/v4l2_videodevice.cpp.o: in function `libcamera::V4L2VideoDevice::queueBuffer(libcamera::Buffer*)':\n>>> v4l2_videodevice.cpp:(.text+0x1470): undefined reference to `__atomic_fetch_add_4'\n>>>\n>>> This is often for example the case on sparc v8 32 bits.\n>>>\n>>> Fixes:\n>>>  - http://autobuild.buildroot.org/results/1f0b8338f5f39aa86b9d432598dae2f53c5f7c84\n>>>\n>>> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>\n>>> ---\n>>>  src/libcamera/meson.build | 1 +\n>>>  1 file changed, 1 insertion(+)\n>>>\n>>> diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build\n>>> index c5d8f11..0706a08 100644\n>>> --- a/src/libcamera/meson.build\n>>> +++ b/src/libcamera/meson.build\n>>> @@ -99,6 +99,7 @@ version_cpp = vcs_tag(command : [gen_version, meson.build_root()],\n>>>  libcamera_sources += version_cpp\n>>>  \n>>>  libcamera_deps = [\n>>> +    cc.find_library('atomic', required: false),\n>>\n>> Interestingly, this adds the following clear message when I build on x86:\n>>\n>> Library atomic found: YES\n>>\n>> So - my system finds 'libatomic' and now explicitly adds it as the\n>> dependencies. (I assumed it was a gcc builtin, for it not to be necessary)\n>>\n>> I wondered if this caused any ill-effect, but actually I believe this is\n>> perfectly safe. Thanks to using meson we have reproducible builds, and I\n>> can see that both with and without this explicit linking we get\n>> identical output binaries for libcamera.so\n> \n> Is that because the linker doesn't find any symbol in libatomic.so that\n> are required by libcamera, and thus skips it ?\n\nPerhaps, it could likely be that the necessary intrinsics are provided\nby GCC so those get used with precedence, and then there's nothing left\nto link to libatomic.\n\n\n>> With that, and seeing the libcamera tests pass (which is not surprising\n>> with no binary change - I've ensured that the git sha1 did not change\n>> between builds) then I believe this is a good fix to support the broken\n>> compile issues reported.\n>>\n>> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n>>\n>> I'll give the others a chance to provide any feedback if necessary and\n>> then we can push this into the master branch, and then get buildroot\n>> package building the latest version.\n> \n> I was initially a bit worried that we would link to libatomic.so\n> unnecessarily, or that it would break on platforms not providing\n> libatomic.so, but as all that seems fine,\n> \n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> \n> Out of curiosity I still would like to know what code in V4L2VideoDevice\n> generates atomic calls.\n\nIn our master branch, nothing in V4L2VideoDevice. That object file now\ncompiles cleanly..\n\nIn master the only link error point on sparc is:\n\nsrc/libcamera/4ab8042@@camera@sha/message.cpp.o: In function\n`libcamera::Message::registerMessageType()':\nmessage.cpp:(.text+0x178): undefined reference to `__atomic_fetch_add_4'\ncollect2: error: ld returned 1 exit status\n\nWhich is due to the following function:\n\n Message::Type Message::registerMessageType()\n {\n        return static_cast<Message::Type>(nextUserType_++);\n }\n\nThus - I believe this resolution is still required.\n\n\n\nBuildroot is currently still building from:\n\ncaf25dc5cfd1 (\"libcamera: event_dispatcher_poll: Remove struct keyword\nfrom for-range\")\n\n\nAt that commit, in V4L2VideoDevice::queueBuffer() we do a:\n\n\tif (queuedBuffersCount_++ == 0)\n        \tfdEvent_->setEnabled(true);\n\nand in V4L2VideoDevice::dequeueBuffer() we have:\n\n        if (--queuedBuffersCount_ == 0)\n                fdEvent_->setEnabled(false);\n\nI believe these are the cause of the atomic references.\n\n\nNow the only issue is that we have picked up other build errors in\nmaster since this commit in regards to O_TMPFILE usage. <sigh>\n\n\nBut I believe that's separate to this issue, and I believe we are good\nto apply this fix.\n\n\n>>>      cc.find_library('dl'),\n>>>      libudev,\n>>>      dependency('threads'),\n>>>\n>","headers":{"Return-Path":"<kieran.bingham@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 2C1F860BB0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  9 Sep 2019 12:42:04 +0200 (CEST)","from [192.168.0.20]\n\t(cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 02209542;\n\tMon,  9 Sep 2019 12:42:02 +0200 (CEST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1568025723;\n\tbh=uYsSkU60rSz1Zq4su5zKkQVnl9oDPfxiQal2/Vu4otg=;\n\th=Reply-To:Subject:To:Cc:References:From:Date:In-Reply-To:From;\n\tb=TgsbftqWNF6npzMyKa1ZkBV+/G8//wBkFKJRMc4jyBH2XqKW4+EB2w2acyU19CLl1\n\t+p2lN+Tb38JRIKQeXuKK8zSCFinrvRR0D5Csz2vzH1LIE7YNOlNtdgkSNB2MAx/C6s\n\tsaGin3Ve1/3Qs/ybL1OpE9xgEntbOOyVdH/zHhT0=","Reply-To":"kieran.bingham@ideasonboard.com","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"Fabrice Fontaine <fontaine.fabrice@gmail.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20190905190457.19745-1-fontaine.fabrice@gmail.com>\n\t<3e8dab32-dc68-8101-d3eb-4385840222a9@ideasonboard.com>\n\t<20190908230112.GB4952@pendragon.ideasonboard.com>","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Openpgp":"preference=signencrypt","Autocrypt":"addr=kieran.bingham@ideasonboard.com; keydata=\n\tmQINBFYE/WYBEACs1PwjMD9rgCu1hlIiUA1AXR4rv2v+BCLUq//vrX5S5bjzxKAryRf0uHat\n\tV/zwz6hiDrZuHUACDB7X8OaQcwhLaVlq6byfoBr25+hbZG7G3+5EUl9cQ7dQEdvNj6V6y/SC\n\trRanWfelwQThCHckbobWiQJfK9n7rYNcPMq9B8e9F020LFH7Kj6YmO95ewJGgLm+idg1Kb3C\n\tpotzWkXc1xmPzcQ1fvQMOfMwdS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kCJQQYAQoADwIbDAUCWcOUawUJ\n\tB4D+AgAKCRChHkZyEKRh/XJhEACr5iidt/0MZ0rWRMCbZFMWD7D2g6nZeOp+F2zY8CEUW+sd\n\tCDVd9BH9QX9KN5SZo6YtJzMzSzpcx45VwTvtQW0n/6Eujg9EUqblfU9xqvqDmbjEapr5d/OL\n\t21GTALb0owKhA5qDUGEcKGCphpQffKhTNo/BP99jvmJUj7IPSKH97qPypi8/ym8bAxB+uY31\n\tgHTMHf1jMJJ1pRo2tYYPeIIHGDqXBI4sp5GHHF+JcIhgR/e/A6w/dgzHYmQPl2ix5eZYEZbV\n\tTRP+gkX4NV8oHqa/lR+xPOlWElGB57viOSOoWriqxQbFy8XbG1GR8cWlkNtGBGVWaJaSoORP\n\tiowD7irXL91bCyFIqL+7BVk3Jy4uzP744PzE80KwxOp5SQAp9sPzFbgsJrLev90PZySjFHG0\n\twP144DK7nBjOj/J0g9OHVASP1JjK+nw7SDoKnETDIdRC0XmiHXk7TXzPdkvO0UkpHdEPjZUp\n\tWyuc0MqehjR/hTTPt4m/Y14XzEcy6JREIjOrFfUZVho2QpOdv9CNryGdieRTNjUtz463CIaZ\n\tdPBiw9mOMBoNffkn9FIoCjLnAaj9gUAnEHWBZOEviQ5NuyqpeP0YtzI4iaRbSUkYZHej99X3\n\tVmHrdLlMqd/ZgYYbPGSL4AN3FVACb5CxuxEHwo029VcE5U3CSjzqtCoX12tm7A==","Organization":"Ideas on Board","Message-ID":"<2ac033f7-3481-ab7c-f16a-6b1d995f2edc@ideasonboard.com>","Date":"Mon, 9 Sep 2019 11:42:00 +0100","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101\n\tThunderbird/60.8.0","MIME-Version":"1.0","In-Reply-To":"<20190908230112.GB4952@pendragon.ideasonboard.com>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-GB","Content-Transfer-Encoding":"8bit","Subject":"Re: [libcamera-devel] [PATCH] src/libcamera/meson.build: link with\n\tatomic when needed","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","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>","X-List-Received-Date":"Mon, 09 Sep 2019 10:42:04 -0000"}},{"id":2629,"web_url":"https://patchwork.libcamera.org/comment/2629/","msgid":"<15b7bcc0-32f4-9e7d-c094-08cbe9dc6474@ideasonboard.com>","date":"2019-09-09T11:09:00","subject":"Re: [libcamera-devel] [PATCH] src/libcamera/meson.build: link with\n\tatomic when needed","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Hi Fabrice,\n\nI have updated the commit message to reflect the link error which occurs\non our master branch as opposed to the build issue you have reported\n(those lines of affected code have now been removed):\n\n>     src/libcamera/4ab8042@@camera@sha/message.cpp.o: In function `libcamera::Message::registerMessageType()':\n>     message.cpp:(.text+0x178): undefined reference to `__atomic_fetch_add_4'\n>     collect2: error: ld returned 1 exit status\n\nI've collected Laurent's RB tag, added my own and pushed to master.\n\nThank you for this fix.\n\nUnfortunately based on my quick cursory testing the master branch will\nhit a secondary issue which will prevent compilation on Sparc in regards\nto O_TMPFILE.\n\nIs this something you can tackle and fix as well? I've overspent on my\ncycles for build-root support so it may take me some time to get back to\nthis otherwise.\n\nThanks and regards\n\nKieran\n\n\nOn 05/09/2019 20:04, Fabrice Fontaine wrote:\n> On some architectures, atomic binutils are provided by the libatomic\n> library from gcc. Linking with libatomic is therefore necessary,\n> otherwise the build fails with:\n> \n> /home/buildroot/autobuild/run/instance-3/output/host/opt/ext-toolchain/bin/../lib/gcc/sparc-buildroot-linux-uclibc/7.4.0/../../../../sparc-buildroot-linux-uclibc/bin/ld: src/libcamera/4ab8042@@camera@sha/v4l2_videodevice.cpp.o: in function `libcamera::V4L2VideoDevice::queueBuffer(libcamera::Buffer*)':\n> v4l2_videodevice.cpp:(.text+0x1470): undefined reference to `__atomic_fetch_add_4'\n> \n> This is often for example the case on sparc v8 32 bits.\n> \n> Fixes:\n>  - http://autobuild.buildroot.org/results/1f0b8338f5f39aa86b9d432598dae2f53c5f7c84\n> \n> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>\n> ---\n>  src/libcamera/meson.build | 1 +\n>  1 file changed, 1 insertion(+)\n> \n> diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build\n> index c5d8f11..0706a08 100644\n> --- a/src/libcamera/meson.build\n> +++ b/src/libcamera/meson.build\n> @@ -99,6 +99,7 @@ version_cpp = vcs_tag(command : [gen_version, meson.build_root()],\n>  libcamera_sources += version_cpp\n>  \n>  libcamera_deps = [\n> +    cc.find_library('atomic', required: false),\n>      cc.find_library('dl'),\n>      libudev,\n>      dependency('threads'),\n>","headers":{"Return-Path":"<kieran.bingham@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 23E8460BCF\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  9 Sep 2019 13:09:04 +0200 (CEST)","from [192.168.0.20]\n\t(cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 7714C542;\n\tMon,  9 Sep 2019 13:09:03 +0200 (CEST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1568027343;\n\tbh=G+qypfbDMAw4SdBC4dovhDr0LlkKiGfLMruuA7SWZBc=;\n\th=Reply-To:Subject:To:References:From:Date:In-Reply-To:From;\n\tb=Lyv0vOIgnVUROhJ8bJFOzIkOtvAGDnq/FbX4oTbADxKf5sEwpea0ZF0ii3871kQbI\n\tzlkMNfG5KtXH/QCQU9ijCnGOHGAtW5USoOTKMKD28aHW+rnAxu0o4l5jWz5VJC1EYN\n\tL/Jp8W717s0kRVEuOMero7ohrXgqqA3XO0/qGXJI=","Reply-To":"kieran.bingham@ideasonboard.com","To":"Fabrice Fontaine <fontaine.fabrice@gmail.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20190905190457.19745-1-fontaine.fabrice@gmail.com>","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Openpgp":"preference=signencrypt","Autocrypt":"addr=kieran.bingham@ideasonboard.com; keydata=\n\tmQINBFYE/WYBEACs1PwjMD9rgCu1hlIiUA1AXR4rv2v+BCLUq//vrX5S5bjzxKAryRf0uHat\n\tV/zwz6hiDrZuHUACDB7X8OaQcwhLaVlq6byfoBr25+hbZG7G3+5EUl9cQ7dQEdvNj6V6y/SC\n\trRanWfelwQThCHckbobWiQJfK9n7rYNcPMq9B8e9F020LFH7Kj6YmO95ewJGgLm+idg1Kb3C\n\tpotzWkXc1xmPzcQ1fvQMOfMwdS+4SNw4rY9f07Xb2K99rjMwZVDgESKIzhsDB5GY465sCsiQ\n\tcSAZRxqE49RTBq2+EQsbrQpIc8XiffAB8qexh5/QPzCmR4kJgCGeHIXBtgRj+nIkCJPZvZtf\n\tKr2EAbc6tgg6DkAEHJb+1okosV09+0+TXywYvtEop/WUOWQ+zo+Y/OBd+8Ptgt1pDRyOBzL8\n\tRXa8ZqRf0Mwg75D+dKntZeJHzPRJyrlfQokngAAs4PaFt6UfS+ypMAF37T6CeDArQC41V3ko\n\tlPn1yMsVD0p+6i3DPvA/GPIksDC4owjnzVX9kM8Zc5Cx+XoAN0w5Eqo4t6qEVbuettxx55gq\n\t8K8FieAjgjMSxngo/HST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xQbFy8XbG1GR8cWlkNtGBGVWaJaSoORP\n\tiowD7irXL91bCyFIqL+7BVk3Jy4uzP744PzE80KwxOp5SQAp9sPzFbgsJrLev90PZySjFHG0\n\twP144DK7nBjOj/J0g9OHVASP1JjK+nw7SDoKnETDIdRC0XmiHXk7TXzPdkvO0UkpHdEPjZUp\n\tWyuc0MqehjR/hTTPt4m/Y14XzEcy6JREIjOrFfUZVho2QpOdv9CNryGdieRTNjUtz463CIaZ\n\tdPBiw9mOMBoNffkn9FIoCjLnAaj9gUAnEHWBZOEviQ5NuyqpeP0YtzI4iaRbSUkYZHej99X3\n\tVmHrdLlMqd/ZgYYbPGSL4AN3FVACb5CxuxEHwo029VcE5U3CSjzqtCoX12tm7A==","Organization":"Ideas on Board","Message-ID":"<15b7bcc0-32f4-9e7d-c094-08cbe9dc6474@ideasonboard.com>","Date":"Mon, 9 Sep 2019 12:09:00 +0100","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101\n\tThunderbird/60.8.0","MIME-Version":"1.0","In-Reply-To":"<20190905190457.19745-1-fontaine.fabrice@gmail.com>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-GB","Content-Transfer-Encoding":"8bit","Subject":"Re: [libcamera-devel] [PATCH] src/libcamera/meson.build: link with\n\tatomic when needed","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","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>","X-List-Received-Date":"Mon, 09 Sep 2019 11:09:04 -0000"}},{"id":2630,"web_url":"https://patchwork.libcamera.org/comment/2630/","msgid":"<CAPi7W816Yr4ubeT7D99VB-LtANdeXucR7u1eoGSe1CoTCsbFrQ@mail.gmail.com>","date":"2019-09-09T14:02:42","subject":"Re: [libcamera-devel] [PATCH] src/libcamera/meson.build: link with\n\tatomic when needed","submitter":{"id":22,"url":"https://patchwork.libcamera.org/api/people/22/","name":"Fabrice Fontaine","email":"fontaine.fabrice@gmail.com"},"content":"Hello,\n\nLe lun. 9 sept. 2019 à 13:09, Kieran Bingham\n<kieran.bingham@ideasonboard.com> a écrit :\n>\n> Hi Fabrice,\n>\n> I have updated the commit message to reflect the link error which occurs\n> on our master branch as opposed to the build issue you have reported\n> (those lines of affected code have now been removed):\n>\n> >     src/libcamera/4ab8042@@camera@sha/message.cpp.o: In function `libcamera::Message::registerMessageType()':\n> >     message.cpp:(.text+0x178): undefined reference to `__atomic_fetch_add_4'\n> >     collect2: error: ld returned 1 exit status\n>\n> I've collected Laurent's RB tag, added my own and pushed to master.\n>\n> Thank you for this fix.\n>\n> Unfortunately based on my quick cursory testing the master branch will\n> hit a secondary issue which will prevent compilation on Sparc in regards\n> to O_TMPFILE.\n>\n> Is this something you can tackle and fix as well? I've overspent on my\n> cycles for build-root support so it may take me some time to get back to\n> this otherwise.\nOK, I'll try to fix it in the next few days.\n>\n> Thanks and regards\n>\n> Kieran\n>\n>\n> On 05/09/2019 20:04, Fabrice Fontaine wrote:\n> > On some architectures, atomic binutils are provided by the libatomic\n> > library from gcc. Linking with libatomic is therefore necessary,\n> > otherwise the build fails with:\n> >\n> > /home/buildroot/autobuild/run/instance-3/output/host/opt/ext-toolchain/bin/../lib/gcc/sparc-buildroot-linux-uclibc/7.4.0/../../../../sparc-buildroot-linux-uclibc/bin/ld: src/libcamera/4ab8042@@camera@sha/v4l2_videodevice.cpp.o: in function `libcamera::V4L2VideoDevice::queueBuffer(libcamera::Buffer*)':\n> > v4l2_videodevice.cpp:(.text+0x1470): undefined reference to `__atomic_fetch_add_4'\n> >\n> > This is often for example the case on sparc v8 32 bits.\n> >\n> > Fixes:\n> >  - http://autobuild.buildroot.org/results/1f0b8338f5f39aa86b9d432598dae2f53c5f7c84\n> >\n> > Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>\n> > ---\n> >  src/libcamera/meson.build | 1 +\n> >  1 file changed, 1 insertion(+)\n> >\n> > diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build\n> > index c5d8f11..0706a08 100644\n> > --- a/src/libcamera/meson.build\n> > +++ b/src/libcamera/meson.build\n> > @@ -99,6 +99,7 @@ version_cpp = vcs_tag(command : [gen_version, meson.build_root()],\n> >  libcamera_sources += version_cpp\n> >\n> >  libcamera_deps = [\n> > +    cc.find_library('atomic', required: false),\n> >      cc.find_library('dl'),\n> >      libudev,\n> >      dependency('threads'),\n> >\n>\n> --\n> Regards\n> --\n> Kieran\nBest Regards,\n\nFabrice","headers":{"Return-Path":"<fontaine.fabrice@gmail.com>","Received":["from mail-lj1-x242.google.com (mail-lj1-x242.google.com\n\t[IPv6:2a00:1450:4864:20::242])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id F285060BCF\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  9 Sep 2019 16:02:54 +0200 (CEST)","by mail-lj1-x242.google.com with SMTP id l20so12883246ljj.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 09 Sep 2019 07:02:54 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=mime-version:references:in-reply-to:from:date:message-id:subject:to\n\t:cc:content-transfer-encoding;\n\tbh=kx0IEcQ7/JlgZN7AILrRE7YpFpZpW+HdLI43K/ZzE9w=;\n\tb=BHYibbi6j3UvLywFDdOrdAwkEquBeUWP+fT0NVv7plhN+I4GWOm6WKcPyoYXiYMyFe\n\t8Rt/05YafWE7mCfQC4ttTZj0LrG8Y95c752sKuWijP1nJNzIUnZCzCDcp0rA+VhWkezt\n\tqOFQ5c20JYHesVuvW71y5OtA2fBh2gh06FLr7C/uJLrnllcfdteQbYC3RH5yJs1VVXzT\n\tPRw58/ZZjZv0rAw9ckWzooGtGLNHQou+GbvEQB3w13xZ6rfdErrh6io3t0re1wKf4ywa\n\tpa7+p2wSHmZPfPQ6scDScR5oMwpLoPSEh4/45owF0wLe03yUxSq5bm9RwmcgUx+erBBE\n\tScxg==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:references:in-reply-to:from:date\n\t:message-id:subject:to:cc:content-transfer-encoding;\n\tbh=kx0IEcQ7/JlgZN7AILrRE7YpFpZpW+HdLI43K/ZzE9w=;\n\tb=N2VXnGE9iDeo7hqcuwqSwa4muuyWGlkatjSqoLq/jHJ8ycypDzgkBSz11MbJbwpXzJ\n\tpVfAnO/p+ROFDaRygKSAbFxBU61qFn0dDSyoy9T+IS8OgxWxu9ihbez0sM53k2CGqv2t\n\tIPIooqnoUvE2tCHiQZyhZyDefOcv189yuKYUgzIumqA+oPP6h/itmQ9Dp//a6EPSSe93\n\tgzxt929ScHpwdDe47e8YHjwFguwZZ2peuL8EYsFUybPhH5qYnthpY0RWaGcM7pZQCiBD\n\tfr3hsr39NZq7rIM7oK3iSf1oP1ghEcKPscua64EGh5UMWw07xtDyJlowzuAgPKD2RHuK\n\tArpw==","X-Gm-Message-State":"APjAAAX/ouf4SWCPpViGuMoDSUL/F56cqdR1hW+EYMdrnt2rfKo+apT3\n\tGCR3Ql53XG+tFoCKS+PbZ9xiLUS2D+yUkWzHjIpBbA==","X-Google-Smtp-Source":"APXvYqyKcOpiPUV9ptS67iJSMFb/PVwMmRlzzxQyphufYNuFcsjGE7ck80+OjFjOR5R7YGAlQnzoSVSO8xT7hDb4d1M=","X-Received":"by 2002:a2e:8e85:: with SMTP id\n\tz5mr13190303ljk.220.1568037773409; \n\tMon, 09 Sep 2019 07:02:53 -0700 (PDT)","MIME-Version":"1.0","References":"<20190905190457.19745-1-fontaine.fabrice@gmail.com>\n\t<15b7bcc0-32f4-9e7d-c094-08cbe9dc6474@ideasonboard.com>","In-Reply-To":"<15b7bcc0-32f4-9e7d-c094-08cbe9dc6474@ideasonboard.com>","From":"Fabrice Fontaine <fontaine.fabrice@gmail.com>","Date":"Mon, 9 Sep 2019 16:02:42 +0200","Message-ID":"<CAPi7W816Yr4ubeT7D99VB-LtANdeXucR7u1eoGSe1CoTCsbFrQ@mail.gmail.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Content-Type":"text/plain; charset=\"UTF-8\"","Content-Transfer-Encoding":"quoted-printable","X-Mailman-Approved-At":"Tue, 10 Sep 2019 00:37:07 +0200","Subject":"Re: [libcamera-devel] [PATCH] src/libcamera/meson.build: link with\n\tatomic when needed","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","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>","X-List-Received-Date":"Mon, 09 Sep 2019 14:02:55 -0000"}}]