From: Christoph Müllner Date: Sat, 21 Jan 2023 14:49:17 +0000 (+0100) Subject: CI: cross-compile: Allow to set CPU capabilities X-Git-Tag: openssl-3.2.0-alpha1~1410 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=af0a4c46846323fc33f713b5ccd758a526c19ed0;p=thirdparty%2Fopenssl.git CI: cross-compile: Allow to set CPU capabilities The cross-compile CI tests use cross-compilers for building and QEMU for testing. This implies that testing of ISA extension for HW accelerated cryptographic calculations is undefined (it depends on arch-specific QEMU defaults and arch-specific detection mechanisms in OpenSSL). Let's add a mechanism to set two environment variables, that allow to control the ISA extensions: * QEMU_CPU: used by QEMU to specify CPU capabilities of the emulation * OPENSSL_*: used by OpenSSL (on some architectures) to enable ISA extensions. Signed-off-by: Christoph Müllner Reviewed-by: Tomas Mraz Reviewed-by: Paul Dale Reviewed-by: Hugo Landau (Merged from https://github.com/openssl/openssl/pull/20107) --- diff --git a/.github/workflows/cross-compiles.yml b/.github/workflows/cross-compiles.yml index 81f60b232ec..124553c743c 100644 --- a/.github/workflows/cross-compiles.yml +++ b/.github/workflows/cross-compiles.yml @@ -30,6 +30,15 @@ jobs: # to never run the tests, otherwise its value is passed to # the "make test" command to allow selective disabling of # tests. + # qemucpu: optional; string that describes CPU properties. + # The string will be used to set the QEMU_CPU variable. + # opensslcapsname: optional; string that describes the postfix of the + # OpenSSL environment variable that defines CPU + # capabilities. E.g. "foo" will result in an + # environment variable with the name OPENSSL_foo. + # opensslcaps: optional; if opensslcapsname (see above) is set, then + # this string will be used as content for the OpenSSL + # capabilities variable. platform: [ { arch: aarch64-linux-gnu, @@ -164,6 +173,15 @@ jobs: if: github.event_name == 'push' && matrix.platform.tests != 'none' run: sudo apt-get -yq --force-yes install qemu-user + - name: Set QEMU environment + if: github.event_name == 'push' && matrix.platform.qemucpu != '' + run: echo "QEMU_CPU=${{ matrix.platform.qemucpu }}" >> $GITHUB_ENV + + - name: Set OpenSSL caps environment + if: github.event_name == 'push' && matrix.platform.opensslcapsname != '' + run: echo "OPENSSL_${{ matrix.platform.opensslcapsname }}=\ + ${{ matrix.platform.opensslcaps }}" >> $GITHUB_ENV + - name: make all tests if: github.event_name == 'push' && matrix.platform.tests == '' run: |