All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni via buildroot <buildroot@buildroot.org>
To: Nicolas Cavallari <nicolas.cavallari@green-communications.fr>
Cc: buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH 1/2] package/libgit2: depends on native 64bit atomics
Date: Mon, 8 Aug 2022 22:41:45 +0200	[thread overview]
Message-ID: <20220808224145.2705f093@windsurf> (raw)
In-Reply-To: <20220808150641.19475-1-nicolas.cavallari@green-communications.fr>

Hello Nicolas,

On Mon,  8 Aug 2022 17:06:40 +0200
Nicolas Cavallari <nicolas.cavallari@green-communications.fr> wrote:

> libgit2 does not know about libatomic_ops.
> 
> This wasn't a problem before because it is a shared library, so the
> missing symbols were simply added as undefined, and no project currently
> depend on libgit2 to expose the problem.
> 
> The next version of libgit2 can also build a binary, which will expose
> the problem.
> 
> Signed-off-by: Nicolas Cavallari <nicolas.cavallari@green-communications.fr>

Which build failure do you have exactly? Indeed when building for
SPARC, what I see are calls to __atomic_compare_exchange_4,
__atomic_fetch_add_4, __atomic_fetch_sub_4.

Is this what you are referring to?

If yes, then these are not sync builtins
(https://gcc.gnu.org/onlinedocs/gcc/_005f_005fsync-Builtins.html), but
atomic builtins
(https://gcc.gnu.org/onlinedocs/gcc/_005f_005fatomic-Builtins.html).

The Buildroot options BR2_TOOLCHAIN_HAS_SYNC_xyz are for sync builtins.

The Buildroot option BR2_TOOLCHAIN_HAS_ATOMIC is for atomic builtins.

So, your package needs to:

	depends on BR2_TOOLCHAIN_HAS_ATOMIC

and then in its .mk file, so something like this:

ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
... make sure your package links against libatomic.so by passing -latomic in LDFLAGS
endif

Note that libatomic.so is distinct from libatomic_ops.so. libatomic.so
is provided together with the gcc runtime, and implements the atomic
builtins on architecture where they are not implemented directly by the
compiler (a runtime library is needed).

Best regards,

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  parent reply	other threads:[~2022-08-08 20:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-08 15:06 [Buildroot] [PATCH 1/2] package/libgit2: depends on native 64bit atomics Nicolas Cavallari
2022-08-08 15:06 ` [Buildroot] [PATCH 2/2] package/libgit2: bump to 1.5.0 Nicolas Cavallari
2022-08-08 15:33   ` [Buildroot] [PATCH 2/2 v2] " Nicolas Cavallari
2022-08-08 20:41 ` Thomas Petazzoni via buildroot [this message]
2022-08-09 15:57   ` [Buildroot] [PATCH 1/2] package/libgit2: depends on native 64bit atomics Nicolas Cavallari
2022-08-24 11:26     ` Thomas Petazzoni via buildroot

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=20220808224145.2705f093@windsurf \
    --to=buildroot@buildroot.org \
    --cc=nicolas.cavallari@green-communications.fr \
    --cc=thomas.petazzoni@bootlin.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.