Fix build on powerpc*#985
Conversation
Tested on FreeBSD/powerpc64le.
Tested on FreeBSD/powerpc64le.
|
Hi, I’m Jit, a friendly security platform designed to help developers build secure applications from day zero with an MVS (Minimal viable security) mindset. In case there are security findings, they will be communicated to you as a comment inside the PR. Hope you’ll enjoy using Jit. Questions? Comments? Want to learn more? Get in touch with us. |
|
@pkubaj Thank you for the contribution. First, please sign the CLA. Second, did you confirm that this addition would enable SIMD optimizations on PPC? |
|
No, it doesn't — and it isn't meant to. This is purely a build fix; PPC keeps using the scalar distance functions. There are no CPU_FEATURES_ARCH_PPC dispatch blocks and no VSX/AltiVec kernels, so on PPC none of the features.* fields are ever read — the functions fall straight through to the scalar default. What the change actually does is narrower: without it, getCpuOptimizationFeatures() on PPC falls into the #else and instantiates cpu_features::X86Features / GetX86Info, which don't exist on a PPC build (cpu_features compiles its PPC module there, not the x86 one) — that's the compile failure. Routing PPC to PPCFeatures/GetPPCInfo makes it build; the returned struct is simply never consulted, exactly like the scalar fallback intends. Actually enabling SIMD on PPC would be a separate, much larger change — adding VSX implementations plus the OPT_* macros and Choose_* dispatch — which is out of scope for a build fix. |
Two simple patches to fix powerpc* builds.
Mark if applicable
Note
Low Risk
Small, build-target-specific wiring with no API or behavior change on x86_64/AArch64; PPC continues to use scalar distance paths guarded by existing arch macros.
Overview
Fixes powerpc* compilation and runtime CPU feature detection in VecSim by treating PPC like the existing x86_64 and AArch64 paths.
space_includes.hnow includescpuinfo_ppc.hwhenCPU_FEATURES_ARCH_PPCis defined.getCpuOptimizationFeaturesinspaces.hselectscpu_features::PPCFeaturesandGetPPCInfoon PPC instead of falling through to the x86 types andGetX86Info.Reviewed by Cursor Bugbot for commit f033912. Bugbot is set up for automated code reviews on this repo. Configure here.