0001-tests-fp-meson-don-t-build-fp-bench-test-if-fenv.h-i.patch 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. From b4a692f46135af1011bf0adbfeb19abf354ca191 Mon Sep 17 00:00:00 2001
  2. From: Dario Binacchi <dario.binacchi@amarulasolutions.com>
  3. Date: Tue, 30 Apr 2024 09:40:55 +0200
  4. Subject: [PATCH] tests/fp/meson: don't build fp-bench test if fenv.h is
  5. missing
  6. The fp-bench test (i. e. tests/fp/fp-bench.c) use fenv.h that is not
  7. always provided by the libc (uClibc). The patch disables its compilation
  8. in case the header is not available.
  9. The patch is based on a suggestion from Paolo Bonzini, which you can
  10. find at the following link.
  11. Link: https://lists.nongnu.org/archive/html/qemu-devel/2021-03/msg00492.html
  12. Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
  13. Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
  14. Upstream: https://patchwork.ozlabs.org/project/qemu-devel/patch/20240430164752.645521-1-dario.binacchi@amarulasolutions.com/
  15. ---
  16. tests/fp/meson.build | 14 ++++++++------
  17. 1 file changed, 8 insertions(+), 6 deletions(-)
  18. diff --git a/tests/fp/meson.build b/tests/fp/meson.build
  19. index cbc17392d678..cd052667e940 100644
  20. --- a/tests/fp/meson.build
  21. +++ b/tests/fp/meson.build
  22. @@ -126,12 +126,14 @@ test('fp-test-mulAdd', fptest,
  23. ['f16_mulAdd', 'f32_mulAdd', 'f64_mulAdd', 'f128_mulAdd'],
  24. suite: ['softfloat-slow', 'softfloat-ops-slow', 'slow'], timeout: 90)
  25. -executable(
  26. - 'fp-bench',
  27. - ['fp-bench.c', '../../fpu/softfloat.c'],
  28. - dependencies: [qemuutil, libtestfloat, libsoftfloat],
  29. - c_args: fpcflags,
  30. -)
  31. +if cc.has_header('fenv.h')
  32. + executable(
  33. + 'fp-bench',
  34. + ['fp-bench.c', '../../fpu/softfloat.c'],
  35. + dependencies: [qemuutil, libtestfloat, libsoftfloat],
  36. + c_args: fpcflags,
  37. + )
  38. +endif
  39. fptestlog2 = executable(
  40. 'fp-test-log2',
  41. --
  42. 2.43.0