File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 221221# additional checks for RVV targets
222222if test x$check_for_rvv = x1; then
223223 AC_MSG_NOTICE([checking how to detect RVV availability])
224- AC_CHECK_FUNCS([getauxval])
224+ AC_CHECK_FUNCS([getauxval elf_aux_info ])
225225
226- if test $ac_cv_func_getauxval = no; then
226+ if test $ac_cv_func_getauxval = no && test $ac_cv_func_elf_aux_info = no ; then
227227 AC_MSG_WARN([RVV is available, but we don' t know how to check for it. Will not be able to use RVV.])
228228 fi
229229fi
Original file line number Diff line number Diff line change 6666#endif
6767
6868#if defined(HAVE_RVV)
69- # if defined(HAVE_GETAUXVAL)
69+ # if defined(HAVE_GETAUXVAL) || defined(HAVE_ELF_AUX_INFO)
7070# include < sys/auxv.h>
7171# define HWCAP_RV (letter ) (1ul << ((letter) - ' A' ))
7272# endif
@@ -244,6 +244,10 @@ SIMDDetect::SIMDDetect() {
244244# if defined(HAVE_GETAUXVAL)
245245 const unsigned long hwcap = getauxval (AT_HWCAP);
246246 rvv_available_ = hwcap & HWCAP_RV (' V' );
247+ # elif defined(HAVE_ELF_AUX_INFO)
248+ unsigned long hwcap = 0 ;
249+ elf_aux_info (AT_HWCAP, &hwcap, sizeof hwcap);
250+ rvv_available_ = hwcap & HWCAP_RV (' V' );
247251# endif
248252#endif
249253
You can’t perform that action at this time.
0 commit comments