Skip to contentSkip to conversation

package/lvm2: add static build support

PATCH Applied Andreas Mohr via buildroot 1 participant 10 messages May 23 – May 29

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/9 package/lvm2: add static build support

Add static build support for device mapper

Lvm2 standard install still requires dynamic library

---
 package/lvm2/Config.in | 9 ++++++---
 package/lvm2/lvm2.mk   | 9 +++++++++
 2 files changed, 15 insertions(+), 3 deletions(-)
package/lvm2/Config.in +6 -3
index ddb398d1..4f15504e 100644
@@ -2,7 +2,6 @@ config BR2_PACKAGE_LVM2
 	bool "lvm2 & device mapper"
 	depends on BR2_TOOLCHAIN_HAS_THREADS
 	depends on BR2_USE_MMU # needs fork()
-	depends on !BR2_STATIC_LIBS # It fails to build statically
 	help
 	  This is LVM2, the rewrite of The Linux Logical Volume Manager.
 	  LVM supports enterprise level volume management of disk and
@@ -26,13 +25,17 @@ if BR2_PACKAGE_LVM2
 config BR2_PACKAGE_LVM2_STANDARD_INSTALL
 	bool "standard install instead of only dmsetup"
 	default y
+	depends on !BR2_STATIC_LIBS
 	select BR2_PACKAGE_LIBAIO
 	help
 	  Install the standard suite of lvm2 programs. When this option
 	  is not set, only dmsetup is installed.
 
+comment "lvm2 standard install needs a toolchain w/ dynamic library"
+	depends on BR2_STATIC_LIBS
+
 endif
 
-comment "lvm2 needs a toolchain w/ threads, dynamic library"
+comment "lvm2 needs a toolchain w/ threads"
 	depends on BR2_USE_MMU
-	depends on BR2_STATIC_LIBS || !BR2_TOOLCHAIN_HAS_THREADS
+	depends on !BR2_TOOLCHAIN_HAS_THREADS
package/lvm2/lvm2.mk +9 -0
index 3a1dded5..8db1899e 100644
@@ -48,6 +48,15 @@ else
 LVM2_CONF_OPTS += --disable-selinux
 endif
 
+ifeq ($(BR2_STATIC_LIBS),y)
+# configure: error: --enable-cmdlib requires dynamic linking.
+LVM2_CONF_OPTS += --disable-cmdlib
+# configure: error: --enable-dmeventd requires --enable-cmdlib to be used as well
+LVM2_CONF_OPTS += --disable-dmeventd
+# install static version of the devmapper library
+LVM2_CONF_OPTS += --enable-static_link
+endif
+
 ifeq ($(BR2_PACKAGE_LVM2_STANDARD_INSTALL),y)
 LVM2_DEPENDENCIES += libaio
 LVM2_INSTALL_STAGING_OPTS += install
Signature · 6 lines
2.53.0

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

PATCH v2 2/9 package/cryptsetup: add static build support

Add static build support as lvm2 supports static library now

Cryptsetup external-tokens feature still requires dynamic library

---
 package/cryptsetup/Config.in     | 5 ++---
 package/cryptsetup/cryptsetup.mk | 4 ++++
 2 files changed, 6 insertions(+), 3 deletions(-)
package/cryptsetup/Config.in +2 -3
index 2773a93d..5062bba4 100644
@@ -2,7 +2,6 @@ config BR2_PACKAGE_CRYPTSETUP
 	bool "cryptsetup"
 	depends on BR2_TOOLCHAIN_HAS_THREADS # lvm2
 	depends on BR2_USE_MMU # lvm2, libargon2
-	depends on !BR2_STATIC_LIBS # lvm2
 	depends on BR2_TOOLCHAIN_HAS_SYNC_4 # json-c
 	select BR2_PACKAGE_ARGP_STANDALONE if BR2_PACKAGE_LIBSSH && \
 		(BR2_TOOLCHAIN_USES_UCLIBC || BR2_TOOLCHAIN_USES_MUSL)
@@ -20,7 +19,7 @@ config BR2_PACKAGE_CRYPTSETUP
 
 	  https://gitlab.com/cryptsetup/cryptsetup
 
-comment "cryptsetup needs a toolchain w/ threads, dynamic library"
+comment "cryptsetup needs a toolchain w/ threads"
 	depends on BR2_USE_MMU
 	depends on BR2_TOOLCHAIN_HAS_SYNC_4
-	depends on BR2_STATIC_LIBS || !BR2_TOOLCHAIN_HAS_THREADS
+	depends on !BR2_TOOLCHAIN_HAS_THREADS
package/cryptsetup/cryptsetup.mk +4 -0
index 22c564fe..6fff7a1d 100644
@@ -61,6 +61,10 @@ ifeq ($(BR2_PACKAGE_SYSTEMD),y)
 CRYPTSETUP_CONF_OPTS += --with-tmpfilesdir=/usr/lib/tmpfiles.d
 endif
 
+ifeq ($(BR2_STATIC_LIBS),y)
+CRYPTSETUP_CONF_OPTS += --disable-external-tokens
+endif
+
 HOST_CRYPTSETUP_DEPENDENCIES = \
 	host-pkgconf \
 	host-lvm2 \
Signature · 6 lines
2.53.0

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

PATCH v2 3/9 package/containerd: remove lvm2 !BR2_STATIC_LIBS entry

In reply to Andreas Mohr via buildroot

Remove lvm2 !BR2_STATIC_LIBS dependency

(It still depends on !BR2_STATIC_LIBS by BR2_PACKAGE_HOST_GO_TARGET_CGO_LINKING_SUPPORTS)

---
 package/containerd/Config.in | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
package/containerd/Config.in +2 -3
index f014c56e..9712b11b 100644
@@ -32,14 +32,13 @@ config BR2_PACKAGE_CONTAINERD_DRIVER_DEVMAPPER
 	bool "devmapper snapshot driver"
 	depends on BR2_TOOLCHAIN_HAS_THREADS # lvm2
 	depends on BR2_USE_MMU # lvm2
-	depends on !BR2_STATIC_LIBS # lvm2
 	select BR2_PACKAGE_LVM2
 	help
 	  Build the devmapper snapshot driver for containerd.
 
-comment "devmapper snapshot driver needs a toolchain w/ threads, dynamic library"
+comment "devmapper snapshot driver needs a toolchain w/ threads"
 	depends on BR2_USE_MMU
-	depends on BR2_STATIC_LIBS || !BR2_TOOLCHAIN_HAS_THREADS
+	depends on !BR2_TOOLCHAIN_HAS_THREADS
 
 config BR2_PACKAGE_CONTAINERD_DRIVER_ZFS
 	bool "zfs snapshot driver"
Signature · 6 lines
2.53.0

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

PATCH v2 4/9 package/docker-engine: remove lvm2 !BR2_STATIC_LIBS entry

In reply to Andreas Mohr via buildroot

Remove lvm2 !BR2_STATIC_LIBS dependency

(It still depends on !BR2_STATIC_LIBS by BR2_PACKAGE_HOST_GO_TARGET_CGO_LINKING_SUPPORTS)

---
 package/docker-engine/Config.in | 1 -
 1 file changed, 1 deletion(-)
package/docker-engine/Config.in +0 -1
index ae07b5e1..541472d9 100644
@@ -30,7 +30,6 @@ config BR2_PACKAGE_DOCKER_ENGINE_DRIVER_DEVICEMAPPER
 	bool "devicemapper filesystem driver"
 	depends on BR2_TOOLCHAIN_HAS_THREADS # lvm2
 	depends on BR2_USE_MMU # lvm2
-	depends on !BR2_STATIC_LIBS # lvm2
 	select BR2_PACKAGE_LVM2
 	help
 	  Build the devicemapper filesystem driver for Docker.
Signature · 6 lines
2.53.0

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

PATCH v2 5/9 package/skopeo: remove lvm2 !BR2_STATIC_LIBS entry

In reply to Andreas Mohr via buildroot

Remove lvm2 !BR2_STATIC_LIBS dependency

(It still depends on !BR2_STATIC_LIBS by BR2_PACKAGE_HOST_GO_TARGET_CGO_LINKING_SUPPORTS)

---
 package/skopeo/Config.in | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
package/skopeo/Config.in +2 -4
index b0229873..91d10d13 100644
@@ -5,7 +5,6 @@ config BR2_PACKAGE_SKOPEO
 	depends on BR2_USE_MMU  # btrfs-progs, libgpgme, lvm2
 	depends on BR2_PACKAGE_LIBGPG_ERROR_ARCH_SUPPORTS  # libgpgme
 	depends on BR2_TOOLCHAIN_HAS_THREADS_NPTL
-	depends on !BR2_STATIC_LIBS  # lvm2
 	select BR2_PACKAGE_HOST_GO
 	select BR2_PACKAGE_BTRFS_PROGS
 	select BR2_PACKAGE_CONTAINERS_IMAGE_CONFIG  # runtime
@@ -17,10 +16,9 @@ config BR2_PACKAGE_SKOPEO
 
 	  https://github.com/containers/skopeo
 
-comment "skopeo needs a toolchain w/ NPTL, sahred libs"
+comment "skopeo needs a toolchain w/ NPTL"
 	depends on BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS
 	depends on BR2_PACKAGE_HOST_GO_TARGET_CGO_LINKING_SUPPORTS
 	depends on BR2_USE_MMU
 	depends on BR2_PACKAGE_LIBGPG_ERROR_ARCH_SUPPORTS
-	depends on !BR2_TOOLCHAIN_HAS_THREADS_NPTL \
-		|| BR2_STATIC_LIBS
+	depends on !BR2_TOOLCHAIN_HAS_THREADS_NPTL
Signature · 6 lines
2.53.0

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

PATCH v2 6/9 package/systemd: remove lvm2 !BR2_STATIC_LIBS entry

In reply to Andreas Mohr via buildroot

Remove lvm2 !BR2_STATIC_LIBS dependency

(It still depends on !BR2_STATIC_LIBS by main BR2_PACKAGE_SYSTEMD)

---
 package/systemd/Config.in | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
package/systemd/Config.in +2 -4
index 62dc3f5a..f507a55c 100644
@@ -242,7 +242,6 @@ config BR2_PACKAGE_SYSTEMD_HOMED
 	bool "enable home daemon"
 	depends on BR2_TOOLCHAIN_HAS_THREADS # cryptsetup -> lvm2
 	depends on BR2_USE_MMU # cryptsetup -> lvm2
-	depends on !BR2_STATIC_LIBS # cryptsetup -> lvm2
 	depends on BR2_TOOLCHAIN_HAS_SYNC_4 # cryptsetup -> json-c
 	select BR2_PACKAGE_CRYPTSETUP
 	select BR2_PACKAGE_OPENSSL
@@ -254,11 +253,10 @@ config BR2_PACKAGE_SYSTEMD_HOMED
 
 	  https://www.freedesktop.org/software/systemd/man/systemd-homed.service.html
 
-comment "homed support needs a toolchain w/ threads, dynamic library"
+comment "homed support needs a toolchain w/ threads"
 	depends on BR2_USE_MMU
 	depends on BR2_TOOLCHAIN_HAS_SYNC_4
-	depends on !BR2_TOOLCHAIN_HAS_THREADS || \
-		BR2_STATIC_LIBS
+	depends on !BR2_TOOLCHAIN_HAS_THREADS
 
 config BR2_PACKAGE_SYSTEMD_HOSTNAMED
 	bool "enable hostname daemon"
Signature · 6 lines
2.53.0

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

PATCH v2 7/9 package/nfs-utils: remove lvm2 !BR2_STATIC_LIBS reason

In reply to Andreas Mohr via buildroot
---
 package/nfs-utils/Config.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/nfs-utils/Config.in +1 -1
index 295ce28e..0f836bd5 100644
@@ -27,7 +27,7 @@ if BR2_PACKAGE_NFS_UTILS
 
 config BR2_PACKAGE_NFS_UTILS_NFSV4
 	bool "NFSv4/NFSv4.1"
-	depends on !BR2_STATIC_LIBS # keyutils, lvm2
+	depends on !BR2_STATIC_LIBS # keyutils
 	select BR2_PACKAGE_KEYUTILS
 	select BR2_PACKAGE_LVM2
 	help
Signature · 6 lines
2.53.0

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

PATCH v2 8/9 package/petitboot: remove lvm2 !BR2_STATIC_LIBS reason

In reply to Andreas Mohr via buildroot
---
 package/petitboot/Config.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/petitboot/Config.in +1 -1
index 76cbbe9c..3a0ee4bc 100644
@@ -3,7 +3,7 @@ config BR2_PACKAGE_PETITBOOT
 	depends on BR2_PACKAGE_KEXEC_ARCH_SUPPORTS || BR2_PACKAGE_KEXEC_LITE_ARCH_SUPPORTS
 	depends on BR2_USE_MMU # lvm2, agetty
 	depends on BR2_USE_WCHAR # elfutils, kexec-lite
-	depends on !BR2_STATIC_LIBS # elfutils, kexec-lite, lvm2, nvme
+	depends on !BR2_STATIC_LIBS # elfutils, kexec-lite, nvme
 	depends on BR2_TOOLCHAIN_HAS_THREADS # elfutils, kexec-lite, lvm2
 	depends on BR2_PACKAGE_HAS_UDEV
 	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_17 || !BR2_PACKAGE_KEXEC_ARCH_SUPPORTS # kexec
Signature · 6 lines
2.53.0

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

PATCH v2 9/9 package/luksmeta: modify !BR2_STATIC_LIBS reason

In reply to Andreas Mohr via buildroot

There are two libraries with same crc32 definition

---
 package/luksmeta/Config.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/luksmeta/Config.in +1 -1
index ddc9b6f3..45732733 100644
@@ -2,7 +2,7 @@ config BR2_PACKAGE_LUKSMETA
 	bool "luksmeta"
 	depends on BR2_TOOLCHAIN_HAS_THREADS # cryptsetup -> lvm2
 	depends on BR2_USE_MMU # cryptsetup -> lvm2
-	depends on !BR2_STATIC_LIBS # cryptsetup -> lvm2
+	depends on !BR2_STATIC_LIBS # Build fails because of multiple crc32c() definitions
 	depends on BR2_TOOLCHAIN_HAS_SYNC_4 # cryptsetup -> json-c
 	select BR2_PACKAGE_CRYPTSETUP
 	help
Signature · 6 lines
2.53.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#9 lore raw
In reply to Andreas Mohr via buildroot
Quoted 5 lines · Andreas Mohr via buildroot

Add static build support for device mapper

Lvm2 standard install still requires dynamic library

Applied series to next, thanks.

Regards,
Arnout

Quoted 47 lines
---
  package/lvm2/Config.in | 9 ++++++---
  package/lvm2/lvm2.mk   | 9 +++++++++
  2 files changed, 15 insertions(+), 3 deletions(-)
package/lvm2/Config.in +6 -3
index ddb398d1..4f15504e 100644
@@ -2,7 +2,6 @@ config BR2_PACKAGE_LVM2
  	bool "lvm2 & device mapper"
  	depends on BR2_TOOLCHAIN_HAS_THREADS
  	depends on BR2_USE_MMU # needs fork()
-	depends on !BR2_STATIC_LIBS # It fails to build statically
  	help
  	  This is LVM2, the rewrite of The Linux Logical Volume Manager.
  	  LVM supports enterprise level volume management of disk and
@@ -26,13 +25,17 @@ if BR2_PACKAGE_LVM2
  config BR2_PACKAGE_LVM2_STANDARD_INSTALL
  	bool "standard install instead of only dmsetup"
  	default y
+	depends on !BR2_STATIC_LIBS
  	select BR2_PACKAGE_LIBAIO
  	help
  	  Install the standard suite of lvm2 programs. When this option
  	  is not set, only dmsetup is installed.
 
+comment "lvm2 standard install needs a toolchain w/ dynamic library"
+	depends on BR2_STATIC_LIBS
+
  endif
 
-comment "lvm2 needs a toolchain w/ threads, dynamic library"
+comment "lvm2 needs a toolchain w/ threads"
  	depends on BR2_USE_MMU
-	depends on BR2_STATIC_LIBS || !BR2_TOOLCHAIN_HAS_THREADS
+	depends on !BR2_TOOLCHAIN_HAS_THREADS
package/lvm2/lvm2.mk +2 -0
index 3a1dded5..8db1899e 100644
@@ -48,6 +48,15 @@ else
  LVM2_CONF_OPTS += --disable-selinux
  endif
 
+ifeq ($(BR2_STATIC_LIBS),y)
+# configure: error: --enable-cmdlib requires dynamic linking.

package/lvm2/lvm2.mk else · line 62

Quoted 10 lines
package/lvm2/lvm2.mk +7 -0
+LVM2_CONF_OPTS += --disable-cmdlib
+# configure: error: --enable-dmeventd requires --enable-cmdlib to be used as well
+LVM2_CONF_OPTS += --disable-dmeventd
+# install static version of the devmapper library
+LVM2_CONF_OPTS += --enable-static_link
+endif
+
  ifeq ($(BR2_PACKAGE_LVM2_STANDARD_INSTALL),y)
  LVM2_DEPENDENCIES += libaio
  LVM2_INSTALL_STAGING_OPTS += install

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