Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v2, 1/1] package/tinymembench: force arm mode instead of Thumb mode
@ 2024-01-14 13:54 Fabrice Fontaine
  2024-02-07 15:47 ` Thomas Petazzoni via buildroot
  0 siblings, 1 reply; 4+ messages in thread
From: Fabrice Fontaine @ 2024-01-14 13:54 UTC (permalink / raw)
  To: buildroot; +Cc: Fabrice Fontaine

Fix the following build failure in Thumb mode:

/tmp/ccaZHrla.s:40: Error: instruction not supported in Thumb16 mode -- `subs r1,r1,#16'
/tmp/ccaZHrla.s:43: Error: instruction not supported in Thumb16 mode -- `subs r1,r1,#16'
main.c:45: Error: selected processor does not support `mla r2,r10,r2,r5' in Thumb mode
main.c:46: Error: unshifted register required -- `and r8,r7,r2,lsr#16'
main.c:47: Error: selected processor does not support `mla r2,r10,r2,r5' in Thumb mode
main.c:48: Error: unshifted register required -- `and r9,r6,r2,lsr#8'
main.c:49: Error: selected processor does not support `mla r2,r10,r2,r5' in Thumb mode

While at it, add upstream tag to first patch

Fixes:
 - http://autobuild.buildroot.org/results/1e359c294a8d71fb1833e5d04a6bc7d4fd533510
 - http://autobuild.buildroot.org/results/c06010d7a2bdb33a1707266133a3880e14be7657

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
Changes v1 -> v2 (after review of Yann E. Morin):
 - Keep patch

 .checkpackageignore                                      | 1 -
 .../0001-arm-fix-build-on-Thumb-only-architectures.patch | 1 +
 package/tinymembench/tinymembench.mk                     | 9 ++++++++-
 3 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/.checkpackageignore b/.checkpackageignore
index 4051805c33..09a1bf35e0 100644
--- a/.checkpackageignore
+++ b/.checkpackageignore
@@ -1296,7 +1296,6 @@ package/tinyalsa/0001-include-time.h-before-asound.h.patch Upstream
 package/tinycbor/0001-Makefile-add-DISABLE_WERROR.patch Upstream
 package/tinycompress/0001-wave-add-time.h-missing-header-inclusion.patch Upstream
 package/tinydtls/0001-sha2-sha2.c-fix-build-on-big-endian.patch Upstream
-package/tinymembench/0001-arm-fix-build-on-Thumb-only-architectures.patch Upstream
 package/tinyproxy/0001-prevent-junk-from-showing-up-in-error-page-in-invalid-requests.patch Upstream
 package/tinyxml/0001-In-stamp-always-advance-the-pointer-if-p-0xef.patch Upstream
 package/tpm2-abrmd/S80tpm2-abrmd Indent Shellcheck Variables
diff --git a/package/tinymembench/0001-arm-fix-build-on-Thumb-only-architectures.patch b/package/tinymembench/0001-arm-fix-build-on-Thumb-only-architectures.patch
index 88559ec012..cefa4e995f 100644
--- a/package/tinymembench/0001-arm-fix-build-on-Thumb-only-architectures.patch
+++ b/package/tinymembench/0001-arm-fix-build-on-Thumb-only-architectures.patch
@@ -11,6 +11,7 @@ architecture supports the ARM instruction set, by testing the
 __ARM_ARCH_ISA_ARM compiler define.
 
 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Upstream: https://github.com/ssvb/tinymembench/pull/13
 ---
  arm-neon.S | 2 +-
  asm-opt.c  | 2 +-
diff --git a/package/tinymembench/tinymembench.mk b/package/tinymembench/tinymembench.mk
index 016d680ce7..bc84595e24 100644
--- a/package/tinymembench/tinymembench.mk
+++ b/package/tinymembench/tinymembench.mk
@@ -9,8 +9,15 @@ TINYMEMBENCH_SITE = $(call github,ssvb,tinymembench,v$(TINYMEMBENCH_VERSION))
 TINYMEMBENCH_LICENSE = MIT
 TINYMEMBENCH_LICENSE_FILES = LICENSE
 
+# tinymembench has some assembly function that is not present in Thumb mode:
+# Error: instruction not supported in Thumb16 mode -- `subs r1,r1,#16'
+# so, we desactivate Thumb mode
+ifeq ($(BR2_ARM_INSTRUCTIONS_THUMB),y)
+TINYMEMBENCH_MAKE_OPTS += CFLAGS="$(TARGET_CFLAGS) -marm"
+endif
+
 define TINYMEMBENCH_BUILD_CMDS
-	$(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D)
+	$(TARGET_CONFIGURE_OPTS) $(MAKE) $(TINYMEMBENCH_MAKE_OPTS) -C $(@D)
 endef
 
 define TINYMEMBENCH_INSTALL_TARGET_CMDS
-- 
2.43.0

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

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

end of thread, other threads:[~2024-02-08 10:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-14 13:54 [Buildroot] [PATCH v2, 1/1] package/tinymembench: force arm mode instead of Thumb mode Fabrice Fontaine
2024-02-07 15:47 ` Thomas Petazzoni via buildroot
2024-02-07 20:48   ` Fabrice Fontaine
2024-02-08 10:52     ` Thomas Petazzoni via buildroot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox