Skip to content

Test issue when built with `-march=armv9-a`

openSUSE started a new project recently to rebuild a subset of openSUSE Tumbleweed aarch64 packages for armv9. Building for armv9 leads to the following test issue:

[   54s] [1/18] Generating src/version.h with a custom command
[   54s]  1/14 common.c             OK              0.06s
[   54s]  2/14 dummy.c              OK              0.03s
[   54s]  3/14 lut.c                OK              0.03s
[   54s]  4/14 filters.c            OK              0.02s
[   54s]  5/14 string.c             OK              0.02s
[   54s]  6/14 colorspace.c         FAIL            0.11s   exit status 1
[   54s] >>> MSAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1:print_stacktrace=1 LD_LIBRARY_PATH=/home/abuild/rpmbuild/BUILD/libplacebo5-5.264.1-build/libplacebo-v5.264.1/aarch64-suse-linux/src MESON_TEST_ITERATION=1 ASAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1 UBSAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1:print_stacktrace=1 /home/abuild/rpmbuild/BUILD/libplacebo5-5.264.1-build/libplacebo-v5.264.1/aarch64-suse-linux/src/tests/test.colorspace.c
[   54s] ――――――――――――――――――――――――――――――――――――― ✀  ―――――――――――――――――――――――――――――――――――――
[   54s] stdout:
[   54s] testing color system 0
[   54s] testing color system 1
[   54s] testing color system 2
[   54s] testing color system 3
[   54s] testing color system 4
[   54s] testing color system 9
[   54s] testing color system 10
[   54s] stderr:
[   54s] === FAILED: 'white[1] ≈ 1.0' at ../src/tests/colorspace.c:158
[   54s]  white[1]                        = 0.511415
[   54s]  1.0                             = 1.000000
[   54s]  epsilon 1e-6 -> max delta       = 0.000001
[   54s] 
[   54s] ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
[   54s] 
[   54s]  7/14 dither.c             OK              0.10s
[   54s]  8/14 tone_mapping.c       OK              0.07s
[   54s]  9/14 utils.c              OK              0.05s
[   54s] 10/14 icc.c                OK              0.04s
[   54s] 11/14 dav1d.c              OK              0.02s
[   54s] 12/14 vulkan.c             OK              0.05s
[   54s] 13/14 libav.c              OK              0.01s
[   55s] 14/14 opengl_surfaceless.c SKIP            0.21s   exit status 77
[   55s] 
[   55s] Summary of Failures:
[   55s] 
[   55s]  6/14 colorspace.c         FAIL            0.11s   exit status 1
[   55s] 
[   55s] Ok:                12  
[   55s] Fail:              1   
[   55s] Skipped:           1   

There is no such issue when targeting armv8.0.

Full list of build flags used:

  • For armv8: -mbranch-protection=standard -O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g
  • For armv9: -mbranch-protection=standard -O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -march=armv9-a

If we add -ffp-contract=off to the list of build flags, there is no test issue anymore on armv9.