[libcamera-devel] [PATCH] src/libcamera/meson.build: link with atomic when needed

Kieran Bingham kieran.bingham at ideasonboard.com
Mon Sep 9 13:09:00 CEST 2019


Hi Fabrice,

I have updated the commit message to reflect the link error which occurs
on our master branch as opposed to the build issue you have reported
(those lines of affected code have now been removed):

>     src/libcamera/4ab8042@@camera at sha/message.cpp.o: In function `libcamera::Message::registerMessageType()':
>     message.cpp:(.text+0x178): undefined reference to `__atomic_fetch_add_4'
>     collect2: error: ld returned 1 exit status

I've collected Laurent's RB tag, added my own and pushed to master.

Thank you for this fix.

Unfortunately based on my quick cursory testing the master branch will
hit a secondary issue which will prevent compilation on Sparc in regards
to O_TMPFILE.

Is this something you can tackle and fix as well? I've overspent on my
cycles for build-root support so it may take me some time to get back to
this otherwise.

Thanks and regards

Kieran


On 05/09/2019 20:04, Fabrice Fontaine wrote:
> On some architectures, atomic binutils are provided by the libatomic
> library from gcc. Linking with libatomic is therefore necessary,
> otherwise the build fails with:
> 
> /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 at sha/v4l2_videodevice.cpp.o: in function `libcamera::V4L2VideoDevice::queueBuffer(libcamera::Buffer*)':
> v4l2_videodevice.cpp:(.text+0x1470): undefined reference to `__atomic_fetch_add_4'
> 
> This is often for example the case on sparc v8 32 bits.
> 
> Fixes:
>  - http://autobuild.buildroot.org/results/1f0b8338f5f39aa86b9d432598dae2f53c5f7c84
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice at gmail.com>
> ---
>  src/libcamera/meson.build | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build
> index c5d8f11..0706a08 100644
> --- a/src/libcamera/meson.build
> +++ b/src/libcamera/meson.build
> @@ -99,6 +99,7 @@ version_cpp = vcs_tag(command : [gen_version, meson.build_root()],
>  libcamera_sources += version_cpp
>  
>  libcamera_deps = [
> +    cc.find_library('atomic', required: false),
>      cc.find_library('dl'),
>      libudev,
>      dependency('threads'),
> 

-- 
Regards
--
Kieran


More information about the libcamera-devel mailing list