All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/2] package/f2fs-tools: add lz4 and lzo optional dependencies
@ 2022-10-29 17:00 Fabrice Fontaine
  2022-10-29 17:00 ` [Buildroot] [PATCH 2/2] package/f2fs-tools: fix build with lz4 1.9.4 Fabrice Fontaine
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Fabrice Fontaine @ 2022-10-29 17:00 UTC (permalink / raw)
  To: buildroot; +Cc: Grzegorz Blach, Fabrice Fontaine

lz4 and lzo are optional dependencies (enabled by default) since bump to
version 1.14.0 in commit cf566658f28f3e4b362cc8f9235e6b7768af355c and
https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs-tools.git/commit/?id=b585244e726c1024f7b842033689992a383808cc

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 ...1-configure-ac-fix-cross-compilation.patch | 88 +++++++++++++++++++
 package/f2fs-tools/f2fs-tools.mk              | 18 +++-
 2 files changed, 105 insertions(+), 1 deletion(-)
 create mode 100644 package/f2fs-tools/0001-configure-ac-fix-cross-compilation.patch

diff --git a/package/f2fs-tools/0001-configure-ac-fix-cross-compilation.patch b/package/f2fs-tools/0001-configure-ac-fix-cross-compilation.patch
new file mode 100644
index 0000000000..0e3d4da191
--- /dev/null
+++ b/package/f2fs-tools/0001-configure-ac-fix-cross-compilation.patch
@@ -0,0 +1,88 @@
+From 32e7d272344024c216f155c3463dd2d548f3fafd Mon Sep 17 00:00:00 2001
+From: Nick Hainke <vincent@systemli.org>
+Date: Mon, 4 Jul 2022 11:29:19 +0200
+Subject: configure.ac: fix cross compilation
+
+AC_CHECK_LIB seems to not work correctly with OpenWrt. Add possibility
+to disable lz4 and lzo2 manually.
+
+Fixes errors in the form of:
+  Package f2fsck is missing dependencies for the following libraries:
+  liblz4.so.1
+  liblzo2.so.2
+
+Signed-off-by: Nick Hainke <vincent@systemli.org>
+Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
+[Retrieved from:
+https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs-tools.git/commit/?id=32e7d272344024c216f155c3463dd2d548f3fafd]
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+---
+ configure.ac | 44 ++++++++++++++++++++++++++++++++++----------
+ 1 file changed, 34 insertions(+), 10 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index ea39461..dbe9ad3 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -50,6 +50,18 @@ AC_ARG_WITH([blkid],
+ 	[],
+ 	[with_blkid=check])
+ 
++AC_ARG_WITH([lzo2],
++	[AS_HELP_STRING([--without-lzo2],
++	  [Ignore presence of liblzo2 and disable lzo2 support])],
++	[],
++	[with_lzo2=check])
++
++AC_ARG_WITH([lz4],
++	[AS_HELP_STRING([--without-lz4],
++	  [Ignore presence of liblz4 and disable lz4 support])],
++	[],
++	[with_lz4=check])
++
+ # Checks for programs.
+ AC_PROG_CC
+ AM_PROG_AR
+@@ -71,17 +83,29 @@ AS_IF([test "x$with_blkid" != xno],
+         fi
+ 	], -lblkid)])
+ 
+-AC_CHECK_LIB([lzo2], [main],
+-	[AC_SUBST([liblzo2_LIBS], ["-llzo2"])
+-		AC_DEFINE([HAVE_LIBLZO2], [1],
+-		[Define if you have liblzo2])
+-	], [], [])
++AS_IF([test "x$with_lzo2" != xno],
++	[AC_CHECK_LIB([lzo2], [main],
++		[AC_SUBST([liblzo2_LIBS], ["-llzo2"])
++			AC_DEFINE([HAVE_LIBLZO2], [1],
++			[Define if you have liblzo2])
++		],
++		[if test "x$with_lzo2" != xcheck; then
++			AC_MSG_FAILURE(
++                [--with-lzo2 was given, but test for lzo2 failed])
++        fi
++	], -llzo2)])
+ 
+-AC_CHECK_LIB([lz4], [main],
+-	[AC_SUBST([liblz4_LIBS], ["-llz4"])
+-		AC_DEFINE([HAVE_LIBLZ4], [1],
+-		[Define if you have liblz4])
+-	], [], [])
++AS_IF([test "x$with_lz4" != xno],
++	[AC_CHECK_LIB([lz4], [main],
++		[AC_SUBST([liblz4_LIBS], ["-llz4"])
++			AC_DEFINE([HAVE_LIBLZ4], [1],
++			[Define if you have liblz4])
++		],
++		[if test "x$with_lz4" != xcheck; then
++			AC_MSG_FAILURE(
++                [--with-lz4 was given, but test for lz4 failed])
++        fi
++	], -llz4)])
+ 
+ AS_IF([test "x$with_selinux" != xno],
+ 	[AC_CHECK_LIB([selinux], [getcon],
+-- 
+cgit 
+
diff --git a/package/f2fs-tools/f2fs-tools.mk b/package/f2fs-tools/f2fs-tools.mk
index 2c4ee9185b..60f1004d77 100644
--- a/package/f2fs-tools/f2fs-tools.mk
+++ b/package/f2fs-tools/f2fs-tools.mk
@@ -22,6 +22,20 @@ else
 F2FS_TOOLS_CONF_OPTS += --without-selinux
 endif
 
+ifeq ($(BR2_PACKAGE_LZ4),y)
+F2FS_TOOLS_CONF_OPTS += --with-lz4
+F2FS_TOOLS_DEPENDENCIES += lz4
+else
+F2FS_TOOLS_CONF_OPTS += --without-lz4
+endif
+
+ifeq ($(BR2_PACKAGE_LZO),y)
+F2FS_TOOLS_CONF_OPTS += --with-lzo2
+F2FS_TOOLS_DEPENDENCIES += lzo
+else
+F2FS_TOOLS_CONF_OPTS += --without-lzo2
+endif
+
 ifeq ($(BR2_PACKAGE_UTIL_LINUX_LIBBLKID),y)
 # util-linux is a dependency already, no need to list it again
 F2FS_TOOLS_CONF_OPTS += --with-blkid
@@ -34,7 +48,9 @@ endif
 # blkid support even if we have host-util-linux
 HOST_F2FS_TOOLS_CONF_OPTS = \
 	--without-selinux \
-	--without-blkid
+	--without-blkid \
+	--without-lz4 \
+	--without-lzo2
 
 $(eval $(autotools-package))
 $(eval $(host-autotools-package))
-- 
2.35.1

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

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

* [Buildroot] [PATCH 2/2] package/f2fs-tools: fix build with lz4 1.9.4
  2022-10-29 17:00 [Buildroot] [PATCH 1/2] package/f2fs-tools: add lz4 and lzo optional dependencies Fabrice Fontaine
@ 2022-10-29 17:00 ` Fabrice Fontaine
  2022-11-08 20:22   ` Peter Korsgaard
  2022-10-30 10:52 ` [Buildroot] [PATCH 1/2] package/f2fs-tools: add lz4 and lzo optional dependencies Thomas Petazzoni via buildroot
  2022-11-08 20:22 ` Peter Korsgaard
  2 siblings, 1 reply; 5+ messages in thread
From: Fabrice Fontaine @ 2022-10-29 17:00 UTC (permalink / raw)
  To: buildroot; +Cc: Grzegorz Blach, Fabrice Fontaine

Fix the following build failure raised since bump of lz4 to version
1.9.4 in commit 1f54af8c4f814bfc0993756b82575ad581ce5318:

compress.c: In function 'lz4_compress_init':
compress.c:36:42: error: 'LZ4_STREAMSIZE_U64' undeclared (first use in this function); did you mean 'LZ4_STREAMSIZE'?
   36 | #define LZ4_STREAMSIZE                  (LZ4_STREAMSIZE_U64 * sizeof(long long))
      |                                          ^~~~~~~~~~~~~~~~~~

Fixes:
 - http://autobuild.buildroot.org/results/ca8b6646322a4cb911fad5fb9cb38046743609bf

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 ...s-tools-fix-build-error-on-lz4-1-9-4.patch | 34 +++++++++++++++++++
 1 file changed, 34 insertions(+)
 create mode 100644 package/f2fs-tools/0002-f2fs-tools-fix-build-error-on-lz4-1-9-4.patch

diff --git a/package/f2fs-tools/0002-f2fs-tools-fix-build-error-on-lz4-1-9-4.patch b/package/f2fs-tools/0002-f2fs-tools-fix-build-error-on-lz4-1-9-4.patch
new file mode 100644
index 0000000000..b43def6bb7
--- /dev/null
+++ b/package/f2fs-tools/0002-f2fs-tools-fix-build-error-on-lz4-1-9-4.patch
@@ -0,0 +1,34 @@
+From 19f77c6f6277a274434d6d8883f50e7955c6a8db Mon Sep 17 00:00:00 2001
+From: Jaegeuk Kim <jaegeuk@kernel.org>
+Date: Mon, 29 Aug 2022 11:03:35 -0700
+Subject: f2fs-tools: fix build error on lz4-1.9.4
+
+LZ4_STREAMSIZE_U64 is undefined in new lz4 lib.
+
+Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
+[Retrieved from:
+https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs-tools.git/commit/?id=19f77c6f6277a274434d6d8883f50e7955c6a8db]
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+---
+ fsck/compress.c | 5 +----
+ 1 file changed, 1 insertion(+), 4 deletions(-)
+
+diff --git a/fsck/compress.c b/fsck/compress.c
+index b413492..b15f0a4 100644
+--- a/fsck/compress.c
++++ b/fsck/compress.c
+@@ -32,10 +32,7 @@
+ #ifdef HAVE_LIBLZ4
+ #define LZ4_MEMORY_USAGE		14
+ #define LZ4_MAX_INPUT_SIZE		0x7E000000 /* 2 113 929 216 bytes */
+-#ifndef LZ4_STREAMSIZE
+-#define LZ4_STREAMSIZE			(LZ4_STREAMSIZE_U64 * sizeof(long long))
+-#endif
+-#define LZ4_MEM_COMPRESS		LZ4_STREAMSIZE
++#define LZ4_MEM_COMPRESS		sizeof(LZ4_stream_t)
+ #define LZ4_ACCELERATION_DEFAULT	1
+ #define LZ4_WORK_SIZE			ALIGN_UP(LZ4_MEM_COMPRESS, 8)
+ #endif
+-- 
+cgit 
+
-- 
2.35.1

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

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

* Re: [Buildroot] [PATCH 1/2] package/f2fs-tools: add lz4 and lzo optional dependencies
  2022-10-29 17:00 [Buildroot] [PATCH 1/2] package/f2fs-tools: add lz4 and lzo optional dependencies Fabrice Fontaine
  2022-10-29 17:00 ` [Buildroot] [PATCH 2/2] package/f2fs-tools: fix build with lz4 1.9.4 Fabrice Fontaine
@ 2022-10-30 10:52 ` Thomas Petazzoni via buildroot
  2022-11-08 20:22 ` Peter Korsgaard
  2 siblings, 0 replies; 5+ messages in thread
From: Thomas Petazzoni via buildroot @ 2022-10-30 10:52 UTC (permalink / raw)
  To: Fabrice Fontaine; +Cc: Grzegorz Blach, buildroot

On Sat, 29 Oct 2022 19:00:22 +0200
Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:

> lz4 and lzo are optional dependencies (enabled by default) since bump to
> version 1.14.0 in commit cf566658f28f3e4b362cc8f9235e6b7768af355c and
> https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs-tools.git/commit/?id=b585244e726c1024f7b842033689992a383808cc
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> ---
>  ...1-configure-ac-fix-cross-compilation.patch | 88 +++++++++++++++++++
>  package/f2fs-tools/f2fs-tools.mk              | 18 +++-
>  2 files changed, 105 insertions(+), 1 deletion(-)
>  create mode 100644 package/f2fs-tools/0001-configure-ac-fix-cross-compilation.patch

Both applied to master. Thanks!

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

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

* Re: [Buildroot] [PATCH 1/2] package/f2fs-tools: add lz4 and lzo optional dependencies
  2022-10-29 17:00 [Buildroot] [PATCH 1/2] package/f2fs-tools: add lz4 and lzo optional dependencies Fabrice Fontaine
  2022-10-29 17:00 ` [Buildroot] [PATCH 2/2] package/f2fs-tools: fix build with lz4 1.9.4 Fabrice Fontaine
  2022-10-30 10:52 ` [Buildroot] [PATCH 1/2] package/f2fs-tools: add lz4 and lzo optional dependencies Thomas Petazzoni via buildroot
@ 2022-11-08 20:22 ` Peter Korsgaard
  2 siblings, 0 replies; 5+ messages in thread
From: Peter Korsgaard @ 2022-11-08 20:22 UTC (permalink / raw)
  To: Fabrice Fontaine; +Cc: Grzegorz Blach, buildroot

>>>>> "Fabrice" == Fabrice Fontaine <fontaine.fabrice@gmail.com> writes:

 > lz4 and lzo are optional dependencies (enabled by default) since bump to
 > version 1.14.0 in commit cf566658f28f3e4b362cc8f9235e6b7768af355c and
 > https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs-tools.git/commit/?id=b585244e726c1024f7b842033689992a383808cc

 > Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>

Committed to 2022.08.x and 2022.02.x, thanks.

-- 
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH 2/2] package/f2fs-tools: fix build with lz4 1.9.4
  2022-10-29 17:00 ` [Buildroot] [PATCH 2/2] package/f2fs-tools: fix build with lz4 1.9.4 Fabrice Fontaine
@ 2022-11-08 20:22   ` Peter Korsgaard
  0 siblings, 0 replies; 5+ messages in thread
From: Peter Korsgaard @ 2022-11-08 20:22 UTC (permalink / raw)
  To: Fabrice Fontaine; +Cc: Grzegorz Blach, buildroot

>>>>> "Fabrice" == Fabrice Fontaine <fontaine.fabrice@gmail.com> writes:

 > Fix the following build failure raised since bump of lz4 to version
 > 1.9.4 in commit 1f54af8c4f814bfc0993756b82575ad581ce5318:

 > compress.c: In function 'lz4_compress_init':
 > compress.c:36:42: error: 'LZ4_STREAMSIZE_U64' undeclared (first use in this function); did you mean 'LZ4_STREAMSIZE'?
 >    36 | #define LZ4_STREAMSIZE                  (LZ4_STREAMSIZE_U64 * sizeof(long long))
 >       |                                          ^~~~~~~~~~~~~~~~~~

 > Fixes:
 >  - http://autobuild.buildroot.org/results/ca8b6646322a4cb911fad5fb9cb38046743609bf

 > Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>

Committed to 2022.08.x and 2022.02.x, thanks.

-- 
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

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

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-29 17:00 [Buildroot] [PATCH 1/2] package/f2fs-tools: add lz4 and lzo optional dependencies Fabrice Fontaine
2022-10-29 17:00 ` [Buildroot] [PATCH 2/2] package/f2fs-tools: fix build with lz4 1.9.4 Fabrice Fontaine
2022-11-08 20:22   ` Peter Korsgaard
2022-10-30 10:52 ` [Buildroot] [PATCH 1/2] package/f2fs-tools: add lz4 and lzo optional dependencies Thomas Petazzoni via buildroot
2022-11-08 20:22 ` Peter Korsgaard

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.