buildroot.busybox.net archive mirror
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/libev: force arm mode instead of Thumb mode
@ 2023-02-22 14:37 Fabrice Fontaine
  2023-02-23  6:36 ` Yann E. MORIN
  2023-03-16 21:35 ` Peter Korsgaard
  0 siblings, 2 replies; 3+ messages in thread
From: Fabrice Fontaine @ 2023-02-22 14:37 UTC (permalink / raw)
  To: buildroot; +Cc: Fabrice Fontaine

Fix the following build failure:

/tmp/ccHc3Awn.s:825: Error: selected processor does not support `mcr p15,0,r3,c7,c10,5' in Thumb mode

Fixes:
 - http://autobuild.buildroot.org/results/1c597c9da724d6cac06b09b1ecd456a28440a3a3

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 package/libev/libev.mk | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/package/libev/libev.mk b/package/libev/libev.mk
index 9f3c19d46c..cbd5433d76 100644
--- a/package/libev/libev.mk
+++ b/package/libev/libev.mk
@@ -10,6 +10,13 @@ LIBEV_INSTALL_STAGING = YES
 LIBEV_LICENSE = BSD-2-Clause or GPL-2.0+
 LIBEV_LICENSE_FILES = LICENSE
 
+# libev has some assembly function that is not present in Thumb mode:
+# Error: selected processor does not support `mcr p15,0,r3,c7,c10,5' in Thumb mode
+# so, we desactivate Thumb mode
+ifeq ($(BR2_ARM_INSTRUCTIONS_THUMB),y)
+LIBEV_CONF_ENV += CFLAGS="$(TARGET_CFLAGS) -marm"
+endif
+
 # The 'compatibility' event.h header conflicts with libevent
 # It's completely unnecessary for BR packages so remove it
 define LIBEV_DISABLE_EVENT_H_INSTALL
-- 
2.39.0

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

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

* Re: [Buildroot] [PATCH 1/1] package/libev: force arm mode instead of Thumb mode
  2023-02-22 14:37 [Buildroot] [PATCH 1/1] package/libev: force arm mode instead of Thumb mode Fabrice Fontaine
@ 2023-02-23  6:36 ` Yann E. MORIN
  2023-03-16 21:35 ` Peter Korsgaard
  1 sibling, 0 replies; 3+ messages in thread
From: Yann E. MORIN @ 2023-02-23  6:36 UTC (permalink / raw)
  To: Fabrice Fontaine; +Cc: buildroot

Fabrice, All,

On 2023-02-22 15:37 +0100, Fabrice Fontaine spake thusly:
> Fix the following build failure:
> 
> /tmp/ccHc3Awn.s:825: Error: selected processor does not support `mcr p15,0,r3,c7,c10,5' in Thumb mode
> 
> Fixes:
>  - http://autobuild.buildroot.org/results/1c597c9da724d6cac06b09b1ecd456a28440a3a3
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> ---
>  package/libev/libev.mk | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/package/libev/libev.mk b/package/libev/libev.mk
> index 9f3c19d46c..cbd5433d76 100644
> --- a/package/libev/libev.mk
> +++ b/package/libev/libev.mk
> @@ -10,6 +10,13 @@ LIBEV_INSTALL_STAGING = YES
>  LIBEV_LICENSE = BSD-2-Clause or GPL-2.0+
>  LIBEV_LICENSE_FILES = LICENSE
>  
> +# libev has some assembly function that is not present in Thumb mode:
> +# Error: selected processor does not support `mcr p15,0,r3,c7,c10,5' in Thumb mode
> +# so, we desactivate Thumb mode
> +ifeq ($(BR2_ARM_INSTRUCTIONS_THUMB),y)
> +LIBEV_CONF_ENV += CFLAGS="$(TARGET_CFLAGS) -marm"
> +endif

Same as for the audit change, this is going to fail for armv7m machines,
so we need to hide away libeve for those.

Unfortuantely, libev does not already have an _ARCH_SUPPORTS, and adding
one just for this is a bit overkill.

However, libeve has 12 reverse dependencies, so it's going to be a
little pain.

If we expect that libeve has more arch-dependencies, then it might be a
good idea, but I have no clue there...

In fact, re-reading the libev code, it seems that the situation is more
coplex that "not thumb":

     814    #elif defined __ARM_ARCH_6__  || defined __ARM_ARCH_6J__  \
     815       || defined __ARM_ARCH_6K__ || defined __ARM_ARCH_6ZK__ \
     816       || defined __ARM_ARCH_6T2__
     817      #define ECB_MEMORY_FENCE         __asm__ __volatile__ ("mcr p15,0,%0,c7,c10,5" : : "r" (0) : "memory")
     818    #elif defined __ARM_ARCH_7__  || defined __ARM_ARCH_7A__  \
     819       || defined __ARM_ARCH_7R__ || defined __ARM_ARCH_7M__
     820      #define ECB_MEMORY_FENCE         __asm__ __volatile__ ("dmb"      : : : "memory")

So, it goes through the armv6 case, and it looks like it does have
support for Thumb2 (6T2) or armv7m.

So, the condition is a bit more complex. It is OK for ARM full or
Thumb2 (armv7m implies Thumb2).

So, adding an LIBEVE_ARCH_SUPPORT is maybe a good idea, in the end:

    config BR2_PACKAGE_LIBEV_ARCH_SUPPORTS
        bool
        default y if !(BR2_arm || BR2_armeb) || BR2_ARM_CPU_HAS_ARM || BR2_ARM_CPU_HAS_THUMB2

Regards,
Yann E. MORIN.

>  # The 'compatibility' event.h header conflicts with libevent
>  # It's completely unnecessary for BR packages so remove it
>  define LIBEV_DISABLE_EVENT_H_INSTALL
> -- 
> 2.39.0
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH 1/1] package/libev: force arm mode instead of Thumb mode
  2023-02-22 14:37 [Buildroot] [PATCH 1/1] package/libev: force arm mode instead of Thumb mode Fabrice Fontaine
  2023-02-23  6:36 ` Yann E. MORIN
@ 2023-03-16 21:35 ` Peter Korsgaard
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2023-03-16 21:35 UTC (permalink / raw)
  To: Fabrice Fontaine; +Cc: buildroot

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

 > Fix the following build failure:
 > /tmp/ccHc3Awn.s:825: Error: selected processor does not support `mcr p15,0,r3,c7,c10,5' in Thumb mode

 > Fixes:
 >  - http://autobuild.buildroot.org/results/1c597c9da724d6cac06b09b1ecd456a28440a3a3

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

Committed to 2022.11.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] 3+ messages in thread

end of thread, other threads:[~2023-03-16 21:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-22 14:37 [Buildroot] [PATCH 1/1] package/libev: force arm mode instead of Thumb mode Fabrice Fontaine
2023-02-23  6:36 ` Yann E. MORIN
2023-03-16 21:35 ` Peter Korsgaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).