[Buildroot] [PATCH 1/1] package/janet: link with -latomic if needed

Arnout Vandecappelle arnout at mind.be
Tue Nov 9 22:18:56 UTC 2021



On 05/11/2021 20:32, Fabrice Fontaine wrote:
> Link with -latomic if needed to avoid the following build failure since
> bump to version 1.18.1 in commit
> 1ffdab3eac6ea111e37fcc5077f8a64b611c55be and
> https://github.com/janet-lang/janet/commit/eb0b37f7296611a411b9a86d9d65fe620b0454d8:
> 
> /home/giuliobenetti/autobuild/run/instance-3/output-1/host/opt/ext-toolchain/bin/../lib/gcc/sparc-buildroot-linux-uclibc/9.3.0/../../../../sparc-buildroot-linux-uclibc/bin/ld: janet.p/meson-generated_.._janet.c.o: in function `janet_abstract_incref':
> janet.c:(.text+0x2790): undefined reference to `__atomic_fetch_add_4'
> 
> Fixes:
>   - http://autobuild.buildroot.org/results/8d204d8f065e6e4bc1376edd1f639864b3c69c0b
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice at gmail.com>

  Applied to master, thanks.

  Regards,
  Arnout

> ---
>   package/janet/janet.mk | 5 +++++
>   1 file changed, 5 insertions(+)
> 
> diff --git a/package/janet/janet.mk b/package/janet/janet.mk
> index 20917ec8fa..71e9e08e62 100644
> --- a/package/janet/janet.mk
> +++ b/package/janet/janet.mk
> @@ -15,6 +15,11 @@ ifeq ($(BR2_STATIC_LIBS),y)
>   JANET_CONF_OPTS += -Ddynamic_modules=false
>   endif
>   
> +# Uses __atomic_fetch_add_4
> +ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
> +JANET_LDFLAGS += -latomic
> +endif
> +
>   ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),)
>   JANET_CONF_OPTS += -Dsingle_threaded=true
>   endif
> 


More information about the buildroot mailing list