Skip to contentSkip to conversation

package/libargon2: conditionally shared/static build

PATCH Applied Andreas Mohr via buildroot 1 participant 7 messages May 18 – May 29

lore
Share & tools
lore
#0 lore raw

PATCH v4 1/2 package/libargon2: conditionally shared/static build

Add static build support of libargon2.
This will allow dependent packages like cryptsetup to build static as well.

---
 package/libargon2/Config.in    | 5 -----
 package/libargon2/libargon2.mk | 6 ++++++
 2 files changed, 6 insertions(+), 5 deletions(-)
package/libargon2/Config.in +0 -5
index 6bba74cf..73c1e0d7 100644
@@ -1,12 +1,7 @@
 config BR2_PACKAGE_LIBARGON2
 	bool "libargon2"
 	depends on BR2_USE_MMU
-	depends on !BR2_STATIC_LIBS
 	help
 	  A modern password hashing algorithm
 
 	  https://password-hashing.net/#argon2
-
-comment "libargon needs a toolchain w/ dynamic library"
-	depends on BR2_USE_MMU
-	depends on BR2_STATIC_LIBS
package/libargon2/libargon2.mk +6 -0
index b3f6e1b2..8ca0071a 100644
@@ -23,6 +23,12 @@ ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),)
 LIBARGON2_OPTS += NO_THREADS=1
 endif
 
+ifeq ($(BR2_STATIC_LIBS),y)
+LIBARGON2_OPTS += LIB_SH= LINKED_LIB_SH=
+else ifeq ($(BR2_SHARED_LIBS),y)
+LIBARGON2_OPTS += LIB_ST=
+endif
+
 define LIBARGON2_BUILD_CMDS
 	$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) \
 		$(LIBARGON2_OPTS)
Signature · 6 lines
2.53.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

PATCH v4 2/2 package/libargon2: fix pkgconfig version string

Current build generated pkgconfig/libargon2.pc has wrong version string.
Version: ZERO

---
 package/libargon2/libargon2.mk | 1 +
 1 file changed, 1 insertion(+)
package/libargon2/libargon2.mk +1 -0
index 8ca0071a..e968aa08 100644
@@ -11,6 +11,7 @@ LIBARGON2_LICENSE_FILES = LICENSE
 LIBARGON2_INSTALL_STAGING = YES
 
 LIBARGON2_OPTS = LIBRARY_REL=lib
+LIBARGON2_OPTS += ARGON2_VERSION=$(LIBARGON2_VERSION)
 
 # GCC_TARGET_ARCH is not defined for all architectures, but libargon2
 # only uses it to detect if some x86 optimizations can be used, and
Signature · 6 lines
2.53.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw

Re: [Buildroot] [PATCH v4 2/2] package/libargon2: fix pkgconfig version string

Quoted 4 lines · Andreas Mohr via buildroot

Current build generated pkgconfig/libargon2.pc has wrong version string.
Version: ZERO

Applied to master, thanks.

Regards,
Arnout

Quoted 9 lines
---
  package/libargon2/libargon2.mk | 1 +
  1 file changed, 1 insertion(+)
package/libargon2/libargon2.mk +0 -0
index 8ca0071a..e968aa08 100644

package/libargon2/libargon2.mk LIBARGON2_LICENSE_FILES = LICENSE · line 17

Quoted 7 lines
package/libargon2/libargon2.mk +1 -0
@@ -11,6 +11,7 @@ LIBARGON2_LICENSE_FILES = LICENSE
  LIBARGON2_INSTALL_STAGING = YES
 
  LIBARGON2_OPTS = LIBRARY_REL=lib
+LIBARGON2_OPTS += ARGON2_VERSION=$(LIBARGON2_VERSION)
 
  # GCC_TARGET_ARCH is not defined for all architectures, but libargon2
  # only uses it to detect if some x86 optimizations can be used, and

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#3 lore raw

Re: [Buildroot] [PATCH v4 2/2] package/libargon2: fix pkgconfig version string

In reply to Andreas Mohr via buildroot

In reply of:

Quoted 4 lines

Current build generated pkgconfig/libargon2.pc has wrong version string.
Version: ZERO

Applied to 2025.02.x & 2026.02.x. Thanks

Quoted 23 lines
---
 package/libargon2/libargon2.mk | 1 +
 1 file changed, 1 insertion(+)
package/libargon2/libargon2.mk +1 -0
index 8ca0071a..e968aa08 100644
@@ -11,6 +11,7 @@ LIBARGON2_LICENSE_FILES = LICENSE
 LIBARGON2_INSTALL_STAGING = YES
 
 LIBARGON2_OPTS = LIBRARY_REL=lib
+LIBARGON2_OPTS += ARGON2_VERSION=$(LIBARGON2_VERSION)
 
 # GCC_TARGET_ARCH is not defined for all architectures, but libargon2
 # only uses it to detect if some x86 optimizations can be used, and
Signature · 6 lines
2.53.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#4 lore raw
In reply to Andreas Mohr via buildroot

Hi Andreas,

Quoted 2 lines · Andreas Mohr via buildroot

Add static build support of libargon2.
This will allow dependent packages like cryptsetup to build static as well.

The comment in package/cryptsetup/Config.in needs update, then.

Can lua-argon2 build statically now? If not, the comment in its Config.in pointing at libargon2 needs update as well.

Same goes for python-argon2-cffi-bindings.

baruch

Quoted 40 lines
---
 package/libargon2/Config.in    | 5 -----
 package/libargon2/libargon2.mk | 6 ++++++
 2 files changed, 6 insertions(+), 5 deletions(-)
package/libargon2/Config.in +0 -5
index 6bba74cf..73c1e0d7 100644
@@ -1,12 +1,7 @@
 config BR2_PACKAGE_LIBARGON2
 	bool "libargon2"
 	depends on BR2_USE_MMU
-	depends on !BR2_STATIC_LIBS
 	help
 	  A modern password hashing algorithm
 
 	  https://password-hashing.net/#argon2
-
-comment "libargon needs a toolchain w/ dynamic library"
-	depends on BR2_USE_MMU
-	depends on BR2_STATIC_LIBS
package/libargon2/libargon2.mk +6 -0
index b3f6e1b2..8ca0071a 100644
@@ -23,6 +23,12 @@ ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),)
 LIBARGON2_OPTS += NO_THREADS=1
 endif
 
+ifeq ($(BR2_STATIC_LIBS),y)
+LIBARGON2_OPTS += LIB_SH= LINKED_LIB_SH=
+else ifeq ($(BR2_SHARED_LIBS),y)
+LIBARGON2_OPTS += LIB_ST=
+endif
+
 define LIBARGON2_BUILD_CMDS
 	$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) \
 		$(LIBARGON2_OPTS)
Signature · 7 lines
                                                     ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - [email protected] - tel: +972.52.368.4656, http://www.tkos.co.il -
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#5 lore raw

Hi baruch,

Am 19.05.26 um 05:20 schrieb Baruch Siach:

Quoted 11 lines

Hi Andreas,

Quoted 2 lines · Andreas Mohr via buildroot

Add static build support of libargon2.
This will allow dependent packages like cryptsetup to build static as well.

The comment in package/cryptsetup/Config.in needs update, then.

Can lua-argon2 build statically now? If not, the comment in its Config.in pointing at libargon2 needs update as well.

Same goes for python-argon2-cffi-bindings.

Yes, in a future patch set, once the libargon2 static build patch has been incorporated.

Quoted 33 lines

baruch

Quoted 31 lines
---
  package/libargon2/Config.in    | 5 -----
  package/libargon2/libargon2.mk | 6 ++++++
  2 files changed, 6 insertions(+), 5 deletions(-)
package/libargon2/Config.in +0 -5
index 6bba74cf..73c1e0d7 100644
@@ -1,12 +1,7 @@
  config BR2_PACKAGE_LIBARGON2
  	bool "libargon2"
  	depends on BR2_USE_MMU
-	depends on !BR2_STATIC_LIBS
  	help
  	  A modern password hashing algorithm
 
  	  https://password-hashing.net/#argon2
-
-comment "libargon needs a toolchain w/ dynamic library"
-	depends on BR2_USE_MMU
-	depends on BR2_STATIC_LIBS
package/libargon2/libargon2.mk +0 -0
index b3f6e1b2..8ca0071a 100644
@@ -23,6 +23,12 @@ ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),)
  LIBARGON2_OPTS += NO_THREADS=1
  endif
 
Quoted 9 lines

package/libargon2/libargon2.mk ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),) · line 34

Quoted 9 lines
package/libargon2/libargon2.mk +6 -0
+ifeq ($(BR2_STATIC_LIBS),y)
+LIBARGON2_OPTS += LIB_SH= LINKED_LIB_SH=
+else ifeq ($(BR2_SHARED_LIBS),y)
+LIBARGON2_OPTS += LIB_ST=
+endif
+
  define LIBARGON2_BUILD_CMDS
  	$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) \
  		$(LIBARGON2_OPTS)

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#6 lore raw
Quoted 8 lines · Andreas Mohr via buildroot

Hi baruch,

Am 19.05.26 um 05:20 schrieb Baruch Siach:

Quoted 5 lines

Hi Andreas,

Quoted 2 lines · Andreas Mohr via buildroot

Add static build support of libargon2.
This will allow dependent packages like cryptsetup to build static as well.

Quoted 8 lines
Quoted 6 lines

The comment in package/cryptsetup/Config.in needs update, then.

Can lua-argon2 build statically now? If not, the comment in its Config.in pointing at libargon2 needs update as well.

Same goes for python-argon2-cffi-bindings.

Yes, in a future patch set, once the libargon2 static build patch has been incorporated.

No, it really has to be in the same patch. Just search the git history for
other commits that enable static build.

I did it myself and applied to next, thanks.

Regards,
Arnout

Quoted 37 lines
Quoted 37 lines

baruch

Quoted 34 lines

---
  package/libargon2/Config.in    | 5 -----
  package/libargon2/libargon2.mk | 6 ++++++

  2 files changed, 6 insertions(+), 5 deletions(-)
package/libargon2/Config.in +0 -0
index 6bba74cf..73c1e0d7 100644
@@ -1,12 +1,7 @@

  config BR2_PACKAGE_LIBARGON2
      bool "libargon2"
      depends on BR2_USE_MMU
-    depends on !BR2_STATIC_LIBS
      help
        A modern password hashing algorithm
        https://password-hashing.net/#argon2

package/libargon2/Config.in +0 -4
-
-comment "libargon needs a toolchain w/ dynamic library"
-    depends on BR2_USE_MMU
-    depends on BR2_STATIC_LIBS
package/libargon2/libargon2.mk +0 -0
index b3f6e1b2..8ca0071a 100644
@@ -23,6 +23,12 @@ ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),)

  LIBARGON2_OPTS += NO_THREADS=1
  endif

package/libargon2/libargon2.mk +5 -0
+ifeq ($(BR2_STATIC_LIBS),y)
+LIBARGON2_OPTS += LIB_SH= LINKED_LIB_SH=
+else ifeq ($(BR2_SHARED_LIBS),y)
+LIBARGON2_OPTS += LIB_ST=
+endif
Quoted 8 lines
Quoted 4 lines
Quoted 4 lines

+
  define LIBARGON2_BUILD_CMDS
      $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) \
          $(LIBARGON2_OPTS)

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot