All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/highway: fix build with powerpc7
@ 2024-05-05  8:47 Fabrice Fontaine
  2024-05-06 19:25 ` Thomas Petazzoni via buildroot
  0 siblings, 1 reply; 2+ messages in thread
From: Fabrice Fontaine @ 2024-05-05  8:47 UTC (permalink / raw)
  To: buildroot; +Cc: Julien Olivain, Fabrice Fontaine

VSX support added by
https://github.com/google/highway/commit/d1768d160bf031f869b18ab456501f2b1b4951da
only supports powerpc8 and above resulting in the following build
failure with powerpc7 since bump to version 1.0.7 in commit
0db3c08daf335571a2b2d18a16d8980ddf4567ab:

In file included from /home/buildroot/instance-0/output-1/build/highway-1.1.0/hwy/highway.h:430,
                 from /home/buildroot/instance-0/output-1/build/highway-1.1.0/hwy/per_target.cc:28,
                 from /home/buildroot/instance-0/output-1/build/highway-1.1.0/hwy/foreach_target.h:244,
                 from /home/buildroot/instance-0/output-1/build/highway-1.1.0/hwy/per_target.cc:27:
/home/buildroot/instance-0/output-1/build/highway-1.1.0/hwy/ops/ppc_vsx-inl.h: In function 'hwy::N_PPC8::Vec128<unsigned char> hwy::N_PPC8::AESRound(hwy::N_PPC8::Vec128<unsigned char>, hwy::N_PPC8::Vec128<unsigned char>)':
/home/buildroot/instance-0/output-1/build/highway-1.1.0/hwy/ops/ppc_vsx-inl.h:4651:41: error: 'vec_cipher_be' was not declared in this scope
 4651 |   return BitCast(du8, detail::CipherVec{vec_cipher_be(
      |                                         ^~~~~~~~~~~~~

Fixes: 0db3c08daf335571a2b2d18a16d8980ddf4567ab
 - http://autobuild.buildroot.org/results/98224f8972f3f84304f81c266d33e118f0e2c900

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

diff --git a/package/highway/highway.mk b/package/highway/highway.mk
index 3eb0d7a4aa..d1ddcc6221 100644
--- a/package/highway/highway.mk
+++ b/package/highway/highway.mk
@@ -45,6 +45,10 @@ ifeq ($(BR2_RISCV_32),y)
 HIGHWAY_CONF_OPTS += -DHWY_CMAKE_RVV=OFF
 endif
 
+ifeq ($(BR2_powerpc_power7),y)
+HIGHWAY_CXXFLAGS += -DHWY_DISABLE_PPC8_CRYPTO
+endif
+
 # Workaround for gcc bug 104028 on m68k.
 # See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104028
 ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_104028),y)
-- 
2.43.0

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

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

* Re: [Buildroot] [PATCH 1/1] package/highway: fix build with powerpc7
  2024-05-05  8:47 [Buildroot] [PATCH 1/1] package/highway: fix build with powerpc7 Fabrice Fontaine
@ 2024-05-06 19:25 ` Thomas Petazzoni via buildroot
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni via buildroot @ 2024-05-06 19:25 UTC (permalink / raw)
  To: Fabrice Fontaine; +Cc: Julien Olivain, buildroot

Hello Fabrice,

On Sun,  5 May 2024 10:47:53 +0200
Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:

> +ifeq ($(BR2_powerpc_power7),y)
> +HIGHWAY_CXXFLAGS += -DHWY_DISABLE_PPC8_CRYPTO
> +endif

You're going to hate me, but this really shouldn't require a hack in
Buildroot's packaging. It should be handled directly by the highway
build system/conditional build logic.

BTW, some stuff in hwy/detect_targets.h is weird:

#if HWY_ARCH_PPC && HWY_COMPILER_GCC && defined(__ALTIVEC__) && \
    defined(__VSX__) && defined(__POWER8_VECTOR__) &&           \
    (defined(__CRYPTO__) || defined(HWY_DISABLE_PPC8_CRYPTO))
#define HWY_BASELINE_PPC8 HWY_PPC8
#else
#define HWY_BASELINE_PPC8 0
#endif

Why is this defined(__CRYPTO__) || defined(HWY_DISABLE_PPC8_CRYPTO) ?

So when you *disable* PPC8 crypto, it uses it? Or I am misunderstanding
things?

The problematic code starts with:

  #if !HWY_S390X_HAVE_Z14 && !defined(HWY_DISABLE_PPC8_CRYPTO)

I guess it needs some additional condition to not kick in on Power7.

Could you have a look into this, or report the bug upstream?

Best regards,

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

end of thread, other threads:[~2024-05-06 19:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-05  8:47 [Buildroot] [PATCH 1/1] package/highway: fix build with powerpc7 Fabrice Fontaine
2024-05-06 19:25 ` Thomas Petazzoni via buildroot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.