Improve elf_aux_info detection on FreeBSD/OpenBSD
A free file archiver for extremely high compression
Brought to you by:
ipavlov
Hello,
The elf_aux_info() function appeared in FreeBSD 12.0 and was first available in OpenBSD 7.6 (source: https://man.openbsd.org/elf_aux_info.3).
Please find the attached patch to use elf_aux_info when available on FreeBSD/OpenBSD.
Also inspired by OpenSSL: https://github.com/openssl/openssl/blob/master/crypto/armcap.c#L77-L94
The first FreeBSD version that includes the API is 11.4. I had corrected the OpenSSL code as well.
It's better to not include version checks if possible. The code already checks for the existence of the header to enable support a bit further up with has_include.
The OpenSSL code does not use has_include that's why it uses the version checks.
Also there is another spot missed in the 7zip codebase.
I had not noticed the patches section but I had posted a diff here.
https://sourceforge.net/p/sevenzip/bugs/2594/
Last edit: Brad Smith 2025-11-08