]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Add a feature check for tests that use -march=armv8-a+crc.
authorMark Wielaard <mark@klomp.org>
Tue, 20 Sep 2016 17:57:00 +0000 (17:57 +0000)
committerMark Wielaard <mark@klomp.org>
Tue, 20 Sep 2016 17:57:00 +0000 (17:57 +0000)
Older gcc versions for arm64 don't support the crc arch feature.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15971

configure.ac
none/tests/arm64/Makefile.am
none/tests/arm64/crc32.vgtest

index c84bca798939e3b0bc9b1aca98671eab345a8ef1..85439a4c0e051a38e7e99fb596e57109ef95312f 100644 (file)
@@ -2685,6 +2685,29 @@ AC_MSG_RESULT([no])
 
 AM_CONDITIONAL(BUILD_IFUNC_TESTS, test x$ac_have_ifunc_attr = xyes)
 
+# Does the C compiler support the armv8 crc feature flag
+# Note, this doesn't generate a C-level symbol.  It generates a
+# automake-level symbol (BUILD_ARMV8_CRC_TESTS), used in test Makefile.am's
+AC_MSG_CHECKING([if gcc supports the armv8 crc feature flag])
+
+save_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS -march=armv8-a+crc -Werror"
+AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
+int main()
+{
+    return 0;
+}
+]])], [
+ac_have_armv8_crc_feature=yes
+AC_MSG_RESULT([yes])
+], [
+ac_have_armv8_crc_feature=no
+AC_MSG_RESULT([no])
+])
+CFLAGS="$save_CFLAGS"
+
+AM_CONDITIONAL(BUILD_ARMV8_CRC_TESTS, test x$ac_have_armv8_crc_feature = xyes)
+
 
 # XXX JRS 2010 Oct 13: what is this for?  For sure, we don't need this
 # when building the tool executables.  I think we should get rid of it.
index 01d6c55380ea3aa39bc2808cf4fc2af18ea7538c..a0a2cfe0b5bcece18dbff1bb27948506ba212205 100644 (file)
@@ -12,12 +12,15 @@ EXTRA_DIST = \
 
 check_PROGRAMS = \
        allexec \
-        crc32 \
         cvtf_imm \
        fp_and_simd \
        integer \
        memory
 
+if BUILD_ARMV8_CRC_TESTS
+  check_PROGRAMS += crc32
+endif
+
 AM_CFLAGS    += @FLAG_M64@
 AM_CXXFLAGS  += @FLAG_M64@
 AM_CCASFLAGS += @FLAG_M64@
index 53aa8dbd84f3394a5d5253a42512c643022d5291..24ce0e3b5a0058d4713339c28c99ffd43ff691db 100644 (file)
@@ -1,2 +1,3 @@
 prog: crc32
+prereq: test -x crc32
 vgopts: -q