Skip to contentSkip to conversation

poke: new package

PATCH Superseded Romain Naour 3 participants 12 messages May 2, 2021 – May 17, 2021

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover poke: new package

This series add poke package into Buildroot.

In order to build poke on riscv, this series enable riscv support in libatomic_ops along with a bdwgc fix for riscv64.

The uClibc-ng support has been difficult to add due to issues with gnulib similar we have with gdb package.
With the workaround applied, poke is working at runtime. This will be reported to gnulib project.

More info about poke:
https://www.youtube.com/watch?v=92Sykut06N8

Qemu testing:
https://asciinema.org/a/mtFjz7pcN1QuVbxdZhBUfBQTs

Romain Naour (5):
package/bdwgc: Fix 'undefined reference to __data_start' linker error
on RISC-V
package/libatomic_ops: enable for riscv32 and riscv64 package/poke: new package
package/poke: add optional json-c dependency
package/poke: enable uClibc-ng support

 package/Config.in                             |  1 +
 ...ference-to-__data_start-linker-error.patch | 33 ++++++++++++
 package/libatomic_ops/Config.in               |  2 +-
 ...ck-for-Tcl-Tk-if-disable-gui-is-spec.patch | 43 +++++++++++++++
 ...nfig.in-avoit-host-poisoning-while-c.patch | 45 ++++++++++++++++
 ...P2MAN-replace-by-true-when-cross-com.patch | 34 ++++++++++++
 package/poke/Config.in                        | 27 ++++++++++
 package/poke/poke.hash                        |  3 ++
 package/poke/poke.mk                          | 54 +++++++++++++++++++
 9 files changed, 241 insertions(+), 1 deletion(-)
 create mode 100644 package/bdwgc/0001-Fix-undefined-reference-to-__data_start-linker-error.patch
 create mode 100644 package/poke/0001-build-do-not-check-for-Tcl-Tk-if-disable-gui-is-spec.patch
 create mode 100644 package/poke/0002-jitter-jitter-config.in-avoit-host-poisoning-while-c.patch
 create mode 100644 package/poke/0003-configure.ac-HELP2MAN-replace-by-true-when-cross-com.patch
 create mode 100644 package/poke/Config.in
 create mode 100644 package/poke/poke.hash
 create mode 100644 package/poke/poke.mk
Signature · 1 line
2.30.2
#1 lore raw

PATCH 1/5 package/bdwgc: Fix 'undefined reference to __data_start' linker error on RISC-V

Backport an upstream patch fixing a link issue with libgc.so on RISC-V

riscv64-buildroot-linux-musl/sysroot/usr/lib/libgc.so: undefined reference to `__data_start'

https://gitlab.com/kubu93/buildroot/-/jobs/1229888983

---
 ...ference-to-__data_start-linker-error.patch | 33 +++++++++++++++++++
 1 file changed, 33 insertions(+)
 create mode 100644 package/bdwgc/0001-Fix-undefined-reference-to-__data_start-linker-error.patch
package/bdwgc/0001-Fix-undefined-reference-to-__data_start-linker-error.patch new file +33 -0
new file mode 100644
index 0000000000..81221c9f66
@@ -0,0 +1,33 @@
+From 301ef15aefa6764466c374d07efb511b1c3862cc Mon Sep 17 00:00:00 2001
+From: Nikita Ermakov <[email protected]>
+Date: Wed, 20 May 2020 17:57:17 +0300
+Subject: [PATCH] Fix 'undefined reference to __data_start' linker error on
+ RISC-V
+
+Issue #294 (bdwgc).
+
+* include/private/gcconfig.h [RISCV && LINUX] (__data_start): Add
+attribute(weak).
+
+(cherry picked from commit 538562ad01b181f4cc3913da1ac06a77945cd9b9)
+Signed-off-by: Romain Naour <[email protected]>
+---
+ include/private/gcconfig.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/include/private/gcconfig.h b/include/private/gcconfig.h
+index d9d45da1..d6cefa6f 100644
+--- a/include/private/gcconfig.h
++++ b/include/private/gcconfig.h
+@@ -2943,7 +2943,7 @@ EXTERN_C_BEGIN
+ #   define ALIGNMENT (CPP_WORDSZ/8)
+ #   ifdef LINUX
+ #     define OS_TYPE "LINUX"
+-      extern int __data_start[];
++      extern int __data_start[] __attribute__((__weak__));
+ #     define DATASTART ((ptr_t)__data_start)
+ #     define LINUX_STACKBOTTOM
+ #     define DYNAMIC_LOADING
+-- 
+2.30.2
+
Signature · 1 line
2.30.2
#2 lore raw

PATCH 1/5 package/bdwgc: Fix 'undefined reference to __data_start' linker error on RISC-V

Quoted 8 lines · Romain Naour

Backport an upstream patch fixing a link issue with libgc.so on RISC-V

riscv64-buildroot-linux-musl/sysroot/usr/lib/libgc.so: undefined reference to `__data_start'

https://gitlab.com/kubu93/buildroot/-/jobs/1229888983

Alistair

Quoted 51 lines
---
 ...ference-to-__data_start-linker-error.patch | 33 +++++++++++++++++++
 1 file changed, 33 insertions(+)
 create mode 100644 package/bdwgc/0001-Fix-undefined-reference-to-__data_start-linker-error.patch
package/bdwgc/0001-Fix-undefined-reference-to-__data_start-linker-error.patch new file +33 -1
new file mode 100644
index 0000000000..81221c9f66
@@ -0,0 +1,33 @@
+From 301ef15aefa6764466c374d07efb511b1c3862cc Mon Sep 17 00:00:00 2001
+From: Nikita Ermakov <[email protected]>
+Date: Wed, 20 May 2020 17:57:17 +0300
+Subject: [PATCH] Fix 'undefined reference to __data_start' linker error on
+ RISC-V
+
+Issue #294 (bdwgc).
+
+* include/private/gcconfig.h [RISCV && LINUX] (__data_start): Add
+attribute(weak).
+
+(cherry picked from commit 538562ad01b181f4cc3913da1ac06a77945cd9b9)
+Signed-off-by: Romain Naour <[email protected]>
+---
+ include/private/gcconfig.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/include/private/gcconfig.h b/include/private/gcconfig.h
+index d9d45da1..d6cefa6f 100644
+--- a/include/private/gcconfig.h
++++ b/include/private/gcconfig.h
+@@ -2943,7 +2943,7 @@ EXTERN_C_BEGIN
+ #   define ALIGNMENT (CPP_WORDSZ/8)
+ #   ifdef LINUX
+ #     define OS_TYPE "LINUX"
+-      extern int __data_start[];
++      extern int __data_start[] __attribute__((__weak__));
+ #     define DATASTART ((ptr_t)__data_start)
+ #     define LINUX_STACKBOTTOM
+ #     define DYNAMIC_LOADING
+--
+2.30.2
+
--

2.30.2

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

#3 lore raw

PATCH 1/5 package/bdwgc: Fix 'undefined reference to __data_start' linker error on RISC-V

In reply to Romain Naour

Romain, All,

On 2021-05-02 23:49 +0200, Romain Naour spake thusly:

Quoted 7 lines

Backport an upstream patch fixing a link issue with libgc.so on RISC-V

riscv64-buildroot-linux-musl/sysroot/usr/lib/libgc.so: undefined reference to `__data_start'

https://gitlab.com/kubu93/buildroot/-/jobs/1229888983

I considered applying for master, but that depends on libatomic-ops support on riscv, which is arguably a new feature, so does not belong to master.

Applied to next, thanks.

Regards,
Yann E. MORIN.

Quoted 51 lines
---
 ...ference-to-__data_start-linker-error.patch | 33 +++++++++++++++++++
 1 file changed, 33 insertions(+)
 create mode 100644 package/bdwgc/0001-Fix-undefined-reference-to-__data_start-linker-error.patch
package/bdwgc/0001-Fix-undefined-reference-to-__data_start-linker-error.patch new file +33 -0
new file mode 100644
index 0000000000..81221c9f66
@@ -0,0 +1,33 @@
+From 301ef15aefa6764466c374d07efb511b1c3862cc Mon Sep 17 00:00:00 2001
+From: Nikita Ermakov <[email protected]>
+Date: Wed, 20 May 2020 17:57:17 +0300
+Subject: [PATCH] Fix 'undefined reference to __data_start' linker error on
+ RISC-V
+
+Issue #294 (bdwgc).
+
+* include/private/gcconfig.h [RISCV && LINUX] (__data_start): Add
+attribute(weak).
+
+(cherry picked from commit 538562ad01b181f4cc3913da1ac06a77945cd9b9)
+Signed-off-by: Romain Naour <[email protected]>
+---
+ include/private/gcconfig.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/include/private/gcconfig.h b/include/private/gcconfig.h
+index d9d45da1..d6cefa6f 100644
+--- a/include/private/gcconfig.h
++++ b/include/private/gcconfig.h
+@@ -2943,7 +2943,7 @@ EXTERN_C_BEGIN
+ #   define ALIGNMENT (CPP_WORDSZ/8)
+ #   ifdef LINUX
+ #     define OS_TYPE "LINUX"
+-      extern int __data_start[];
++      extern int __data_start[] __attribute__((__weak__));
+ #     define DATASTART ((ptr_t)__data_start)
+ #     define LINUX_STACKBOTTOM
+ #     define DYNAMIC_LOADING
+-- 
+2.30.2
+
Signature · 6 lines
2.30.2

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#4 lore raw

PATCH 2/5 package/libatomic_ops: enable for riscv32 and riscv64

In reply to Romain Naour

The riscv support has been added since v7.6.4 release.

https://github.com/ivmai/libatomic_ops/commit/137643f1417ded071c56e05401ca6a3c16492d96

---
 package/libatomic_ops/Config.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/libatomic_ops/Config.in +1 -1
index e9206f3395..6de5979aeb 100644
@@ -1,6 +1,6 @@
 config BR2_PACKAGE_LIBATOMIC_OPS_ARCH_SUPPORTS
 	bool
-	default y if BR2_arm || BR2_armeb || BR2_aarch64 || BR2_i386 || BR2_sparc || BR2_sparc64 || BR2_powerpc || BR2_powerpc64 || BR2_powerpc64le || BR2_x86_64 || BR2_mips || BR2_mipsel || BR2_mips64 || BR2_mips64el
+	default y if BR2_arm || BR2_armeb || BR2_aarch64 || BR2_i386 || BR2_sparc || BR2_sparc64 || BR2_powerpc || BR2_powerpc64 || BR2_powerpc64le || BR2_x86_64 || BR2_mips || BR2_mipsel || BR2_mips64 || BR2_mips64el || BR2_riscv
 	# Unsupported for MIPS R6
 	depends on !BR2_MIPS_CPU_MIPS32R6 && !BR2_MIPS_CPU_MIPS64R6
 
Signature · 1 line
2.30.2
#5 lore raw

PATCH 2/5 package/libatomic_ops: enable for riscv32 and riscv64

Quoted 6 lines · Romain Naour

The riscv support has been added since v7.6.4 release.

https://github.com/ivmai/libatomic_ops/commit/137643f1417ded071c56e05401ca6a3c16492d96

Alistair

Quoted 23 lines
---
 package/libatomic_ops/Config.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/libatomic_ops/Config.in +1 -2
index e9206f3395..6de5979aeb 100644
@@ -1,6 +1,6 @@
 config BR2_PACKAGE_LIBATOMIC_OPS_ARCH_SUPPORTS
        bool
-       default y if BR2_arm || BR2_armeb || BR2_aarch64 || BR2_i386 || BR2_sparc || BR2_sparc64 || BR2_powerpc || BR2_powerpc64 || BR2_powerpc64le || BR2_x86_64 || BR2_mips || BR2_mipsel || BR2_mips64 || BR2_mips64el
+       default y if BR2_arm || BR2_armeb || BR2_aarch64 || BR2_i386 || BR2_sparc || BR2_sparc64 || BR2_powerpc || BR2_powerpc64 || BR2_powerpc64le || BR2_x86_64 || BR2_mips || BR2_mipsel || BR2_mips64 || BR2_mips64el || BR2_riscv
        # Unsupported for MIPS R6
        depends on !BR2_MIPS_CPU_MIPS32R6 && !BR2_MIPS_CPU_MIPS64R6
 
--

2.30.2

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

#6 lore raw

PATCH 2/5 package/libatomic_ops: enable for riscv32 and riscv64

In reply to Romain Naour

Romain, All,

On 2021-05-02 23:49 +0200, Romain Naour spake thusly:

Quoted 14 lines

The riscv support has been added since v7.6.4 release.

https://github.com/ivmai/libatomic_ops/commit/137643f1417ded071c56e05401ca6a3c16492d96

---
 package/libatomic_ops/Config.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/libatomic_ops/Config.in +0 -0
index e9206f3395..6de5979aeb 100644

package/libatomic_ops/Config.in line 3

Quoted 4 lines
package/libatomic_ops/Config.in +1 -1
@@ -1,6 +1,6 @@
 config BR2_PACKAGE_LIBATOMIC_OPS_ARCH_SUPPORTS
 	bool
-	default y if BR2_arm || BR2_armeb || BR2_aarch64 || BR2_i386 || BR2_sparc || BR2_sparc64 || BR2_powerpc || BR2_powerpc64 || BR2_powerpc64le || BR2_x86_64 || BR2_mips || BR2_mipsel || BR2_mips64 || BR2_mips64el
+	default y if BR2_arm || BR2_armeb || BR2_aarch64 || BR2_i386 || BR2_sparc || BR2_sparc64 || BR2_powerpc || BR2_powerpc64 || BR2_powerpc64le || BR2_x86_64 || BR2_mips || BR2_mipsel || BR2_mips64 || BR2_mips64el || BR2_riscv

This line is waaayy too long. I've split it, reordered the archs alphabetically, and groupped rlated archs together (i386 with x86_64).

Riscv support is a new feature, so: applied to next, thanks.

Regards,
Yann E. MORIN.

Quoted 10 lines
package/libatomic_ops/Config.in +0 -0
 	# Unsupported for MIPS R6
 	depends on !BR2_MIPS_CPU_MIPS32R6 && !BR2_MIPS_CPU_MIPS64R6
 
Signature · 6 lines
2.30.2

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#7 lore raw

PATCH 3/5 package/poke: new package

In reply to Romain Naour

Backport a patch to disable tcl/tk dependencies when gui support is disabled.

Add a local patch to workaround a path poisoning issue. Issue reported upstream.

Add another local patch when HELP2MAN is missing.

Disable uClibc-ng toolchain for now due to issues with bundled gnulib.

See:
http://www.jemarch.net/poke-1.0-relnotes.html
http://www.jemarch.net/poke-1.1-relnotes.html
http://www.jemarch.net/poke-1.2-relnotes.html

Cc Jose E. Marchesi <[email protected]>
Cc Luca Saiu <[email protected]>

---
Build tested with test-pkg and Runtime tested on gitlab:
https://gitlab.com/kubu93/buildroot/-/jobs/1229817663

---
 package/Config.in                             |  1 +
 ...ck-for-Tcl-Tk-if-disable-gui-is-spec.patch | 43 ++++++++++++++++++
 ...nfig.in-avoit-host-poisoning-while-c.patch | 45 +++++++++++++++++++
 ...P2MAN-replace-by-true-when-cross-com.patch | 34 ++++++++++++++
 package/poke/Config.in                        | 31 +++++++++++++
 package/poke/poke.hash                        |  3 ++
 package/poke/poke.mk                          | 23 ++++++++++
 7 files changed, 180 insertions(+)
 create mode 100644 package/poke/0001-build-do-not-check-for-Tcl-Tk-if-disable-gui-is-spec.patch
 create mode 100644 package/poke/0002-jitter-jitter-config.in-avoit-host-poisoning-while-c.patch
 create mode 100644 package/poke/0003-configure.ac-HELP2MAN-replace-by-true-when-cross-com.patch
 create mode 100644 package/poke/Config.in
 create mode 100644 package/poke/poke.hash
 create mode 100644 package/poke/poke.mk
package/Config.in +1 -0
index 6181aaac2c..922ae99e13 100644
@@ -126,6 +126,7 @@ menu "Debugging, profiling and benchmark"
 	source "package/pcm-tools/Config.in"
 	source "package/piglit/Config.in"
 	source "package/ply/Config.in"
+	source "package/poke/Config.in"
 	source "package/ptm2human/Config.in"
 	source "package/pv/Config.in"
 	source "package/racehound/Config.in"
package/poke/0001-build-do-not-check-for-Tcl-Tk-if-disable-gui-is-spec.patch new file +43 -0

43 lines not on this page · raw message

package/poke/0002-jitter-jitter-config.in-avoit-host-poisoning-while-c.patch new file +45 -0

45 lines not on this page · raw message

package/poke/0003-configure.ac-HELP2MAN-replace-by-true-when-cross-com.patch new file +34 -0
new file mode 100644
index 0000000000..f217c917f1
@@ -0,0 +1,34 @@
+From 8ba76a5a7ce311f67890199c5595bc1f626495ad Mon Sep 17 00:00:00 2001
+From: Romain Naour <[email protected]>
+Date: Fri, 30 Apr 2021 15:43:59 +0200
+Subject: [PATCH] configure.ac: HELP2MAN replace ':' by 'true' when
+ cross-compiling
+
+Avoid:
+/usr/bin/make  ./../poke/poke
+../run \
+  : -p poke --name="The GNU extensible binary editor" \
+      ./../poke/poke -o ./poke.1
+../run: line 51: exec: :: not found
+
+Signed-off-by: Romain Naour <[email protected]>
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index c2f0760a..93769ef9 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -74,7 +74,7 @@ gl_LIBTEXTSTYLE_OPTIONAL([0.20.5])
+ if test $cross_compiling = no; then
+   AM_MISSING_PROG(HELP2MAN, help2man)
+ else
+-  HELP2MAN=:
++  HELP2MAN=true
+ fi
+ 
+ dnl recfix is part of the GNU recutils suite, and is used in cfg.mk to
+-- 
+2.30.2
+
package/poke/Config.in new file +31 -0
new file mode 100644
index 0000000000..5d391bfb43
@@ -0,0 +1,31 @@
+config BR2_PACKAGE_POKE
+	bool "poke"
+	depends on BR2_PACKAGE_LIBATOMIC_OPS_ARCH_SUPPORTS # bdwgc
+	depends on BR2_PACKAGE_BUSYBOX_SHOW_OTHERS # less
+	depends on BR2_USE_WCHAR # needs wctomb
+	depends on BR2_TOOLCHAIN_HAS_THREADS_NPTL
+	depends on BR2_TOOLCHAIN_USES_GLIBC || BR2_TOOLCHAIN_USES_MUSL # gnulib
+	select BR2_PACKAGE_BDWGC
+	select BR2_PACKAGE_LESS # runtime
+	select BR2_PACKAGE_READLINE
+	help
+	  GNU poke is a new interactive editor for binary data. Not
+	  limited to editing basic entities such as bits and bytes,
+	  it provides a full-fledged procedural, interactive
+	  programming language designed to describe data structures
+	  and to operate on them. Once a user has defined a structure
+	  for binary data (usually matching some file format) she can
+	  search, inspect, create, shuffle and modify abstract entities
+	  such as ELF relocations, MP3 tags, DWARF expressions,
+	  partition table entries, and so on, with primitives
+	  resembling simple editing of bits and bytes. The program
+	  comes with a library of already written descriptions (or
+	  "pickles" in poke parlance) for many binary formats.
+
+	  https://www.gnu.org/software/poke/
+
+comment "poke needs a toolchain w/ NPTL, wchar"
+	depends on !BR2_TOOLCHAIN_HAS_THREADS_NPTL || !BR2_USE_WCHAR
+
+comment "poke needs glibc or musl"
+	depends on !(BR2_TOOLCHAIN_USES_GLIBC || BR2_TOOLCHAIN_USES_MUSL)
package/poke/poke.hash new file +3 -0
new file mode 100644
index 0000000000..f8d23e635a
@@ -0,0 +1,3 @@
+# Locally calculated
+sha256  f61cf8da5b64c01a1359373725aad1ca257f35c1c9269e4d50dd0664183ddf62  poke-1.2.tar.gz
+sha256  8ceb4b9ee5adedde47b31e975c1d90c73ad27b6b165a1dcd80c7c545eb65b903  COPYING
package/poke/poke.mk new file +23 -0
new file mode 100644
index 0000000000..ecf2221acd
@@ -0,0 +1,23 @@
+################################################################################
+#
+# poke
+#
+################################################################################
+
+POKE_VERSION = 1.2
+POKE_SITE = $(BR2_GNU_MIRROR)/poke
+POKE_LICENSE = GPL-3.0+
+POKE_LICENSE_FILES = COPYING
+
+# 0001-build-do-not-check-for-Tcl-Tk-if-disable-gui-is-spec.patch
+# 0003-configure.ac-HELP2MAN-replace-by-false-when-cross-co.patch
+POKE_AUTORECONF = YES
+
+POKE_DEPENDENCIES = host-flex host-bison host-pkgconf bdwgc readline
+
+POKE_CONF_OPTS = --disable-gui \
+	--disable-libnbd \
+	--disable-mi \
+	--with-libreadline-prefix=$(STAGING_DIR)
+
+$(eval $(autotools-package))
Signature · 1 line
2.30.2
#8 lore raw

PATCH 3/5 package/poke: new package

On 2021-05-02 23:49 +0200, Romain Naour spake thusly:

Quoted 5 lines

Backport a patch to disable tcl/tk dependencies when gui support is disabled.

Add a local patch to workaround a path poisoning issue. Issue reported upstream.

Upstream has applied a patch similar to yours:

    http://git.ageinghacker.net/jitter/commit?id=428406c7b8d4c20f3472d41ed57c12c1a88ad37e
Quoted 5 lines

Add another local patch when HELP2MAN is missing.

Disable uClibc-ng toolchain for now due to issues with bundled gnulib.

Quoted 8 lines

See:
http://www.jemarch.net/poke-1.0-relnotes.html
http://www.jemarch.net/poke-1.1-relnotes.html
http://www.jemarch.net/poke-1.2-relnotes.html

Cc Jose E. Marchesi <[email protected]>
Cc Luca Saiu <[email protected]>

[--SNIP--]

Quoted 27 lines
package/poke/Config.in new file +21 -0
new file mode 100644
index 0000000000..5d391bfb43
@@ -0,0 +1,31 @@
+config BR2_PACKAGE_POKE
+	bool "poke"
+	depends on BR2_PACKAGE_LIBATOMIC_OPS_ARCH_SUPPORTS # bdwgc
+	depends on BR2_PACKAGE_BUSYBOX_SHOW_OTHERS # less
+	depends on BR2_USE_WCHAR # needs wctomb
+	depends on BR2_TOOLCHAIN_HAS_THREADS_NPTL
+	depends on BR2_TOOLCHAIN_USES_GLIBC || BR2_TOOLCHAIN_USES_MUSL # gnulib
+	select BR2_PACKAGE_BDWGC
+	select BR2_PACKAGE_LESS # runtime
+	select BR2_PACKAGE_READLINE
+	help
+	  GNU poke is a new interactive editor for binary data. Not
+	  limited to editing basic entities such as bits and bytes,
+	  it provides a full-fledged procedural, interactive
+	  programming language designed to describe data structures
+	  and to operate on them. Once a user has defined a structure
+	  for binary data (usually matching some file format) she can
+	  search, inspect, create, shuffle and modify abstract entities
+	  such as ELF relocations, MP3 tags, DWARF expressions,
+	  partition table entries, and so on, with primitives
+	  resembling simple editing of bits and bytes. The program

package/poke/Config.in line 31

Quoted 10 lines
package/poke/Config.in new file +10 -0
+	  comes with a library of already written descriptions (or
+	  "pickles" in poke parlance) for many binary formats.
+
+	  https://www.gnu.org/software/poke/
+
+comment "poke needs a toolchain w/ NPTL, wchar"
+	depends on !BR2_TOOLCHAIN_HAS_THREADS_NPTL || !BR2_USE_WCHAR
+
+comment "poke needs glibc or musl"
+	depends on !(BR2_TOOLCHAIN_USES_GLIBC || BR2_TOOLCHAIN_USES_MUSL)

This can (should) be made a single comment:

comment "poke needs a glibc or musl toolchain w/ NPTL, wchar"
depends on ...

Quoted 15 lines
package/poke/poke.hash new file +3 -0
new file mode 100644
index 0000000000..f8d23e635a
@@ -0,0 +1,3 @@
+# Locally calculated
+sha256  f61cf8da5b64c01a1359373725aad1ca257f35c1c9269e4d50dd0664183ddf62  poke-1.2.tar.gz
+sha256  8ceb4b9ee5adedde47b31e975c1d90c73ad27b6b165a1dcd80c7c545eb65b903  COPYING
package/poke/poke.mk new file +0 -0
new file mode 100644
index 0000000000..ecf2221acd

package/poke/poke.mk line 10

Quoted 10 lines
package/poke/poke.mk new file +10 -0
@@ -0,0 +1,23 @@
+################################################################################
+#
+# poke
+#
+################################################################################
+
+POKE_VERSION = 1.2
+POKE_SITE = $(BR2_GNU_MIRROR)/poke
+POKE_LICENSE = GPL-3.0+
+POKE_LICENSE_FILES = COPYING

poke bundles jitter and gnulib; we need the licensing info for those, too, license names and files (jitter: GPL-3.0+; gnulib: a bit of a mess.)

package/poke/poke.mk line 21

Quoted 10 lines
package/poke/poke.mk new file +10 -0
+# 0001-build-do-not-check-for-Tcl-Tk-if-disable-gui-is-spec.patch
+# 0003-configure.ac-HELP2MAN-replace-by-false-when-cross-co.patch
+POKE_AUTORECONF = YES
+
+POKE_DEPENDENCIES = host-flex host-bison host-pkgconf bdwgc readline
+
+POKE_CONF_OPTS = --disable-gui \
+	--disable-libnbd \
+	--disable-mi \
+	--with-libreadline-prefix=$(STAGING_DIR)

Nitpick: with multi-line assignment, have even the first item on its own line:

    POKE_CONF_OPTS = \
        --disable-gui \
        --disable-libnbd \
        --disable-mi \
        --with-libreadline-prefix=$(STAGING_DIR)
Quoted 8 lines
package/poke/poke.mk new file +1 -0
+$(eval $(autotools-package))
Signature · 6 lines
2.30.2

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#9 lore raw

PATCH 3/5 package/poke: new package

Hello Yann,

Thanks for your review :)

Le 17/05/2021 ? 15:25, Yann E. MORIN a ?crit?:

Quoted 9 lines

On 2021-05-02 23:49 +0200, Romain Naour spake thusly:

Quoted 5 lines

Backport a patch to disable tcl/tk dependencies when gui support is disabled.

Add a local patch to workaround a path poisoning issue. Issue reported upstream.

Upstream has applied a patch similar to yours:

    http://git.ageinghacker.net/jitter/commit?id=428406c7b8d4c20f3472d41ed57c12c1a88ad37e

It seems I was involved in this upstream patch :)

The patch was committed just after my testing but as explained the my patch, patching jitter-config.in.m4sh doesn't work well in Buildroot.

Quoted 55 lines
Quoted 6 lines

Add another local patch when HELP2MAN is missing.

Disable uClibc-ng toolchain for now due to issues with bundled gnulib.

Quoted 8 lines

See:
http://www.jemarch.net/poke-1.0-relnotes.html
http://www.jemarch.net/poke-1.1-relnotes.html
http://www.jemarch.net/poke-1.2-relnotes.html

Cc Jose E. Marchesi <[email protected]>
Cc Luca Saiu <[email protected]>

[--SNIP--]

Quoted 27 lines
package/poke/Config.in new file +21 -0
new file mode 100644
index 0000000000..5d391bfb43
@@ -0,0 +1,31 @@
+config BR2_PACKAGE_POKE
+	bool "poke"
+	depends on BR2_PACKAGE_LIBATOMIC_OPS_ARCH_SUPPORTS # bdwgc
+	depends on BR2_PACKAGE_BUSYBOX_SHOW_OTHERS # less
+	depends on BR2_USE_WCHAR # needs wctomb
+	depends on BR2_TOOLCHAIN_HAS_THREADS_NPTL
+	depends on BR2_TOOLCHAIN_USES_GLIBC || BR2_TOOLCHAIN_USES_MUSL # gnulib
+	select BR2_PACKAGE_BDWGC
+	select BR2_PACKAGE_LESS # runtime
+	select BR2_PACKAGE_READLINE
+	help
+	  GNU poke is a new interactive editor for binary data. Not
+	  limited to editing basic entities such as bits and bytes,
+	  it provides a full-fledged procedural, interactive
+	  programming language designed to describe data structures
+	  and to operate on them. Once a user has defined a structure
+	  for binary data (usually matching some file format) she can
+	  search, inspect, create, shuffle and modify abstract entities
+	  such as ELF relocations, MP3 tags, DWARF expressions,
+	  partition table entries, and so on, with primitives
+	  resembling simple editing of bits and bytes. The program

package/poke/Config.in line 31

Quoted 10 lines
package/poke/Config.in new file +10 -0
+	  comes with a library of already written descriptions (or
+	  "pickles" in poke parlance) for many binary formats.
+
+	  https://www.gnu.org/software/poke/
+
+comment "poke needs a toolchain w/ NPTL, wchar"
+	depends on !BR2_TOOLCHAIN_HAS_THREADS_NPTL || !BR2_USE_WCHAR
+
+comment "poke needs glibc or musl"
+	depends on !(BR2_TOOLCHAIN_USES_GLIBC || BR2_TOOLCHAIN_USES_MUSL)

This can (should) be made a single comment:

Quoted 2 lines

comment "poke needs a glibc or musl toolchain w/ NPTL, wchar"
depends on ...

ok

Quoted 22 lines
Quoted 22 lines
package/poke/poke.hash new file +3 -0
new file mode 100644
index 0000000000..f8d23e635a
@@ -0,0 +1,3 @@
+# Locally calculated
+sha256  f61cf8da5b64c01a1359373725aad1ca257f35c1c9269e4d50dd0664183ddf62  poke-1.2.tar.gz
+sha256  8ceb4b9ee5adedde47b31e975c1d90c73ad27b6b165a1dcd80c7c545eb65b903  COPYING
package/poke/poke.mk new file +6 -0
new file mode 100644
index 0000000000..ecf2221acd
@@ -0,0 +1,23 @@
+################################################################################
+#
+# poke
+#
+################################################################################
+
Quoted 8 lines

package/poke/poke.mk line 10

Quoted 4 lines
package/poke/poke.mk new file +4 -0
+POKE_VERSION = 1.2
+POKE_SITE = $(BR2_GNU_MIRROR)/poke
+POKE_LICENSE = GPL-3.0+
+POKE_LICENSE_FILES = COPYING

poke bundles jitter and gnulib; we need the licensing info for those, too, license names and files (jitter: GPL-3.0+; gnulib: a bit of a mess.)

gnulib: Something like this ?

https://src.fedoraproject.org/rpms/gnulib/blob/rawhide/f/gnulib.spec#_53

The gnulib licensing is not the only problem... see the last patch to enable uClibc support. It remind me the coreutils package where a lot of gl_cv_func* are provided.

https://git.buildroot.net/buildroot/tree/package/coreutils/coreutils.mk?h=2021.02.2#n29

https://git.buildroot.net/buildroot/commit/?id=94b4383252694aedfc61b00a09043dc5450a52ba

Jitter development is closely related to Poke.
Maintainers will try to unbundle Jitter for the next Poke major release (Poke 2.0).

Quoted 15 lines

package/poke/poke.mk line 21

Quoted 11 lines
package/poke/poke.mk new file +10 -0
+# 0001-build-do-not-check-for-Tcl-Tk-if-disable-gui-is-spec.patch
+# 0003-configure.ac-HELP2MAN-replace-by-false-when-cross-co.patch
+POKE_AUTORECONF = YES
+
+POKE_DEPENDENCIES = host-flex host-bison host-pkgconf bdwgc readline
+
+POKE_CONF_OPTS = --disable-gui \
+	--disable-libnbd \
+	--disable-mi \
+	--with-libreadline-prefix=$(STAGING_DIR)

Nitpick: with multi-line assignment, have even the first item on its own line:

Quoted 5 lines
    POKE_CONF_OPTS = \
        --disable-gui \
        --disable-libnbd \
        --disable-mi \
        --with-libreadline-prefix=$(STAGING_DIR)

Ok.

Best regards,
Romain

Quoted 10 lines
Quoted 9 lines
package/poke/poke.mk new file +1 -0
+$(eval $(autotools-package))
Signature · 6 lines
2.30.2

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
#10 lore raw

PATCH 4/5 package/poke: add optional json-c dependency

In reply to Romain Naour

From [1]:
"The poke machine-interface uses a protocol to communicate with clients, which is based on JSON. poke uses the json-c library to parse and build JSON strings.
If this library is not found, poke will build without machine-interface support."

[1] https://git.savannah.nongnu.org/cgit/poke.git/tree/DEPENDENCIES?h=releases/poke-1.2#n55

Cc Jose E. Marchesi <[email protected]>
Cc Luca Saiu <[email protected]>
---
 package/poke/poke.mk | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
package/poke/poke.mk +7 -1
index ecf2221acd..268b9598d7 100644
@@ -17,7 +17,13 @@ POKE_DEPENDENCIES = host-flex host-bison host-pkgconf bdwgc readline
 
 POKE_CONF_OPTS = --disable-gui \
 	--disable-libnbd \
-	--disable-mi \
 	--with-libreadline-prefix=$(STAGING_DIR)
 
+ifeq ($(BR2_PACKAGE_JSON_C),y)
+POKE_DEPENDENCIES += json-c
+POKE_CONF_OPTS += --enable-mi
+else
+POKE_CONF_OPTS += --disable-mi
+endif
+
 $(eval $(autotools-package))
Signature · 1 line
2.30.2
#11 lore raw

PATCH 5/5 package/poke: enable uClibc-ng support

In reply to Romain Naour

poke bundle gnulib that doesn't support the case where host_os='linux-uclibc'. When cross-compiling, the guessed answers are mostly wrong and gnulib will try to replace snprintf with rpl_snprintf. This lead to "undefined reference to `rpl_snprintf'" errors.

---
 package/poke/Config.in |  4 ----
 package/poke/poke.mk   | 25 +++++++++++++++++++++++++
 2 files changed, 25 insertions(+), 4 deletions(-)
package/poke/Config.in +0 -4
index 5d391bfb43..762ed0221d 100644
@@ -4,7 +4,6 @@ config BR2_PACKAGE_POKE
 	depends on BR2_PACKAGE_BUSYBOX_SHOW_OTHERS # less
 	depends on BR2_USE_WCHAR # needs wctomb
 	depends on BR2_TOOLCHAIN_HAS_THREADS_NPTL
-	depends on BR2_TOOLCHAIN_USES_GLIBC || BR2_TOOLCHAIN_USES_MUSL # gnulib
 	select BR2_PACKAGE_BDWGC
 	select BR2_PACKAGE_LESS # runtime
 	select BR2_PACKAGE_READLINE
@@ -26,6 +25,3 @@ config BR2_PACKAGE_POKE
 
 comment "poke needs a toolchain w/ NPTL, wchar"
 	depends on !BR2_TOOLCHAIN_HAS_THREADS_NPTL || !BR2_USE_WCHAR
-
-comment "poke needs glibc or musl"
-	depends on !(BR2_TOOLCHAIN_USES_GLIBC || BR2_TOOLCHAIN_USES_MUSL)
package/poke/poke.mk +25 -0
index 268b9598d7..cff52d37bf 100644
@@ -15,6 +15,31 @@ POKE_AUTORECONF = YES
 
 POKE_DEPENDENCIES = host-flex host-bison host-pkgconf bdwgc readline
 
+# poke bundle gnulib that doesn't support the case where
+# host_os='linux-uclibc'. When cross-compiling, the guessed
+# answers are mostly wrong and gnulib will try to replace
+# snprintf with rpl_snprintf. This lead to "undefined reference
+# to `rpl_snprintf'" errors.
+ifeq ($(BR2_TOOLCHAIN_USES_UCLIBC),y)
+POKE_CONF_ENV = gl_cv_func_printf_positions=yes \
+	gl_cv_func_snprintf_retval_c99=yes \
+	gl_cv_func_printf_sizes_c99=yes \
+	gl_cv_func_printf_infinite_long_double=yes \
+	gl_cv_func_snprintf_retval_c99=yes \
+	gl_cv_func_snprintf_truncation_c99=yes \
+	gl_cv_func_snprintf_usable=yes \
+	gl_cv_func_strerror_0_works=yes \
+	gl_cv_header_working_stdint_h=yes \
+	gl_cv_func_printf_infinite=yes \
+	gl_cv_func_printf_flag_zero=yes \
+	gl_cv_func_printf_enomem=yes \
+	gl_cv_func_printf_directive_f=yes \
+	gl_cv_func_printf_directive_a=yes \
+	gl_cv_func_snprintf_directive_n=yes \
+	gl_cv_func_vsnprintf_posix=yes \
+	gl_cv_func_vsnprintf_zerosize_c99=yes
+endif
+
 POKE_CONF_OPTS = --disable-gui \
 	--disable-libnbd \
 	--with-libreadline-prefix=$(STAGING_DIR)
Signature · 1 line
2.30.2