From: John Naylor Date: Fri, 8 May 2026 09:44:25 +0000 (+0700) Subject: Fix universal builds on MacOS X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=901ed9b352b41f034e17bc540725082a488fce31;p=thirdparty%2Fpostgresql.git Fix universal builds on MacOS Commit 16743db06 assumed that the CPUID instruction was always available when the usual x86 symbols were defined. That is not the case, so zero out the info rather than error out. Reported-by: Jakob Egger Reported-by: Tobias Bussmann Suggested-by: Tom Lane Discussion: https://postgr.es/m/223EA201-A0E8-4A13-B220-EB903E8DF817@eggerapps.at --- diff --git a/src/port/pg_cpu_x86.c b/src/port/pg_cpu_x86.c index f22167da9af..f61f0940431 100644 --- a/src/port/pg_cpu_x86.c +++ b/src/port/pg_cpu_x86.c @@ -63,12 +63,11 @@ mask_available(uint32 value, uint32 mask) static inline void pg_cpuid(int leaf, unsigned int *reg) { + memset(reg, 0, 4 * sizeof(unsigned int)); #if defined(HAVE__GET_CPUID) __get_cpuid(leaf, ®[EAX], ®[EBX], ®[ECX], ®[EDX]); #elif defined(HAVE__CPUID) __cpuid((int *) reg, leaf); -#else -#error cpuid instruction not available #endif }