For armv7 (cross build target): multimedia/libvpx depends on the GNU C library function getauxval and so fails to build; so, disable its <sys/auxv.h> expectation?

Jan Beich jbeich at FreeBSD.org
Fri Dec 8 14:21:18 UTC 2017


Michal Meloun <melounmichal at gmail.com> writes:

> Having linux compatible getauxval() was my original plan.
> But during testing, I found that some ports autodetect getauxval()
> presence and if exists, then full linux implementation is required.
> My bad is that I didn't realize that the presence of "sys/auxv/h"
> causes the same troubles.

Why auxv.h lives under sys/ despite not having any consumers there?
Maybe rename <sys/auxv.h> to <auxv.h>.

> The updated patch for multimedia/libvpx is here:
> http://build.humusoft.cz/patches/multimedia/libvpx/libvpx.diff

Looks OK but

> +  unsigned long hwcaps;

Maybe initialize to 0 to save typing on simple error handling below.
elf_aux_info() seems to be sane enough to not touch the buffer
on error.

> +#if __has_include(<sys/auxv.h>)
> +  if (elf_aux_info(AT_HWCAP, &hwcaps, sizeof(hwcaps)) != 0)
> +    hwcaps = 0;
> +#else
> +  hwcaps = 0;
> +#endif

For example:

  unsigned long hwcaps = 0;
[...]
#if __has_include(<sys/auxv.h>)
  elf_aux_info(AT_HWCAP, &hwcaps, sizeof(hwcaps)
#endif


More information about the freebsd-ports mailing list