All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/2] package/libgit2: depends on native 64bit atomics
@ 2022-08-08 15:06 Nicolas Cavallari
  2022-08-08 15:06 ` [Buildroot] [PATCH 2/2] package/libgit2: bump to 1.5.0 Nicolas Cavallari
  2022-08-08 20:41 ` [Buildroot] [PATCH 1/2] package/libgit2: depends on native 64bit atomics Thomas Petazzoni via buildroot
  0 siblings, 2 replies; 6+ messages in thread
From: Nicolas Cavallari @ 2022-08-08 15:06 UTC (permalink / raw)
  To: buildroot

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>
---
 package/libgit2/Config.in | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/package/libgit2/Config.in b/package/libgit2/Config.in
index a6a9728ff0..9c97676c4a 100644
--- a/package/libgit2/Config.in
+++ b/package/libgit2/Config.in
@@ -1,6 +1,8 @@
 config BR2_PACKAGE_LIBGIT2
 	bool "libgit2"
 	depends on !BR2_STATIC_LIBS # libhttpparser
+	depends on BR2_TOOLCHAIN_HAS_SYNC_8
+	depends on BR2_TOOLCHAIN_HAS_SYNC_4
 	select BR2_PACKAGE_LIBHTTPPARSER
 	select BR2_PACKAGE_ZLIB
 	help
-- 
2.36.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH 2/2] package/libgit2: bump to 1.5.0
  2022-08-08 15:06 [Buildroot] [PATCH 1/2] package/libgit2: depends on native 64bit atomics Nicolas Cavallari
@ 2022-08-08 15:06 ` Nicolas Cavallari
  2022-08-08 15:33   ` [Buildroot] [PATCH 2/2 v2] " Nicolas Cavallari
  2022-08-08 20:41 ` [Buildroot] [PATCH 1/2] package/libgit2: depends on native 64bit atomics Thomas Petazzoni via buildroot
  1 sibling, 1 reply; 6+ messages in thread
From: Nicolas Cavallari @ 2022-08-08 15:06 UTC (permalink / raw)
  To: buildroot

It includes an option to build a command line program that can be used
to replace git in simple cases.

The upcoming sha256 repository support made them take the sha256
algorithm implementation from RFC6234, hence the license change.

Signed-off-by: Nicolas Cavallari <nicolas.cavallari@green-communications.fr>

--

Tested with test-pkg with various options on top of 417eb476fd.

It works, except for bootlin-armv7m-uclibc which always fails with
"MMU support available in C library, please enable BR2_USE_MMU"
when configuring the toolchain.
---
 package/libgit2/Config.in    | 10 ++++++++++
 package/libgit2/libgit2.hash |  4 ++--
 package/libgit2/libgit2.mk   | 15 +++++++++++++--
 3 files changed, 25 insertions(+), 4 deletions(-)

diff --git a/package/libgit2/Config.in b/package/libgit2/Config.in
index 9c97676c4a..87f85c1c8f 100644
--- a/package/libgit2/Config.in
+++ b/package/libgit2/Config.in
@@ -14,3 +14,13 @@ config BR2_PACKAGE_LIBGIT2
 
 comment "libgit2 needs a toolchain w/ dynamic library"
 	depends on BR2_STATIC_LIBS
+
+if BR2_PACKAGE_LIBGIT2
+
+config BR2_PACKAGE_LIBGIT2_CLI
+	bool "enable command line interface (git2_cli)"
+	help
+	  Enable a command-line interface for libgit2.
+	  It aims to be git-compatible.
+
+endif
diff --git a/package/libgit2/libgit2.hash b/package/libgit2/libgit2.hash
index 3b5837f789..fb760fd4cc 100644
--- a/package/libgit2/libgit2.hash
+++ b/package/libgit2/libgit2.hash
@@ -1,3 +1,3 @@
 # Locally calculated
-sha256  f48b961e463a9e4e7e7e58b21a0fb5a9b2a1d24d9ba4d15870a0c9b8ad965163  libgit2-1.4.3.tar.gz
-sha256  0092f24acc306ee3287dc05b5e85cb9e0e48cd3f11c60c4625b1a673a5912616  COPYING
+sha256  8de872a0f201b33d9522b817c92e14edb4efad18dae95cf156cf240b2efff93e  libgit2-1.5.0.tar.gz
+sha256  0fc09da43d666b5b0cf5695defc3100d5cf387936b260ebab37e396d7e0dbc83  COPYING
diff --git a/package/libgit2/libgit2.mk b/package/libgit2/libgit2.mk
index 3f1e6e1593..99659bd511 100644
--- a/package/libgit2/libgit2.mk
+++ b/package/libgit2/libgit2.mk
@@ -4,9 +4,14 @@
 #
 ################################################################################
 
-LIBGIT2_VERSION = 1.4.3
+LIBGIT2_VERSION = 1.5.0
 LIBGIT2_SITE = $(call github,libgit2,libgit2,v$(LIBGIT2_VERSION))
-LIBGIT2_LICENSE = GPL-2.0 with linking exception, MIT (sha1), wildmatch license (wildmatch), CC0-1.0 (xoroshiro256)
+LIBGIT2_LICENSE = \
+	GPL-2.0 with linking exception, \
+	MIT (sha1), \
+	BSD-3-Clause (sha256), \
+	wildmatch license (wildmatch), \
+	CC0-1.0 (xoroshiro256)
 LIBGIT2_LICENSE_FILES = COPYING
 LIBGIT2_CPE_ID_VENDOR = libgit2_project
 LIBGIT2_INSTALL_STAGING = YES
@@ -44,4 +49,10 @@ else
 LIBGIT2_CONF_OPTS += -DUSE_HTTPS=OFF
 endif
 
+ifeq ($(BR2_PACKAGE_LIBGIT2_CLI),y)
+LIBGIT2_CONF_OPTS += -DBUILD_CLI=ON
+else
+LIBGIT2_CONF_OPTS += -DBUILD_CLI=OFF
+endif
+
 $(eval $(cmake-package))
-- 
2.36.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH 2/2 v2] package/libgit2: bump to 1.5.0
  2022-08-08 15:06 ` [Buildroot] [PATCH 2/2] package/libgit2: bump to 1.5.0 Nicolas Cavallari
@ 2022-08-08 15:33   ` Nicolas Cavallari
  0 siblings, 0 replies; 6+ messages in thread
From: Nicolas Cavallari @ 2022-08-08 15:33 UTC (permalink / raw)
  To: buildroot

It includes an option to build a command line program that can be used
to replace git in simple cases.

The upcoming sha256 repository support made them take the sha256
algorithm implementation from RFC6234, hence the license change.

Signed-off-by: Nicolas Cavallari <nicolas.cavallari@green-communications.fr>

---
v1 -> v2: fix scissor lines

v1:
Tested with test-pkg with various options on top of 417eb476fd.

It works, except for bootlin-armv7m-uclibc which always fails with
"MMU support available in C library, please enable BR2_USE_MMU"
when configuring the toolchain.
---
 package/libgit2/Config.in    | 10 ++++++++++
 package/libgit2/libgit2.hash |  4 ++--
 package/libgit2/libgit2.mk   | 15 +++++++++++++--
 3 files changed, 25 insertions(+), 4 deletions(-)

diff --git a/package/libgit2/Config.in b/package/libgit2/Config.in
index 9c97676c4a..87f85c1c8f 100644
--- a/package/libgit2/Config.in
+++ b/package/libgit2/Config.in
@@ -14,3 +14,13 @@ config BR2_PACKAGE_LIBGIT2
 
 comment "libgit2 needs a toolchain w/ dynamic library"
 	depends on BR2_STATIC_LIBS
+
+if BR2_PACKAGE_LIBGIT2
+
+config BR2_PACKAGE_LIBGIT2_CLI
+	bool "enable command line interface (git2_cli)"
+	help
+	  Enable a command-line interface for libgit2.
+	  It aims to be git-compatible.
+
+endif
diff --git a/package/libgit2/libgit2.hash b/package/libgit2/libgit2.hash
index 3b5837f789..fb760fd4cc 100644
--- a/package/libgit2/libgit2.hash
+++ b/package/libgit2/libgit2.hash
@@ -1,3 +1,3 @@
 # Locally calculated
-sha256  f48b961e463a9e4e7e7e58b21a0fb5a9b2a1d24d9ba4d15870a0c9b8ad965163  libgit2-1.4.3.tar.gz
-sha256  0092f24acc306ee3287dc05b5e85cb9e0e48cd3f11c60c4625b1a673a5912616  COPYING
+sha256  8de872a0f201b33d9522b817c92e14edb4efad18dae95cf156cf240b2efff93e  libgit2-1.5.0.tar.gz
+sha256  0fc09da43d666b5b0cf5695defc3100d5cf387936b260ebab37e396d7e0dbc83  COPYING
diff --git a/package/libgit2/libgit2.mk b/package/libgit2/libgit2.mk
index 3f1e6e1593..99659bd511 100644
--- a/package/libgit2/libgit2.mk
+++ b/package/libgit2/libgit2.mk
@@ -4,9 +4,14 @@
 #
 ################################################################################
 
-LIBGIT2_VERSION = 1.4.3
+LIBGIT2_VERSION = 1.5.0
 LIBGIT2_SITE = $(call github,libgit2,libgit2,v$(LIBGIT2_VERSION))
-LIBGIT2_LICENSE = GPL-2.0 with linking exception, MIT (sha1), wildmatch license (wildmatch), CC0-1.0 (xoroshiro256)
+LIBGIT2_LICENSE = \
+	GPL-2.0 with linking exception, \
+	MIT (sha1), \
+	BSD-3-Clause (sha256), \
+	wildmatch license (wildmatch), \
+	CC0-1.0 (xoroshiro256)
 LIBGIT2_LICENSE_FILES = COPYING
 LIBGIT2_CPE_ID_VENDOR = libgit2_project
 LIBGIT2_INSTALL_STAGING = YES
@@ -44,4 +49,10 @@ else
 LIBGIT2_CONF_OPTS += -DUSE_HTTPS=OFF
 endif
 
+ifeq ($(BR2_PACKAGE_LIBGIT2_CLI),y)
+LIBGIT2_CONF_OPTS += -DBUILD_CLI=ON
+else
+LIBGIT2_CONF_OPTS += -DBUILD_CLI=OFF
+endif
+
 $(eval $(cmake-package))
-- 
2.36.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [Buildroot] [PATCH 1/2] package/libgit2: depends on native 64bit atomics
  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 20:41 ` Thomas Petazzoni via buildroot
  2022-08-09 15:57   ` Nicolas Cavallari
  1 sibling, 1 reply; 6+ messages in thread
From: Thomas Petazzoni via buildroot @ 2022-08-08 20:41 UTC (permalink / raw)
  To: Nicolas Cavallari; +Cc: buildroot

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Buildroot] [PATCH 1/2] package/libgit2: depends on native 64bit atomics
  2022-08-08 20:41 ` [Buildroot] [PATCH 1/2] package/libgit2: depends on native 64bit atomics Thomas Petazzoni via buildroot
@ 2022-08-09 15:57   ` Nicolas Cavallari
  2022-08-24 11:26     ` Thomas Petazzoni via buildroot
  0 siblings, 1 reply; 6+ messages in thread
From: Nicolas Cavallari @ 2022-08-09 15:57 UTC (permalink / raw)
  To: Thomas Petazzoni; +Cc: buildroot

On 08/08/2022 22:41, Thomas Petazzoni wrote:
> 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).

It's a bit more complicated than that and i probably mixed things up.

libgit2 can use sync builtins or atomic builtins depending on the gcc 
version.

But if we assume that the new gcc minimum version is 4.9, then I can 
probably just ignore the sync builtins.
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Buildroot] [PATCH 1/2] package/libgit2: depends on native 64bit atomics
  2022-08-09 15:57   ` Nicolas Cavallari
@ 2022-08-24 11:26     ` Thomas Petazzoni via buildroot
  0 siblings, 0 replies; 6+ messages in thread
From: Thomas Petazzoni via buildroot @ 2022-08-24 11:26 UTC (permalink / raw)
  To: Nicolas Cavallari; +Cc: buildroot

Hello Nicolas,

On Tue, 9 Aug 2022 17:57:16 +0200
Nicolas Cavallari <nicolas.cavallari@green-communications.fr> wrote:

> It's a bit more complicated than that and i probably mixed things up.
> 
> libgit2 can use sync builtins or atomic builtins depending on the gcc 
> version.
> 
> But if we assume that the new gcc minimum version is 4.9, then I can 
> probably just ignore the sync builtins.

Looking at src/thread.h in libgit2, we can see:

# if (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 1))
#  error Atomic primitives do not exist on this version of gcc; configure libgit2 with -DUSE_THREADS=OFF
# elif (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7))
#  define GIT_BUILTIN_ATOMIC
# else
#  define GIT_BUILTIN_SYNC
# endif

So basically, with gcc >= 4.7, libgit2 uses atomic built-ins, with gcc
< 4.7, it uses sync built-ins. However neither are guaranteed to be
present on all architectures.

So if we want to be fully correct, we would probably need something
like this:

	depends on (BR2_TOOLCHAIN_HAS_ATOMIC && BR2_TOOLCHAIN_GCC_AT_LEAST_4_7) || \
		(BR2_TOOLCHAIN_HAS_SYNC_4 && BR2_TOOLCHAIN_HAS_SYNC_8 && !BR2_TOOLCHAIN_GCC_AT_LEAST_4_7)

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-08-24 11:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [Buildroot] [PATCH 1/2] package/libgit2: depends on native 64bit atomics Thomas Petazzoni via buildroot
2022-08-09 15:57   ` Nicolas Cavallari
2022-08-24 11:26     ` Thomas Petazzoni via buildroot

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.