Use CC and full command line instead of hard-coding gcc for AVX512 checking
authorEgbert Eich <eich@suse.com>
Mon, 28 Mar 2022 06:14:52 +0000 (08:14 +0200)
committerEgbert Eich <eich@suse.com>
Mon, 28 Mar 2022 06:22:07 +0000 (08:22 +0200)
Hard-coding gcc may not provide incorrect results when a different compiler
for the target build is used. To remain in sync with the main call to c_check,
pass the full command line.

Signed-off-by: Egbert Eich <eich@suse.com>
Makefile.prebuild

index 4dad74d..5e8874d 100644 (file)
@@ -71,7 +71,7 @@ endif
 
 
 getarch : getarch.c cpuid.S dummy $(CPUIDEMU)
-       avx512=$$(perl c_check - - gcc | grep NO_AVX512); \
+       avx512=$$(perl c_check - - $(CC) $(TARGET_FLAGS) $(CFLAGS) | grep NO_AVX512); \
        $(HOSTCC) $(HOST_CFLAGS) $(EXFLAGS) $${avx512:+-D$${avx512}} -o $(@F) getarch.c cpuid.S $(CPUIDEMU)
 
 getarch_2nd : getarch_2nd.c config.h dummy