]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
s390: Fix compilation with clang.
authorFlorian Krohm <flo2030@eich-krohm.de>
Mon, 16 Mar 2026 14:49:44 +0000 (14:49 +0000)
committerFlorian Krohm <flo2030@eich-krohm.de>
Mon, 16 Mar 2026 14:49:44 +0000 (14:49 +0000)
BFP testcases were broken when compiling with clang which does not
recognise -mlong-double-128 on s390

configure.ac
none/tests/s390x/Makefile.am

index 8102369efc6d7422b30dd75494622f06c7f520f0..1739305d60f0aac25b45f26febf78d75462d66d1 100644 (file)
@@ -2645,13 +2645,14 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
 ]])], [
 ac_compiler_supports_mlong_double_128=yes
 AC_MSG_RESULT([yes])
+FLAG_MLONG_DOUBLE_128="-mlong-double-128"
 ], [
 ac_compiler_supports_mlong_double_128=no
 AC_MSG_RESULT([no])
+FLAG_MLONG_DOUBLE_128=""
 ])
 CFLAGS=$safe_CFLAGS
 AM_CONDITIONAL(HAS_MLONG_DOUBLE_128, test x$ac_compiler_supports_mlong_double_128 = xyes)
-FLAG_MLONG_DOUBLE_128="-mlong-double-128"
 AC_SUBST(FLAG_MLONG_DOUBLE_128)
 
 # does this toolchain support lto ?
index 188be9b897a87bf74140266f397038bbd406ac66..ba127c85a2a7432404b7498a1e032f637106ae42 100644 (file)
@@ -24,9 +24,14 @@ INSN_TESTS = clc clcle cvb cvd icm lpr lam_stam xc mvst add sub mul \
             dfp-1 dfp-2 dfp-3 dfp-4 dfpconv dfpext dfptest pfpo srnmt \
             hfp
 
+# Include the BFP testcases iff GCC accepts -mlong-souble-128 or clang
+# is your compiler (which has 128-bit wide long doubles by default).
 if HAS_MLONG_DOUBLE_128
 INSN_TESTS += bfp-arith bfp-compare bfp-convert bfp-load bfp-tdc
 endif
+if COMPILER_IS_CLANG
+INSN_TESTS += bfp-arith bfp-compare bfp-convert bfp-load bfp-tdc
+endif
 
 check_PROGRAMS = $(INSN_TESTS) \
                 allexec \
@@ -76,8 +81,8 @@ vector_float_CFLAGS    = $(AM_CFLAGS) -march=z13 -DS390_TEST_COUNT=4
 vec2_CFLAGS      = $(AM_CFLAGS) -march=z13
 vec2_float_CFLAGS = $(AM_CFLAGS) -march=z13
 vec3_CFLAGS       = $(AM_CFLAGS) -march=z13
-bfp_arith_CFLAGS   = $(AM_CFLAGS) -mlong-double-128
-bfp_compare_CFLAGS = $(AM_CFLAGS) -mlong-double-128
-bfp_convert_CFLAGS = $(AM_CFLAGS) -mlong-double-128
-bfp_load_CFLAGS    = $(AM_CFLAGS) -mlong-double-128
-bfp_tdc_CFLAGS     = $(AM_CFLAGS) -mlong-double-128
+bfp_arith_CFLAGS   = $(AM_CFLAGS) @FLAG_MLONG_DOUBLE_128@
+bfp_compare_CFLAGS = $(AM_CFLAGS) @FLAG_MLONG_DOUBLE_128@
+bfp_convert_CFLAGS = $(AM_CFLAGS) @FLAG_MLONG_DOUBLE_128@
+bfp_load_CFLAGS    = $(AM_CFLAGS) @FLAG_MLONG_DOUBLE_128@
+bfp_tdc_CFLAGS     = $(AM_CFLAGS) @FLAG_MLONG_DOUBLE_128@