Skip to contentSkip to conversation

package/highway: fix build with powerpc7

PATCH In review Fabrice Fontaine 2 participants 2 messages May 5, 2024 – May 6, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/highway: fix build with powerpc7

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

---
 package/highway/highway.mk | 4 ++++
 1 file changed, 4 insertions(+)
package/highway/highway.mk +4 -0
index 3eb0d7a4aa..d1ddcc6221 100644
@@ -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)
Signature · 6 lines
2.43.0

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

Hello Fabrice,

package/highway/highway.mk ifeq ($(BR2_RISCV_32),y) · line 50

Quoted 3 lines · On Sun, 5 May 2024 10:47:53 +0200 Fabrice Fontaine…
package/highway/highway.mk +3 -0
+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

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