Skip to contentSkip to conversation

zchunk: upgrade to 1.2.4

PATCH In review Ross Burton 3 participants 3 messages Feb 23, 2023 – Feb 26, 2023

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 zchunk: upgrade to 1.2.4

Add a patch submitted upstream to fix the argp detection with clang.

---
 .../recipes-support/zchunk/files/clang.patch  | 35 +++++++++++++++++++
 .../recipes-support/zchunk/zchunk_1.2.0.bb    | 22 ------------
 .../recipes-support/zchunk/zchunk_1.2.4.bb    | 25 +++++++++++++
 3 files changed, 60 insertions(+), 22 deletions(-)
 create mode 100644 meta-oe/recipes-support/zchunk/files/clang.patch
 delete mode 100644 meta-oe/recipes-support/zchunk/zchunk_1.2.0.bb
 create mode 100644 meta-oe/recipes-support/zchunk/zchunk_1.2.4.bb
meta-oe/recipes-support/zchunk/files/clang.patch new file +35 -0
new file mode 100644
index 0000000000..86faf4aac7
@@ -0,0 +1,35 @@
+From e69d907c3fe8765ce50ce1258648ebc8283ef8a7 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Wed, 22 Feb 2023 14:55:07 -0800
+Subject: [PATCH] meson: Use global function in argp check
+
+clang is optimizing away parse_opt() since its marked static and not
+used in main(), make life a bit harder for clang :)
+removing static now emits the global symbols to be resolved during link
+and when libargp is missing the error is thrown rightly
+
+riscv64-yoe-linux-musl-ld: /tmp/a-5ba039.o: in function `.Lpcrel_hi0':
+a.c:(.text+0x44): undefined reference to `argp_state_help'
+clang-16: error: linker command failed with exit code 1 (use -v to see invocation)
+
+Signed-off-by: Khem Raj <[email protected]>
+
+Upstream-Status: Submitted [https://github.com/zchunk/zchunk/pull/92/]
+Signed-off-by: Ross Burton <[email protected]>
+---
+ meson.build | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/meson.build b/meson.build
+index 3b92d58..ab54abd 100644
+--- a/meson.build
++++ b/meson.build
+@@ -57,7 +57,7 @@ if host_machine.system() == 'windows'
+ endif
+ 
+ # argp-standalone dependency (if required)
+-if build_machine.system() == 'windows' or build_machine.system() == 'darwin' or build_machine.system() == 'freebsd' or not cc.links('#include <argp.h>\nstatic error_t parse_opt (int key, char *arg, struct argp_state *state) { argp_usage(state); return 0; }; void main() {}')
++if build_machine.system() == 'windows' or build_machine.system() == 'darwin' or build_machine.system() == 'freebsd' or not cc.links('#include <argp.h>\nerror_t parse_opt (int key, char *arg, struct argp_state *state) { argp_usage(state); return 0; }; void main() {}')
+     argplib = cc.find_library('argp', has_headers : ['argp.h'], required: false)
+     if not argplib.found()
+         argplib = dependency('argp-standalone')
meta-oe/recipes-support/zchunk/zchunk_1.2.0.bb deleted +0 -22
deleted file mode 100644
index 0baea5032a..0000000000
@@ -1,22 +0,0 @@
-DESCRIPTION = "A file format designed for highly efficient deltas while maintaining good compression"
-AUTHOR = "Jonathan Dieter"
-
-LICENSE = "BSD-2-Clause"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=daf6e68539f564601a5a5869c31e5242"
-
-SRC_URI = "git://github.com/zchunk/zchunk.git;protocol=https;branch=main"
-
-SRCREV = "dd6a30a1e4e8b738b0cafc682f3c00e7706134e5"
-S = "${WORKDIR}/git"
-
-DEPENDS = "\
-    curl \
-    zstd \
-    "
-
-DEPENDS:append:libc-musl = " argp-standalone"
-LDFLAGS:append:libc-musl = " -largp"
-
-inherit meson pkgconfig
-
-BBCLASSEXTEND = "native nativesdk"
meta-oe/recipes-support/zchunk/zchunk_1.2.4.bb new file +25 -0
new file mode 100644
index 0000000000..b4fd027603
@@ -0,0 +1,25 @@
+DESCRIPTION = "A file format designed for highly efficient deltas while maintaining good compression"
+AUTHOR = "Jonathan Dieter"
+
+LICENSE = "BSD-2-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=daf6e68539f564601a5a5869c31e5242"
+
+SRC_URI = "git://github.com/zchunk/zchunk.git;protocol=https;branch=main \
+           file://clang.patch"
+
+SRCREV = "0bed8496262a71beadccd4e562bdac093ef6e06f"
+S = "${WORKDIR}/git"
+
+DEPENDS = "zstd"
+DEPENDS:append:libc-musl = " argp-standalone"
+
+inherit meson pkgconfig lib_package
+
+PACKAGECONFIG ??= "openssl zckdl"
+
+# zckdl gets packaged into zchunk-bin
+PACKAGECONFIG[zckdl] = "-Dwith-curl=enabled,-Dwith-curl=disabled,curl"
+# Use OpenSSL primitives for SHA
+PACKAGECONFIG[openssl] = "-Dwith-openssl=enabled,-Dwith-openssl=disabled,openssl"
+
+BBCLASSEXTEND = "native nativesdk"
Signature · 1 line
2.34.1
#1 lore raw

Hi Ross,

Jonathan released a new version of zchunk 1.3.0, that fixes some huge memory consumption on embedded system. What about to skip 1.2.4 and just upgrade to 1.3.0 ? Or do you prefer I send a patch after you merged 1.2.4 ?

Best regards,
Stefano

Quoted 123 lines · Ross Burton

Add a patch submitted upstream to fix the argp detection with clang.

---
  .../recipes-support/zchunk/files/clang.patch  | 35 +++++++++++++++++++
  .../recipes-support/zchunk/zchunk_1.2.0.bb    | 22 ------------
  .../recipes-support/zchunk/zchunk_1.2.4.bb    | 25 +++++++++++++
  3 files changed, 60 insertions(+), 22 deletions(-)

create mode 100644 meta-oe/recipes-support/zchunk/files/clang.patch delete mode 100644 meta-oe/recipes-support/zchunk/zchunk_1.2.0.bb create mode 100644 meta-oe/recipes-support/zchunk/zchunk_1.2.4.bb

meta-oe/recipes-support/zchunk/files/clang.patch new file +35 -0
new file mode 100644
index 0000000000..86faf4aac7
@@ -0,0 +1,35 @@
+From e69d907c3fe8765ce50ce1258648ebc8283ef8a7 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Wed, 22 Feb 2023 14:55:07 -0800
+Subject: [PATCH] meson: Use global function in argp check
+
+clang is optimizing away parse_opt() since its marked static and not
+used in main(), make life a bit harder for clang :)
+removing static now emits the global symbols to be resolved during link
+and when libargp is missing the error is thrown rightly
+
+riscv64-yoe-linux-musl-ld: /tmp/a-5ba039.o: in function `.Lpcrel_hi0':
+a.c:(.text+0x44): undefined reference to `argp_state_help'
+clang-16: error: linker command failed with exit code 1 (use -v to see invocation)
+
+Signed-off-by: Khem Raj <[email protected]>
+
+Upstream-Status: Submitted [https://github.com/zchunk/zchunk/pull/92/]
+Signed-off-by: Ross Burton <[email protected]>
+---
+ meson.build | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/meson.build b/meson.build
+index 3b92d58..ab54abd 100644
+--- a/meson.build
++++ b/meson.build
+@@ -57,7 +57,7 @@ if host_machine.system() == 'windows'
+ endif
+
+ # argp-standalone dependency (if required)
+-if build_machine.system() == 'windows' or build_machine.system() == 'darwin' or build_machine.system() == 'freebsd' or not cc.links('#include <argp.h>\nstatic error_t parse_opt (int key, char *arg, struct argp_state *state) { argp_usage(state); return 0; }; void main() {}')
++if build_machine.system() == 'windows' or build_machine.system() == 'darwin' or build_machine.system() == 'freebsd' or not cc.links('#include <argp.h>\nerror_t parse_opt (int key, char *arg, struct argp_state *state) { argp_usage(state); return 0; }; void main() {}')
+     argplib = cc.find_library('argp', has_headers : ['argp.h'], required: false)
+     if not argplib.found()
+         argplib = dependency('argp-standalone')
meta-oe/recipes-support/zchunk/zchunk_1.2.0.bb deleted +0 -22
deleted file mode 100644
index 0baea5032a..0000000000
@@ -1,22 +0,0 @@
-DESCRIPTION = "A file format designed for highly efficient deltas while maintaining good compression"
-AUTHOR = "Jonathan Dieter"
-
-LICENSE = "BSD-2-Clause"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=daf6e68539f564601a5a5869c31e5242"
-
-SRC_URI = "git://github.com/zchunk/zchunk.git;protocol=https;branch=main"
-
-SRCREV = "dd6a30a1e4e8b738b0cafc682f3c00e7706134e5"
-S = "${WORKDIR}/git"
-
-DEPENDS = "\
-    curl \
-    zstd \
-    "
-
-DEPENDS:append:libc-musl = " argp-standalone"
-LDFLAGS:append:libc-musl = " -largp"
-
-inherit meson pkgconfig
-
-BBCLASSEXTEND = "native nativesdk"
meta-oe/recipes-support/zchunk/zchunk_1.2.4.bb new file +25 -1
new file mode 100644
index 0000000000..b4fd027603
@@ -0,0 +1,25 @@
+DESCRIPTION = "A file format designed for highly efficient deltas while maintaining good compression"
+AUTHOR = "Jonathan Dieter"
+
+LICENSE = "BSD-2-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=daf6e68539f564601a5a5869c31e5242"
+
+SRC_URI = "git://github.com/zchunk/zchunk.git;protocol=https;branch=main \
+           file://clang.patch"
+
+SRCREV = "0bed8496262a71beadccd4e562bdac093ef6e06f"
+S = "${WORKDIR}/git"
+
+DEPENDS = "zstd"
+DEPENDS:append:libc-musl = " argp-standalone"
+
+inherit meson pkgconfig lib_package
+
+PACKAGECONFIG ??= "openssl zckdl"
+
+# zckdl gets packaged into zchunk-bin
+PACKAGECONFIG[zckdl] = "-Dwith-curl=enabled,-Dwith-curl=disabled,curl"
+# Use OpenSSL primitives for SHA
+PACKAGECONFIG[openssl] = "-Dwith-openssl=enabled,-Dwith-openssl=disabled,openssl"
+
+BBCLASSEXTEND = "native nativesdk"
 
 
 
-=-=-=-=-=-=-=-=-=-=-=-

Links: You receive all messages sent to this group.
View/Reply Online (#101223): https://lists.openembedded.org/g/openembedded-devel/message/101223
Mute This Topic: https://lists.openembedded.org/mt/97181425/3618551
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,        Managing Director: Erika Unter
HRB 165235 Munich,   Office: Kirchenstr.5, 82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: [email protected]
=====================================================================
#2 lore raw
Quoted 5 lines · Stefano Babic

Hi Ross,

Jonathan released a new version of zchunk 1.3.0, that fixes some huge memory consumption on embedded system. What about to skip 1.2.4 and just upgrade to 1.3.0 ? Or do you prefer I send a patch after you merged 1.2.4 ?

Send a patch on top of master-next

Quoted 158 lines

Best regards,
Stefano

Quoted 8 lines · Ross Burton

Add a patch submitted upstream to fix the argp detection with clang.

---
  .../recipes-support/zchunk/files/clang.patch  | 35 +++++++++++++++++++
  .../recipes-support/zchunk/zchunk_1.2.0.bb    | 22 ------------
  .../recipes-support/zchunk/zchunk_1.2.4.bb    | 25 +++++++++++++
  3 files changed, 60 insertions(+), 22 deletions(-)

Review

Quoted 5 lines

create mode 100644 meta-oe/recipes-support/zchunk/files/clang.patch delete mode 100644 meta-oe/recipes-support/zchunk/zchunk_1.2.0.bb create mode 100644 meta-oe/recipes-support/zchunk/zchunk_1.2.4.bb

(quoted diff) +0 -0

b/meta-oe/recipes-support/zchunk/files/clang.patch

Quoted 8 lines

new file mode 100644
index 0000000000..86faf4aac7

meta-oe/recipes-support/zchunk/files/clang.patch new file +3 -0
@@ -0,0 +1,35 @@
+From e69d907c3fe8765ce50ce1258648ebc8283ef8a7 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Wed, 22 Feb 2023 14:55:07 -0800

meta-oe/recipes-support/zchunk/files/clang.patch line 13

Quoted 10 lines
meta-oe/recipes-support/zchunk/files/clang.patch new file +10 -0
+Subject: [PATCH] meson: Use global function in argp check
+
+clang is optimizing away parse_opt() since its marked static and not
+used in main(), make life a bit harder for clang :)
+removing static now emits the global symbols to be resolved during link
+and when libargp is missing the error is thrown rightly
+
+riscv64-yoe-linux-musl-ld: /tmp/a-5ba039.o: in function `.Lpcrel_hi0':
+a.c:(.text+0x44): undefined reference to `argp_state_help'
+clang-16: error: linker command failed with exit code 1 (use -v to see

invocation)

Quoted 8 lines
meta-oe/recipes-support/zchunk/files/clang.patch new file +8 -0
+
+Signed-off-by: Khem Raj <[email protected]>
+
+Upstream-Status: Submitted [https://github.com/zchunk/zchunk/pull/92/]
+Signed-off-by: Ross Burton <[email protected]>
+---
+ meson.build | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)

meta-oe/recipes-support/zchunk/files/clang.patch

Quoted 10 lines
meta-oe/recipes-support/zchunk/files/clang.patch new file +10 -0
+
+diff --git a/meson.build b/meson.build
+index 3b92d58..ab54abd 100644
+--- a/meson.build
++++ b/meson.build
+@@ -57,7 +57,7 @@ if host_machine.system() == 'windows'
+ endif
+
+ # argp-standalone dependency (if required)
+-if build_machine.system() == 'windows' or build_machine.system() ==

'darwin' or build_machine.system() == 'freebsd' or not cc.links('#include <argp.h>\nstatic error_t parse_opt (int key, char *arg, struct argp_state *state) { argp_usage(state); return 0; }; void main() {}')

meta-oe/recipes-support/zchunk/files/clang.patch line 32

Quoted 1 line
meta-oe/recipes-support/zchunk/files/clang.patch new file +1 -0
++if build_machine.system() == 'windows' or build_machine.system() ==

'darwin' or build_machine.system() == 'freebsd' or not cc.links('#include <argp.h>\nerror_t parse_opt (int key, char *arg, struct argp_state *state) { argp_usage(state); return 0; }; void main() {}')

meta-oe/recipes-support/zchunk/files/clang.patch line 33

Quoted 1 line
meta-oe/recipes-support/zchunk/files/clang.patch new file +1 -0
+     argplib = cc.find_library('argp', has_headers : ['argp.h'],

required: false)

Review

Quoted 3 lines
meta-oe/recipes-support/zchunk/files/clang.patch new file +2 -0
+     if not argplib.found()
+         argplib = dependency('argp-standalone')
(quoted diff) +0 -0

b/meta-oe/recipes-support/zchunk/zchunk_1.2.0.bb

meta-oe/recipes-support/zchunk/zchunk_1.2.0.bb line 1

Quoted 6 lines

deleted file mode 100644
index 0baea5032a..0000000000

meta-oe/recipes-support/zchunk/zchunk_1.2.0.bb deleted +0 -1
@@ -1,22 +0,0 @@
-DESCRIPTION = "A file format designed for highly efficient deltas while

maintaining good compression"

meta-oe/recipes-support/zchunk/zchunk_1.2.0.bb

Quoted 6 lines
meta-oe/recipes-support/zchunk/zchunk_1.2.0.bb deleted +0 -6
-AUTHOR = "Jonathan Dieter"
-
-LICENSE = "BSD-2-Clause"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=daf6e68539f564601a5a5869c31e5242"
-
-SRC_URI = "git://

github.com/zchunk/zchunk.git;protocol=https;branch=main"

Review

Quoted 16 lines
meta-oe/recipes-support/zchunk/zchunk_1.2.0.bb deleted +0 -15
-
-SRCREV = "dd6a30a1e4e8b738b0cafc682f3c00e7706134e5"
-S = "${WORKDIR}/git"
-
-DEPENDS = "\
-    curl \
-    zstd \
-    "
-
-DEPENDS:append:libc-musl = " argp-standalone"
-LDFLAGS:append:libc-musl = " -largp"
-
-inherit meson pkgconfig
-
-BBCLASSEXTEND = "native nativesdk"
(quoted diff) +0 -0

b/meta-oe/recipes-support/zchunk/zchunk_1.2.4.bb

meta-oe/recipes-support/zchunk/zchunk_1.2.4.bb line 1

Quoted 6 lines

new file mode 100644
index 0000000000..b4fd027603

meta-oe/recipes-support/zchunk/zchunk_1.2.4.bb new file +1 -0
@@ -0,0 +1,25 @@
+DESCRIPTION = "A file format designed for highly efficient deltas while

maintaining good compression"

meta-oe/recipes-support/zchunk/zchunk_1.2.4.bb

Quoted 6 lines
meta-oe/recipes-support/zchunk/zchunk_1.2.4.bb new file +6 -0
+AUTHOR = "Jonathan Dieter"
+
+LICENSE = "BSD-2-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=daf6e68539f564601a5a5869c31e5242"
+
+SRC_URI = "git://

github.com/zchunk/zchunk.git;protocol=https;branch=main \

Quoted 6 lines
meta-oe/recipes-support/zchunk/zchunk_1.2.4.bb new file +6 -0
+           file://clang.patch"
+
+SRCREV = "0bed8496262a71beadccd4e562bdac093ef6e06f"
+S = "${WORKDIR}/git"
+
+DEPENDS = "zstd"

meta-oe/recipes-support/zchunk/zchunk_1.2.4.bb

Quoted 10 lines
meta-oe/recipes-support/zchunk/zchunk_1.2.4.bb new file +10 -0
+DEPENDS:append:libc-musl = " argp-standalone"
+
+inherit meson pkgconfig lib_package
+
+PACKAGECONFIG ??= "openssl zckdl"
+
+# zckdl gets packaged into zchunk-bin
+PACKAGECONFIG[zckdl] = "-Dwith-curl=enabled,-Dwith-curl=disabled,curl"
+# Use OpenSSL primitives for SHA
+PACKAGECONFIG[openssl] =

"-Dwith-openssl=enabled,-Dwith-openssl=disabled,openssl"

meta-oe/recipes-support/zchunk/zchunk_1.2.4.bb line 25

Quoted 7 lines
meta-oe/recipes-support/zchunk/zchunk_1.2.4.bb new file +2 -0
+
+BBCLASSEXTEND = "native nativesdk"

--
=====================================================================
DENX Software Engineering GmbH, Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, 82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: [email protected]
=====================================================================

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#101257):
https://lists.openembedded.org/g/openembedded-devel/message/101257
Mute This Topic: https://lists.openembedded.org/mt/97181425/1997914
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-