opencv / opencv

Open Source Computer Vision Library
https://opencv.org
Apache License 2.0
75.95k stars 55.62k forks source link

[regression between 4.6.0 and 4.9.0] Build breaks on FreeBSD/arm64: modules/core/src/system.cpp:573:13: error: unknown type #25527

Open yurivict opened 2 weeks ago

yurivict commented 2 weeks ago

System Information

OpenCV version: 4.9.0 FreeBSD 15

Detailed description

/construction/xports/graphics/opencv/work/opencv-4.9.0/modules/core/src/system.cpp:573:13: error: unknown type 
name 'Elf64_auxv_t'
            Elf64_auxv_t auxv;

The #include <gelf.h> statement for Elf64_auxv_t is missing. The search for the package elfutils which installs the header gelf.h is also missing.

The code section beginning with int cpufile = open("/proc/self/auxv", O_RDONLY); is new in 4.9.0

Additionally, when the file /proc/self/auxv doesn't exist on FreeBSD, it should print that linprocfs should be enabled, because /proc/self/auxv is only created when linprocfs is enabled. The current code is silent in case of the failure to open this file.

In short, 3 items need to be fixed: 1) Add the include for Elf64_auxv_t 2) Add search for the elfutils in configure 3) Add the user warning when "/proc/self/auxv" isn't available on FreeBSD suggesting to enable linprocfs

Steps to reproduce

n/a

Issue submission checklist

asmorkalov commented 2 weeks ago

Unfortunately BSD systems are out for OpenCV team CI Scope. Feel free to contribute solution.