]> git.ipfire.org Git - thirdparty/nettle.git/commitdiff
Add make target check-fat-emulate
authorNiels Möller <nisse@lysator.liu.se>
Wed, 2 Apr 2025 13:04:48 +0000 (15:04 +0200)
committerNiels Möller <nisse@lysator.liu.se>
Wed, 2 Apr 2025 13:04:48 +0000 (15:04 +0200)
.gitlab-ci.yml
Makefile.in
configure.ac

index 71d378bb37891926f959f448916764ee0d3a84c0..7dafe3e4dc99d2b357ce41c99649daa8b61fa2ad 100644 (file)
@@ -27,7 +27,7 @@ variables:
 native/fat:
   extends: .native-build
   variables:
-    EXTRA_CHECK: check-fat
+    EXTRA_CHECK_TARGET: check-fat-override
 
 native/no-fat:
   extends: .native-build
@@ -176,8 +176,7 @@ remote/s390x:
   - ./.bootstrap
   - ./configure --disable-documentation $EXTRA_CONFIGURE_ARGS --build=$build --host=$host
   - make -j$(nproc)
-  - make EMULATOR=${EMULATOR} -j$(nproc) check
-  - make EMULATOR=${EMULATOR} -j$(nproc) check-fat
+  - make EMULATOR=${EMULATOR} -j$(nproc) check $EXTRA_CHECK_TARGET
   tags:
   - saas-linux-small-amd64
   except:
@@ -194,11 +193,13 @@ cross/arm-linux-gnueabihf:
   extends: .cross-build
   variables:
     EMULATOR: qemu-arm
+    EXTRA_CHECK_TARGET: check-fat-override
 
 cross/aarch64-linux-gnu:
   extends: .cross-build
   variables:
     EMULATOR: qemu-aarch64
+    EXTRA_CHECK_TARGET: check-fat-override
 
 # Setting QEMU_LD_PREFIX works around the error "qemu-ppc64: Could not
 # open '/lib64/ld64.so.1".
@@ -207,11 +208,13 @@ cross/powerpc64-linux-gnu:
   variables:
     EXTRA_CONFIGURE_ARGS: '--enable-mini-gmp'
     QEMU_LD_PREFIX: /usr/powerpc64-linux-gnu
+    EXTRA_CHECK_TARGET: check-fat-override check-fat-emulate
     EMULATOR: qemu-ppc64
 
 cross/powerpc64le-linux-gnu:
   extends: .cross-build
   variables:
+    EXTRA_CHECK_TARGET: check-fat-override check-fat-emulate
     EMULATOR: qemu-ppc64le
 
 # Disable assembly files, because current qemu doesn't support all
index 39e1a2301a8444a4acc2878fec6fee87c517fa01..012f6f2ea85f5d3dafceafea09385b2aa41d5f51 100644 (file)
@@ -17,7 +17,8 @@ OPT_HOGWEED_OBJS = @OPT_HOGWEED_OBJS@
 
 OPT_NETTLE_SOURCES = @OPT_NETTLE_SOURCES@
 
-FAT_TEST_LIST = @FAT_TEST_LIST@
+FAT_OVERRIDE_LIST = @FAT_OVERRIDE_LIST@
+FAT_EMULATE_LIST = @FAT_EMULATE_LIST@
 
 SUBDIRS = tools testsuite examples
 
@@ -59,13 +60,22 @@ check-here:
 # Tries different settings of NETTLE_FAT_OVERRIDE. Note that this
 # requires that corresponding processor features are available on the
 # test machine.
-check-fat:
-       [ -z "$(FAT_TEST_LIST)" ] || \
-         set -e; cd testsuite && for f in $(FAT_TEST_LIST) ; do \
+check-fat-override:
+       [ -z "$(FAT_OVERRIDE_LIST)" ] || \
+         set -e; cd testsuite && for f in $(FAT_OVERRIDE_LIST) ; do \
            echo NETTLE_FAT_OVERRIDE=$$f ; \
            NETTLE_FAT_OVERRIDE=$$f $(MAKE) check TS_ALL='$$(TS_FAT)' ; \
          done
 
+# Emulate for multiple cpu flavors; -cpu is the right flag for qemu.
+EMULATOR_CPU_FLAG = -cpu
+check-fat-emulate:
+       [ -z "$(FAT_EMULATE_LIST)" ] || [ -z "$(EMULATOR)" ] || \
+         set -e; cd testsuite && for f in $(FAT_EMULATE_LIST) ; do \
+           echo Emulating: $$f ; \
+            $(MAKE) check EMULATOR="$(EMULATOR) $(EMULATOR_CPU_FLAG) $$f" TS_ALL='$$(TS_FAT)' ; \
+         done
+
 all-here: $(TARGETS) $(DOCTARGETS)
 
 nettle_SOURCES = aes-decrypt-internal.c aes-decrypt-table.c \
index 169279fd75aaed02662bbd1f7a99197c300b04af..3d41974b3017fd59c925cac47422df35a119a02c 100644 (file)
@@ -449,7 +449,8 @@ if test "x$ABI" != xstandard ; then
 fi
 
 OPT_NETTLE_SOURCES=""
-FAT_TEST_LIST=""
+FAT_OVERRIDE_LIST=""
+FAT_EMULATE_LIST=""
 ASM_PPC_WANT_R_REGISTERS="n/a"
 
 # Select assembler code
@@ -467,7 +468,7 @@ if test "x$enable_assembler" = xyes ; then
          OPT_NETTLE_SOURCES="fat-x86_64.c $OPT_NETTLE_SOURCES"
          # For now, not enabling aesni or sha_ni, since at least 
          # the latter appears unavailable on the gitlab test machines.
-         FAT_TEST_LIST="vendor:intel vendor:amd"
+         FAT_OVERRIDE_LIST="vendor:intel vendor:amd"
        else
          if test "x$enable_x86_aesni" = xyes ; then
            asm_path="x86_64/aesni $asm_path"
@@ -493,7 +494,7 @@ if test "x$enable_assembler" = xyes ; then
       if test "x$enable_fat" = xyes ; then
        asm_path="arm/fat $asm_path"
        OPT_NETTLE_SOURCES="fat-arm.c $OPT_NETTLE_SOURCES"
-       FAT_TEST_LIST="arch:5 arch:6,neon"
+       FAT_OVERRIDE_LIST="arch:5 arch:6,neon"
       else
        case "$host_cpu" in
          armv6* | armv7*)
@@ -513,7 +514,7 @@ if test "x$enable_assembler" = xyes ; then
         if test "x$enable_fat" = xyes ; then
           asm_path="arm64/fat $asm_path"
           OPT_NETTLE_SOURCES="fat-arm64.c $OPT_NETTLE_SOURCES"
-          FAT_TEST_LIST="none aes pmull sha1 sha2"
+          FAT_OVERRIDE_LIST="none aes pmull sha1 sha2"
         else
           if test "$enable_arm64_crypto" = yes ; then
             asm_path="arm64/crypto $asm_path"
@@ -534,7 +535,9 @@ if test "x$enable_assembler" = xyes ; then
        if test "x$enable_fat" = xyes ; then
          asm_path="powerpc64/fat $asm_path"
          OPT_NETTLE_SOURCES="fat-ppc.c $OPT_NETTLE_SOURCES"
-         FAT_TEST_LIST="none crypto_ext altivec power9"
+         FAT_OVERRIDE_LIST="none crypto_ext altivec power9"
+         # No debian support for power7, making it hard to test.
+         FAT_EMULATE_LIST="power8 power9"
        else
          if test "$enable_power9" = yes ; then
            asm_path="powerpc64/p9 $asm_path"
@@ -554,7 +557,7 @@ if test "x$enable_assembler" = xyes ; then
         if test "x$enable_fat" = xyes ; then
                asm_path="s390x/fat $asm_path"
                OPT_NETTLE_SOURCES="fat-s390x.c $OPT_NETTLE_SOURCES"
-          FAT_TEST_LIST="none vf msa msa_x1 msa_x2 msa_x4"
+          FAT_OVERRIDE_LIST="none vf msa msa_x1 msa_x2 msa_x4"
         else
           if test "$enable_s390x_vf" = yes ; then
             asm_path="s390x/vf $asm_path"
@@ -701,7 +704,8 @@ fi
 AC_SUBST([OPT_NETTLE_OBJS])
 AC_SUBST([OPT_HOGWEED_OBJS])
 AC_SUBST([OPT_NETTLE_SOURCES])
-AC_SUBST([FAT_TEST_LIST])
+AC_SUBST([FAT_OVERRIDE_LIST])
+AC_SUBST([FAT_EMULATE_LIST])
 AC_SUBST([ASM_RODATA])
 if test "x$enable_assembler" = xyes ; then
   IF_ASM=''