[Buildroot] [PATCH 1/1] package/numactl: needs atomic

Thomas Petazzoni thomas.petazzoni at bootlin.com
Fri Apr 29 07:33:58 UTC 2022


Hello Fabrice,

On Fri, 29 Apr 2022 09:05:21 +0200
Fabrice Fontaine <fontaine.fabrice at gmail.com> wrote:

> > However, the key thing is that the build failure
> > http://autobuild.buildroot.org/results/e225cb83dae390d9dc543d4da85c52180efbd40a
> > has thread support disabled, and when threads are disabled, libatomic
> > is not built, and therefore BR2_TOOLCHAIN_HAS_LIBATOMIC is false.
> >
> > However, I don't see anywhere in the numactl build system where
> > -latomic is passed. Does it build on architectures that need to link
> > against libatomic to get atomic intrinsics?  
> 
> Linking with -latomic is done thanks to 0002-link-with-latomic-if-needed.patch.
> This patch was added to fix the build on architectures such as sparcv8.

Ah, I missed that patch, thanks for pointing it out!

> However, I don't understand why the build fails on microblaze without libatomic.
> Are we sure that microblaze really supports atomic without libatomic?

I explained it in my previous e-mail I think :-)

It fails because the configuration you're pointing to has threads
disabled, and when threads are disabled, libatomic is not
built/provided by gcc. This is properly handled by
BR2_TOOLCHAIN_HAS_LIBATOMIC being false in such configurations.

So basically, your patch is correct (IMO), but the commit log isn't:
the problem isn't Microblaze specific, but would happen on any
architecture that needs libatomic to provide atomic intrinsics.

Thanks!

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com



More information about the buildroot mailing list