Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Yann E. MORIN <yann.morin.1998@free.fr>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v1 2/2] package/quickjs: link with libatomic
Date: Sun, 3 Jan 2021 22:45:50 +0100	[thread overview]
Message-ID: <20210103214550.GS2997@scaer> (raw)
In-Reply-To: <20210103201959.4035-2-ps.report@gmx.net>

Peter, All,

On 2021-01-03 21:19 +0100, Peter Seiderer spake thusly:
> Link with libatomic if available.
> 
> Fixes:
> 
>   - http://autobuild.buildroot.net/results/e0766eef95a2559d51e58d1a81a9c40df84ae509
> 
>   .../build/quickjs-2020-11-08/quickjs.c:12229: undefined reference to `__atomic_fetch_xor_1'
> 
> Signed-off-by: Peter Seiderer <ps.report@gmx.net>

Applied to master, thanks.

But see below for a small nit...

> ---
>  ...ile-add-optional-link-with-libatomic.patch | 30 +++++++++++++++++++
>  package/quickjs/quickjs.mk                    |  6 +++-
>  2 files changed, 35 insertions(+), 1 deletion(-)
>  create mode 100644 package/quickjs/0001-Makefile-add-optional-link-with-libatomic.patch
> 
> diff --git a/package/quickjs/0001-Makefile-add-optional-link-with-libatomic.patch b/package/quickjs/0001-Makefile-add-optional-link-with-libatomic.patch
> new file mode 100644
> index 0000000000..12f4eb2338
> --- /dev/null
> +++ b/package/quickjs/0001-Makefile-add-optional-link-with-libatomic.patch
> @@ -0,0 +1,30 @@
> +From 2cf2aa34d5d55a4eedb1aedd4d56d89d24870230 Mon Sep 17 00:00:00 2001
> +From: Peter Seiderer <ps.report@gmx.net>
> +Date: Sun, 3 Jan 2021 21:11:44 +0100
> +Subject: [PATCH] Makefile: add optional link with libatomic
> +
> +Add optional libatomic linking if available to fix:
> +
> +  .../build/quickjs-2020-11-08/quickjs.c:12229: undefined reference to `__atomic_fetch_xor_1'
> +
> +Signed-off-by: Peter Seiderer <ps.report@gmx.net>
> +---
> + Makefile | 2 +-
> + 1 file changed, 1 insertion(+), 1 deletion(-)
> +
> +diff --git a/Makefile b/Makefile
> +index e6ae827..22ad496 100644
> +--- a/Makefile
> ++++ b/Makefile
> +@@ -177,7 +177,7 @@ endif
> + HOST_LIBS=-lm -ldl -lpthread
> + LIBS=-lm
> + ifndef CONFIG_WIN32
> +-LIBS+=-ldl -lpthread
> ++LIBS+=-ldl -lpthread $(LIBATOMIC)
> + endif

I've changed that to be a generic variable, not tied to -latomic:

    LIBS+=$(EXTRA_LIBS)

Do not forget to send the patch upstream. ;-)

Regards,
Yann E. MORIN.

> + $(OBJDIR):
> +-- 
> +2.29.2
> +
> diff --git a/package/quickjs/quickjs.mk b/package/quickjs/quickjs.mk
> index 1a2e63278f..389ed71133 100644
> --- a/package/quickjs/quickjs.mk
> +++ b/package/quickjs/quickjs.mk
> @@ -10,8 +10,12 @@ QUICKJS_SITE = https://bellard.org/quickjs
>  QUICKJS_LICENSE = MIT
>  QUICKJS_INSTALL_STAGING = YES
>  
> +ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
> +QUICKJS_LIBATOMIC += -latomic
> +endif
> +
>  define QUICKJS_BUILD_CMDS
> -	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) \
> +	$(TARGET_MAKE_ENV) LIBATOMIC=$(QUICKJS_LIBATOMIC) $(MAKE) -C $(@D) \
>  		CROSS_PREFIX="$(TARGET_CROSS)" \
>  		all
>  endef
> -- 
> 2.29.2
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

  reply	other threads:[~2021-01-03 21:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-03 20:19 [Buildroot] [PATCH v1 1/2] package/quickjs: needs host gcc >= 4.9 (C11/stdatomic.h) Peter Seiderer
2021-01-03 20:19 ` [Buildroot] [PATCH v1 2/2] package/quickjs: link with libatomic Peter Seiderer
2021-01-03 21:45   ` Yann E. MORIN [this message]
2021-01-09 19:49     ` Peter Seiderer
2021-01-03 21:44 ` [Buildroot] [PATCH v1 1/2] package/quickjs: needs host gcc >= 4.9 (C11/stdatomic.h) Yann E. MORIN

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210103214550.GS2997@scaer \
    --to=yann.morin.1998@free.fr \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox