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 <christoph.muellner@vrull.eu>

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20107)
This commit is contained in:
Christoph Müllner 2023-01-21 15:49:17 +01:00 committed by Hugo Landau
parent 3147785eb2
commit af0a4c4684
1 changed files with 18 additions and 0 deletions

View File

@ -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: |