Skip to contentSkip to conversation

package/poke: install libpoke.so to staging

PATCH Applied Romain Naour 2 participants 6 messages Jan 29, 2022 – Jan 30, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 package/poke: install libpoke.so to staging

Poke generate a library libpoke.so, so install it to staging.

---
 package/poke/poke.mk | 1 +
 1 file changed, 1 insertion(+)
package/poke/poke.mk +1 -0
index fed023e954..ddd03ae3b0 100644
@@ -13,6 +13,7 @@ POKE_LICENSE_FILES = COPYING jitter/COPYING
 # 0001-configure.ac-HELP2MAN-replace-by-false-when-cross-co.patch
 POKE_AUTORECONF = YES
 
+POKE_INSTALL_STAGING = YES
 POKE_DEPENDENCIES = host-flex host-bison host-pkgconf bdwgc readline
 
 # poke bundle gnulib that doesn't support the case where
Signature · 6 lines
2.31.1

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

PATCH 2/3 package/poke: disable minimal-threading with thumb or thumb2

Disable minimal-threading when thumb or thumb2 is enabled due to build and runtime issues.

After fixing the build issue "Error: invalid swi expression" with upstream, poke fail to run with the following error:

 # poke
 ERROR: specialized instruction beghl/retR (opcode 25) is defective but has no replacement
 [...]

Fixes:
https://gitlab.com/kubu93/buildroot/-/jobs/2030046871

Reported upstream [1].

[1] https://lists.gnu.org/archive/html/poke-devel/2022-01/msg00162.html

---
 package/poke/poke.mk | 9 +++++++++
 1 file changed, 9 insertions(+)
package/poke/poke.mk +9 -0
index ddd03ae3b0..91518f5854 100644
@@ -46,6 +46,15 @@ POKE_CONF_OPTS = \
 	--disable-libnbd \
 	--with-libreadline-prefix=$(STAGING_DIR)
 
+# Disable minimal-threading when thumb or thumb2 is enabled
+# due to runtime issue.
+# https://lists.gnu.org/archive/html/poke-devel/2022-01/msg00162.html
+ifeq ($(BR2_ARM_CPU_HAS_THUMB)$(BR2_ARM_CPU_HAS_THUMB2),y)
+POKE_CONF_OPTS += --disable-dispatch-minimal-threading
+else
+POKE_CONF_OPTS += --enable-dispatch-minimal-threading
+endif
+
 ifeq ($(BR2_PACKAGE_JSON_C),y)
 POKE_DEPENDENCIES += json-c
 POKE_CONF_OPTS += --enable-mi
Signature · 6 lines
2.31.1

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

Re: [Buildroot] [PATCH 2/3] package/poke: disable minimal-threading with thumb or thumb2

Hello,

package/poke/poke.mk POKE_CONF_OPTS = \ · line 56

Quoted 8 lines · On Sat, 29 Jan 2022 15:23:51 +0100 Romain Naour <[email protected]> wrote:
package/poke/poke.mk +8 -0
+# Disable minimal-threading when thumb or thumb2 is enabled
+# due to runtime issue.
+# https://lists.gnu.org/archive/html/poke-devel/2022-01/msg00162.html
+ifeq ($(BR2_ARM_CPU_HAS_THUMB)$(BR2_ARM_CPU_HAS_THUMB2),y)
+POKE_CONF_OPTS += --disable-dispatch-minimal-threading
+else
+POKE_CONF_OPTS += --enable-dispatch-minimal-threading
+endif

I don't understand this patch, because minimal-threading is already disabled by default (at least in poke 1.4, I haven't checked in poke 2.0). jitter/configure.ac contains:

# Is the minimal-threading dispatch enabled? Check the default and the

# configure command-line option.
AC_MSG_CHECKING([if minimal-threading dispatch is enabled])
# FIXME: reenable this when I make defect handling reliable.
#default=$(test "x$JITTER_HAVE_ACTUAL_GCC" = "xyes" && echo yes || echo no)
default=no
AC_ARG_ENABLE([dispatch-minimal-threading],
              AS_HELP_STRING([--enable-dispatch-minimal-threading],
              [enable minimal threading dispatch: default yes if and
only if GCC (not an imitation) is used]),
              jitter_enable_dispatch_minimal_threading="$enableval",
              jitter_enable_dispatch_minimal_threading="$default")
if test "x$jitter_enable_dispatch_minimal_threading" = "xyes"; then
  jitter_best_dispatch_model="minimal-threading"
  jitter_enabled_dispatch_models="$jitter_enabled_dispatch_models minimal-threading"
fi
AC_MSG_RESULT([$jitter_enable_dispatch_minimal_threading$jitter_subpackage_disclaimer])
# FIXME: remove this warning message when I make defect handling reliable.
if test "x$jitter_enable_dispatch_minimal_threading" = "xyes"; then
  AC_MSG_WARN([minimal-threading dispatch is currently unreliable, and should
  not be used in production until defective instruction replacement is fully
  implemented])
fi

See the "default=no" ?

Also, when building with the following defconfig:

BR2_arm=y
BR2_cortex_a8=y
BR2_ARM_EABI=y
BR2_ARM_INSTRUCTIONS_THUMB2=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_INIT_NONE=y
BR2_SYSTEM_BIN_SH_NONE=y
# BR2_PACKAGE_BUSYBOX is not set
BR2_PACKAGE_POKE=y
# BR2_TARGET_ROOTFS_TAR is not set

The minimal threading is already disabled:

checking if switch dispatching is enabled... yes, provisionally (sub-package mode) checking if direct-threading dispatch is enabled... yes, provisionally (sub-package mode) checking if minimal-threading dispatch is enabled... no, provisionally (sub-package mode) checking if no-threading dispatch is enabled... no, provisionally (sub-package mode)
configure: sub-package mode: disabling every dispatch except direct-threading
configure: (the following dispatches could have been enabled:
switch direct-threading)
configure: enabled dispatching models are:
direct-threading
configure: the best enabled dispatching model is:
direct-threading

So what this patch is doing is in fact slightly the opposite of what he
says: instead of disabling minimal threading for thumb or thumb2, it enables it for any other platform.

Are you sure this patch was needed for poke 1.4, and not for poke 2.0 ?

Best regards,

Thomas

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#3 lore raw

Re: [Buildroot] [PATCH 2/3] package/poke: disable minimal-threading with thumb or thumb2

Hello Thomas,

Le 30/01/2022 à 15:46, Thomas Petazzoni a écrit :

Quoted 72 lines

Hello,

package/poke/poke.mk POKE_CONF_OPTS = \ · line 56

Quoted 8 lines · On Sat, 29 Jan 2022 15:23:51 +0100 Romain Naour <[email protected]> wrote:
package/poke/poke.mk +8 -0
+# Disable minimal-threading when thumb or thumb2 is enabled
+# due to runtime issue.
+# https://lists.gnu.org/archive/html/poke-devel/2022-01/msg00162.html
+ifeq ($(BR2_ARM_CPU_HAS_THUMB)$(BR2_ARM_CPU_HAS_THUMB2),y)
+POKE_CONF_OPTS += --disable-dispatch-minimal-threading
+else
+POKE_CONF_OPTS += --enable-dispatch-minimal-threading
+endif

I don't understand this patch, because minimal-threading is already disabled by default (at least in poke 1.4, I haven't checked in poke 2.0). jitter/configure.ac contains:

# Is the minimal-threading dispatch enabled? Check the default and the

# configure command-line option.
AC_MSG_CHECKING([if minimal-threading dispatch is enabled])
# FIXME: reenable this when I make defect handling reliable.
#default=$(test "x$JITTER_HAVE_ACTUAL_GCC" = "xyes" && echo yes || echo no)
default=no
AC_ARG_ENABLE([dispatch-minimal-threading],
              AS_HELP_STRING([--enable-dispatch-minimal-threading],
              [enable minimal threading dispatch: default yes if and
only if GCC (not an imitation) is used]),
              jitter_enable_dispatch_minimal_threading="$enableval",
              jitter_enable_dispatch_minimal_threading="$default")
if test "x$jitter_enable_dispatch_minimal_threading" = "xyes"; then
  jitter_best_dispatch_model="minimal-threading"
  jitter_enabled_dispatch_models="$jitter_enabled_dispatch_models minimal-threading"
fi
AC_MSG_RESULT([$jitter_enable_dispatch_minimal_threading$jitter_subpackage_disclaimer])
# FIXME: remove this warning message when I make defect handling reliable.
if test "x$jitter_enable_dispatch_minimal_threading" = "xyes"; then
  AC_MSG_WARN([minimal-threading dispatch is currently unreliable, and should
  not be used in production until defective instruction replacement is fully
  implemented])
fi

See the "default=no" ?

Also, when building with the following defconfig:

BR2_arm=y
BR2_cortex_a8=y
BR2_ARM_EABI=y
BR2_ARM_INSTRUCTIONS_THUMB2=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_INIT_NONE=y
BR2_SYSTEM_BIN_SH_NONE=y
# BR2_PACKAGE_BUSYBOX is not set
BR2_PACKAGE_POKE=y
# BR2_TARGET_ROOTFS_TAR is not set

The minimal threading is already disabled:

checking if switch dispatching is enabled... yes, provisionally (sub-package mode) checking if direct-threading dispatch is enabled... yes, provisionally (sub-package mode) checking if minimal-threading dispatch is enabled... no, provisionally (sub-package mode) checking if no-threading dispatch is enabled... no, provisionally (sub-package mode)
configure: sub-package mode: disabling every dispatch except direct-threading
configure: (the following dispatches could have been enabled:
switch direct-threading)
configure: enabled dispatching models are:
direct-threading
configure: the best enabled dispatching model is:
direct-threading

Quoted 5 lines

So what this patch is doing is in fact slightly the opposite of what he
says: instead of disabling minimal threading for thumb or thumb2, it enables it for any other platform.

Are you sure this patch was needed for poke 1.4, and not for poke 2.0 ?

I overlooked that was disabled by default in poke 1.4. I only checked if this option was present in poke 1.4. So this patch must be merged in the poke version bump.

Best regards,
Romain

Quoted 5 lines

Best regards,

Thomas

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

#4 lore raw

PATCH 3/3 package/poke: bump to version 2.0

In reply to Romain Naour

Tested locally with poke testsuite on aarch64 with Qemu:

         === poke Summary ===
 # of expected passes		6270
 # of unsupported tests		7

See: http://www.jemarch.net/poke-2.0-relnotes.html

Tested:
https://gitlab.com/kubu93/buildroot/-/pipelines/458943718

---
test-pkg config:
BR2_PACKAGE_POKE=y
BR2_PACKAGE_JSON_C=y

---
 ...P2MAN-replace-by-true-when-cross-com.patch |  6 ++--
 ...andom.c-fix-build-with-uclibc-1.0.35.patch | 28 +++++++++----------
 package/poke/poke.hash                        |  2 +-
 package/poke/poke.mk                          |  2 +-
 4 files changed, 19 insertions(+), 19 deletions(-)
package/poke/0001-configure.ac-HELP2MAN-replace-by-true-when-cross-com.patch +3 -3
index c169516153..85a76e068e 100644
@@ -1,4 +1,4 @@
-From b35dadae6371c3727cac46ae5bd348b66aa411fc Mon Sep 17 00:00:00 2001
+From 51fb81264323f01a86dd0bdeaf1c7a044a9cb6dc 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
@@ -17,10 +17,10 @@ Signed-off-by: Romain Naour <[email protected]>
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/configure.ac b/configure.ac
-index 2c6f1aef..9c4c9be2 100644
+index a1943b57..c633f719 100644
 --- a/configure.ac
 +++ b/configure.ac
-@@ -74,7 +74,7 @@ gl_LIBTEXTSTYLE_OPTIONAL([0.20.5])
+@@ -90,7 +90,7 @@ gl_LIBTEXTSTYLE_OPTIONAL([0.20.5])
  if test $cross_compiling = no; then
    AM_MISSING_PROG(HELP2MAN, help2man)
  else
package/poke/0002-lib-getrandom.c-fix-build-with-uclibc-1.0.35.patch +14 -14
index 757dc3f760..bd20b5d2c6 100644
@@ -1,4 +1,4 @@
-From a0594387565e1e6b4a8a8ba04ad13b135cc1f0b5 Mon Sep 17 00:00:00 2001
+From 236b019b83228d2e37fa07635fb6864ed7dc5fad Mon Sep 17 00:00:00 2001
 From: Fabrice Fontaine <[email protected]>
 Date: Thu, 1 Apr 2021 07:49:46 +0200
 Subject: [PATCH] lib/getrandom.c: fix build with uclibc < 1.0.35
@@ -15,7 +15,7 @@ In file included from ./sys/random.h:40,
 /tmp/instance-0/output-1/host/x86_64-buildroot-linux-uclibc/sysroot/usr/include/sys/random.h:8:1: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
     7 | #include <features.h>
   +++ |+#include <stddef.h>
-    8 | 
+    8 |
 
 This patch is not upstreamable as it is only a workaround for
 uclibc < 1.0.35, upstream uclibc has been patched with
@@ -26,15 +26,15 @@ Fixes:
 
 Signed-off-by: Fabrice Fontaine <[email protected]>
 ---
- jitter/gnulib-local/getrandom.c | 1 +
- gl/getrandom.c                  | 1 +
  gl-libpoke/getrandom.c          | 1 +
+ gl/getrandom.c                  | 1 +
+ jitter/gnulib-local/getrandom.c | 1 +
  3 files changed, 3 insertions(+)
 
-diff --git a/jitter/gnulib-local/getrandom.c b/jitter/gnulib-local/getrandom.c
-index 41212fb32..0ad3f9648 100644
---- a/jitter/gnulib-local/getrandom.c
-+++ b/jitter/gnulib-local/getrandom.c
+diff --git a/gl-libpoke/getrandom.c b/gl-libpoke/getrandom.c
+index e146873..3948d8d 100644
+--- a/gl-libpoke/getrandom.c
++++ b/gl-libpoke/getrandom.c
 @@ -19,6 +19,7 @@
  
  #include <config.h>
@@ -44,7 +44,7 @@ index 41212fb32..0ad3f9648 100644
  
  #include <errno.h>
 diff --git a/gl/getrandom.c b/gl/getrandom.c
-index 41212fb32..0ad3f9648 100644
+index e146873..3948d8d 100644
 --- a/gl/getrandom.c
 +++ b/gl/getrandom.c
 @@ -19,6 +19,7 @@
@@ -55,10 +55,10 @@ index 41212fb32..0ad3f9648 100644
  #include <sys/random.h>
  
  #include <errno.h>
-diff --git a/gl-libpoke/getrandom.c b/gl-libpoke/getrandom.c
-index 41212fb32..0ad3f9648 100644
---- a/gl-libpoke/getrandom.c
-+++ b/gl-libpoke/getrandom.c
+diff --git a/jitter/gnulib-local/getrandom.c b/jitter/gnulib-local/getrandom.c
+index e146873..3948d8d 100644
+--- a/jitter/gnulib-local/getrandom.c
++++ b/jitter/gnulib-local/getrandom.c
 @@ -19,6 +19,7 @@
  
  #include <config.h>
@@ -68,5 +68,5 @@ index 41212fb32..0ad3f9648 100644
  
  #include <errno.h>
 -- 
-2.30.2
+2.31.1
 
package/poke/poke.hash +1 -1
index 1367262f54..7bf2204c55 100644
@@ -1,4 +1,4 @@
 # Locally calculated
-sha256  ce054df29560c921230132703ee449fe130b6e25ab03aa6cc796bb401506aa24  poke-1.4.tar.gz
+sha256  5b822bf3e112c9fb5c0c9ab22a30a45a5d5e4d16e3f7436052bb720aa26b9a58  poke-2.0.tar.gz
 sha256  8ceb4b9ee5adedde47b31e975c1d90c73ad27b6b165a1dcd80c7c545eb65b903  COPYING
 sha256  8ceb4b9ee5adedde47b31e975c1d90c73ad27b6b165a1dcd80c7c545eb65b903  jitter/COPYING
package/poke/poke.mk +1 -1
index 91518f5854..e92d9506ce 100644
@@ -4,7 +4,7 @@
 #
 ################################################################################
 
-POKE_VERSION = 1.4
+POKE_VERSION = 2.0
 POKE_SITE = $(BR2_GNU_MIRROR)/poke
 # gnulib license is a mix/mess of public-domain and various GPL and LGPL versions.
 POKE_LICENSE = GPL-3.0+, GPL-3.0+ (jitter), gnulib license (gnulib)
Signature · 6 lines
2.31.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#5 lore raw
In reply to Romain Naour
Quoted 6 lines · On Sat, 29 Jan 2022 15:23:50 +0100 Romain Naour <[email protected]> wrote:

Poke generate a library libpoke.so, so install it to staging.

---
 package/poke/poke.mk | 1 +
 1 file changed, 1 insertion(+)

Applied to master, thanks.

Thomas

Signature · 7 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot