[igt-dev] [PATCH v3 4/7] lib/igt_halffloat.c: Fix musl/uclibc build
Kamil Konieczny
kamil.konieczny at linux.intel.com
Tue Oct 31 18:45:47 UTC 2023
Hi Bernd,
On 2023-10-30 at 20:58:06 +0100, Bernd Kuhls wrote:
> From: Stefano Ragni <st3r4g at protonmail.com>
>
> Original patch was added to void-linux:
> https://github.com/void-linux/void-packages/commit/ddfc1f66a0c571b420303c33aed29fd38ace4fc7
>
> Fixes build error:
> ../lib/igt_halffloat.c:205:6: error: ‘ifunc’ is not supported on this target
> 205 | void igt_float_to_half(const float *f, uint16_t *h, unsigned int num)
>
> ../lib/igt_halffloat.c:216:6: error: ‘ifunc’ is not supported on this target
> 216 | void igt_half_to_float(const uint16_t *h, float *f, unsigned int num)
Hmm, now I am reading this a second time and have question:
for what architecture are you compiling this?
It would be better to check in build.meson for GCC support
and add checks in meson for:
GCC_HAVE_IFUNC_ATTRIBUTE
then it would be:
#if defined(__x86_64__) && !defined(__clang__) && defined(__GCC_HAVE_IFUNC_ATTRIBUTE)
or is it both gcc and glibc? Do you have other archs for which this
is supported?
>
> Bug report with request to split the original patch into some
> functional changes:
> Link: https://gitlab.freedesktop.org/drm/igt-gpu-tools/-/issues/138
>
> Signed-off-by: Stefano Ragni <st3r4g at protonmail.com>
> Signed-off-by: Bernd Kuhls <bernd at kuhls.net>
> ---
> v3: no changes
>
> lib/igt_halffloat.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/igt_halffloat.c b/lib/igt_halffloat.c
> index 08ab05fce..5dbe08e01 100644
> --- a/lib/igt_halffloat.c
> +++ b/lib/igt_halffloat.c
> @@ -162,7 +162,7 @@ static inline float _half_to_float(uint16_t val)
> return fi.f;
> }
>
> -#if defined(__x86_64__) && !defined(__clang__)
> +#if defined(__x86_64__) && !defined(__clang__) && defined(__GLIBC__) && !defined(__UCLIBC__)
---------------------------------------------------- ^^^^^^^^^^^^^^^^^^
What about dropping this? (also in other ifunc patch)
Regards,
Kamil
> #pragma GCC push_options
> #pragma GCC target("f16c")
>
> --
> 2.39.2
>
More information about the igt-dev
mailing list