[flac-dev] 1.3.2: FLAC__CPUINFO_IA32_CPUID_SSE3 undeclared

Christian Weisgerber naddy at mips.inka.de
Mon Jan 9 16:42:29 UTC 2017


Building 1.3.2 on OpenBSD/i386, I get this error:

cpu.c: In function 'ia32_cpu_info':
cpu.c:128: error: 'FLAC__CPUINFO_IA32_CPUID_SSE3' undeclared (first use in this
function)
cpu.c:128: error: (Each undeclared identifier is reported only once
cpu.c:128: error: for each function it appears in.)
cpu.c:129: error: 'FLAC__CPUINFO_IA32_CPUID_SSSE3' undeclared (first use in this function)
cpu.c:130: error: 'FLAC__CPUINFO_IA32_CPUID_SSE41' undeclared (first use in this function)
cpu.c:131: error: 'FLAC__CPUINFO_IA32_CPUID_SSE42' undeclared (first use in this function)
cpu.c:134: error: 'FLAC__CPUINFO_IA32_CPUID_OSXSAVE' undeclared (first use in this function)
cpu.c:135: error: 'FLAC__CPUINFO_IA32_CPUID_AVX' undeclared (first use in this function)
cpu.c:136: error: 'FLAC__CPUINFO_IA32_CPUID_FMA' undeclared (first use in this function)
cpu.c:138: error: 'FLAC__CPUINFO_IA32_CPUID_AVX2' undeclared (first use in this
function)

This is a result on inconsistent #if guards in src/libFLAC/cpu.c,
combined with an old compiler (GCC 4.2.1) that doesn't have
x86intrin.h.

Specifically, the definition of FLAC__CPUINFO_IA32_CPUID_SSE3 etc.
is guarded by
#if FLAC__HAS_X86INTRIN || FLAC__AVX_SUPPORTED

However, the later use in ia32_cpu_info is guarded by
#if !defined FLAC__NO_ASM && (defined FLAC__HAS_NASM || FLAC__HAS_X86INTRIN)

In our case, we have
FLAC__HAS_NASM 1
FLAC__HAS_X86INTRIN 0
FLAC__AVX_SUPPORTED 0

-- 
Christian "naddy" Weisgerber                          naddy at mips.inka.de


More information about the flac-dev mailing list