Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 08 Dec 2017 15:21:10 +0100
From:      Jan Beich <jbeich@FreeBSD.org>
To:        Michal Meloun <melounmichal@gmail.com>
Cc:        Ian Lepore <ian@freebsd.org>, Mark Millard <markmi@dsl-only.net>, mmel@freebsd.org, Freebsd-arm <freebsd-arm@freebsd.org>, FreeBSD Ports <freebsd-ports@freebsd.org>
Subject:   Re: 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?
Message-ID:  <d13p-s3l5-wny@FreeBSD.org>
In-Reply-To: <03a31eff-34e8-be4c-c008-528824fea261@freebsd.org> (Michal Meloun's message of "Fri, 8 Dec 2017 12:46:12 %2B0100")
References:  <AE704C6E-E686-4EBC-8BB1-A041F2DC647C@dsl-only.net> <wp1z-bvw9-wny@FreeBSD.org> <1512583709.58601.49.camel@freebsd.org> <03a31eff-34e8-be4c-c008-528824fea261@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Michal Meloun <melounmichal@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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?d13p-s3l5-wny>