]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
build: fix __get_cpuid_count check to catch link failure
authorCarl Edquist <edquist@cs.wisc.edu>
Mon, 10 May 2021 10:22:11 +0000 (05:22 -0500)
committerPádraig Brady <P@draigBrady.com>
Mon, 10 May 2021 12:35:20 +0000 (13:35 +0100)
The test program will compile successfully even if __get_cpuid_count
is not declared.  The error for the missing symbol will only show up
at link time.  Thus, use AC_LINK_IFELSE instead of AC_COMPILE_IFELSE.

* configure.ac (__get_cpuid_count check): Use C_LINK_IFELSE instead
of AC_COMPILE_IFELSE.
(__get_cpuid check): Likewise.

configure.ac

index f0fbbd9b737e8c2bf93e3d28ba1d9ae76b204102..c4d8ec0b6c2b9f4d065e17d00b680799e8c2008c 100644 (file)
@@ -525,7 +525,7 @@ LDFLAGS=$ac_save_LDFLAGS
 ac_c_werror_flag=$cu_save_c_werror_flag
 
 AC_MSG_CHECKING([if __get_cpuid available])
-AC_COMPILE_IFELSE(
+AC_LINK_IFELSE(
   [AC_LANG_SOURCE([[
     #include <cpuid.h>
 
@@ -576,7 +576,7 @@ AM_CONDITIONAL([USE_PCLMUL_CRC32],
 CFLAGS=$ac_save_CFLAGS
 
 AC_MSG_CHECKING([if __get_cpuid_count exists])
-AC_COMPILE_IFELSE(
+AC_LINK_IFELSE(
   [AC_LANG_SOURCE([[
     #include <cpuid.h>