Skip to content

gutils: Check whether getauxval function exists

Ting-Wei Lan requested to merge wip/lantw/check-getauxval-for-freebsd-12 into master

FreeBSD 12 adds a new header, sys/auxv.h, to declare a function, elf_aux_info, for public use, which was considered an internal function in previous releases. This new function provides similar functionality with glibc getauxval, which is also declared in the same header, but their interfaces are not compatible. Since the only usage of sys/auxv.h is in g_check_setuid and FreeBSD already has issetugid to provide the required functionality, we fixes the compilation error by adding a check for getauxval function to prevent g_check_setuid from calling getauxval when sys/auxv.h is found but getauxval is not available.

https://reviews.freebsd.org/D12743
https://reviews.freebsd.org/rS324815

Merge request reports