File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed
Expand file tree Collapse file tree 2 files changed +7
-4
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 6161# include < sys/auxv.h>
6262# elif defined(HAVE_ELF_AUX_INFO)
6363# include < sys/auxv.h>
64- # include < sys/elf.h>
6564# endif
6665#endif
6766
6867#if defined(HAVE_RVV)
69- # if defined(HAVE_GETAUXVAL)
68+ # if defined(HAVE_GETAUXVAL) || defined(HAVE_ELF_AUX_INFO)
7069# include < sys/auxv.h>
7170# define HWCAP_RV (letter ) (1ul << ((letter) - ' A' ))
7271# endif
@@ -244,6 +243,10 @@ SIMDDetect::SIMDDetect() {
244243# if defined(HAVE_GETAUXVAL)
245244 const unsigned long hwcap = getauxval (AT_HWCAP);
246245 rvv_available_ = hwcap & HWCAP_RV (' V' );
246+ # elif defined(HAVE_ELF_AUX_INFO)
247+ unsigned long hwcap = 0 ;
248+ elf_aux_info (AT_HWCAP, &hwcap, sizeof hwcap);
249+ rvv_available_ = hwcap & HWCAP_RV (' V' );
247250# endif
248251#endif
249252
You can’t perform that action at this time.
0 commit comments