[Buildroot] [PATCH 1/1] erlang: support builds when gcc __atomic_* exist

Thomas Petazzoni thomas.petazzoni at bootlin.com
Wed Jul 28 21:35:13 UTC 2021


On Sat,  8 May 2021 18:24:19 -0400
Frank Hunleth <fhunleth at troodon-software.com> wrote:

> While Erlang will use it's own atomic operations, it can also use gcc
> __atomic_* builtins. This is now listed in Erlang's HOWTO/INSTALL.md.
> 
> This change was necessary on RISC-V, since Erlang didn't have a built-in
> implementation, but it was able to use gcc's __atomic_* functions.
> 
> Signed-off-by: Frank Hunleth <fhunleth at troodon-software.com>
> ---
>  package/erlang/Config.in | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)

Thanks Frank for the patch. I have applied to master. However, I think
the patch may be incomplete. Indeed, on some CPU architectures, the
atomic intrinsics are implemented in a separate library provided by
gcc, called libatomic, and one need to link against it to use those
intrinsics.

Could you try to do a build of Erlang on SPARCv8 for example ?

I suppose it will fail, and if it does, could you add some logic in
erlang.mk to link against libatomic when BR2_TOOLCHAIN_HAS_LIBATOMIC=y
(of course assuming the Erlang build system doesn't do that by itself,
of course).

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


More information about the buildroot mailing list