From bb6df54d9d1cb486f7102e9863f0380cb9f3a1f3 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Tue, 6 Oct 2026 10:39:05 +0100 Subject: [PATCH] zlib: do not build POWER8 code on 32-bit PowerPC zlib-ng decides whether to build its POWER8 and POWER9 sources from a probe that compiles getauxval(AT_HWCAP2) & PPC_FEATURE2_ARCH_2_07 and nothing else, so it accepts any target whose libc has getauxval. On mpc85xx that offers POWER8 to an e500v2 and the build fails: adler32_power8.c:126:13: error: '__builtin_vsx_lxvw4x_v16qi' requires the '-mvsx' option POWER8 is ISA 2.07 and POWER9 is ISA 3.0, 64-bit server ISAs that no 32-bit PowerPC in the tree implements, so turn both off for ARCH=powerpc. powerpc64 keeps them, where they build and zlib-ng gates them on HWCAP2 at runtime. Fixes: b6ab56871d6d ("zlib: switch to zlib-ng 2.3.3 in zlib-compatible mode") Signed-off-by: Daniel Golle --- package/libs/zlib/Makefile | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/package/libs/zlib/Makefile b/package/libs/zlib/Makefile index 93b07af96e8..16bda395130 100644 --- a/package/libs/zlib/Makefile +++ b/package/libs/zlib/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=zlib PKG_VERSION:=2.3.3 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/zlib-ng/zlib-ng.git @@ -66,6 +66,15 @@ CMAKE_OPTIONS += \ -DZLIB_COMPAT=ON \ -DBUILD_TESTING=OFF +# POWER8 and POWER9 are 64-bit server ISAs; zlib-ng enables them from a probe +# that only looks for getauxval and PPC_FEATURE2_ARCH_2_07, so it offers them +# on e500 and PPC464 as well, where the compiler has no VSX to emit. +ifeq ($(ARCH),powerpc) +CMAKE_OPTIONS += \ + -DWITH_POWER8=OFF \ + -DWITH_POWER9=OFF +endif + define Build/InstallDev mkdir -p $(1)/usr/include $(CP) $(PKG_INSTALL_DIR)/usr/include/{zconf,zlib,zlib_name_mangling}.h \