File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -515,6 +515,25 @@ cpulist_read_from(CpuList* list, const char* filename)
515
515
// its implementation does not parse /proc/self/auxv. Instead it depends
516
516
// on values that are passed by the kernel at process-init time to the
517
517
// C runtime initialization layer.
518
+ #if 1
519
+ // OpenCV calls CPU features check during library initialization stage
520
+ // (under other dlopen() call).
521
+ // Unfortunatelly, calling dlopen() recursively is not supported on some old
522
+ // Android versions. Android fix is here:
523
+ // - https://android-review.googlesource.com/#/c/32951/
524
+ // - GitHub mirror: https://github.com/android/platform_bionic/commit/e19d702b8e330cef87e0983733c427b5f7842144
525
+ __attribute__((weak )) unsigned long getauxval (unsigned long ); // Lets linker to handle this symbol
526
+ static uint32_t
527
+ get_elf_hwcap_from_getauxval (int hwcap_type ) {
528
+ uint32_t ret = 0 ;
529
+ if (getauxval != 0 ) {
530
+ ret = (uint32_t )getauxval (hwcap_type );
531
+ } else {
532
+ D ("getauxval() is not available\n" );
533
+ }
534
+ return ret ;
535
+ }
536
+ #else
518
537
static uint32_t
519
538
get_elf_hwcap_from_getauxval (int hwcap_type ) {
520
539
typedef unsigned long getauxval_func_t (unsigned long );
@@ -539,6 +558,7 @@ get_elf_hwcap_from_getauxval(int hwcap_type) {
539
558
return ret ;
540
559
}
541
560
#endif
561
+ #endif
542
562
543
563
#if defined(__arm__ )
544
564
// Parse /proc/self/auxv to extract the ELF HW capabilities bitmap for the
You can’t perform that action at this time.
0 commit comments