Skip to content

Commit

Permalink
Add more cross compilers to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
randombit committed Jul 16, 2024
1 parent 5477167 commit 892e810
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 2 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,27 @@ jobs:

matrix:
include:
- target: cross-alpha
compiler: gcc
host_os: ubuntu-24.04
- target: cross-hppa64
compiler: gcc
host_os: ubuntu-24.04
- target: cross-m68k
compiler: gcc
host_os: ubuntu-24.04
- target: cross-mips
compiler: gcc
host_os: ubuntu-24.04
- target: cross-ppc32
compiler: gcc
host_os: ubuntu-24.04
- target: cross-sh4
compiler: gcc
host_os: ubuntu-24.04
- target: cross-sparc64
compiler: gcc
host_os: ubuntu-24.04
- target: cross-riscv64
compiler: gcc
host_os: ubuntu-24.04
Expand Down
2 changes: 1 addition & 1 deletion src/build-data/cc/gcc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ warning_flags "-Wall -Wextra -Wpedantic -Wstrict-aliasing -Wcast-align -Wmissing
# -Wmaybe-uninitialized is buggy https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105937
# -Wstringop-overread is buggy https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111499
# -Wfree-nonheap-object is buggy https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115016
werror_flags "-Werror -Wno-error=strict-overflow -Wno-error=zero-as-null-pointer-constant -Wno-error=non-virtual-dtor -Wno-error=maybe-uninitialized -Wno-error=stringop-overread -Wno-error=stringop-overflow -Wno-error=free-nonheap-object"
werror_flags "-Werror -Wno-error=strict-overflow -Wno-error=zero-as-null-pointer-constant -Wno-error=non-virtual-dtor -Wno-error=maybe-uninitialized -Wno-error=stringop-overread -Wno-error=stringop-overflow -Wno-error=free-nonheap-object -Wno-error=restrict"

maintainer_warning_flags "-Wstrict-overflow=5"

Expand Down
2 changes: 2 additions & 0 deletions src/lib/utils/loadstor.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ constexpr bool is_native(Endianness endianness) {
#elif defined(BOTAN_TARGET_CPU_IS_LITTLE_ENDIAN)
return endianness == Endianness::Little;
#else
BOTAN_UNUSED(endianness);
return false;
#endif
}
Expand All @@ -152,6 +153,7 @@ constexpr bool is_opposite(Endianness endianness) {
#elif defined(BOTAN_TARGET_CPU_IS_LITTLE_ENDIAN)
return endianness == Endianness::Big;
#else
BOTAN_UNUSED(endianness);
return false;
#endif
}
Expand Down
24 changes: 24 additions & 0 deletions src/scripts/ci/setup_gh_actions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,36 @@ if type -p "apt-get"; then
elif [ "$TARGET" = "cross-arm64" ] || [ "$TARGET" = "cross-arm64-amalgamation" ]; then
sudo apt-get -qq install qemu-user g++-aarch64-linux-gnu

elif [ "$TARGET" = "cross-ppc32" ]; then
sudo apt-get -qq install qemu-user g++-powerpc-linux-gnu

elif [ "$TARGET" = "cross-ppc64" ]; then
sudo apt-get -qq install qemu-user g++-powerpc64le-linux-gnu

elif [ "$TARGET" = "cross-sh4" ]; then
sudo apt-get -qq install qemu-user g++-sh4-linux-gnu

elif [ "$TARGET" = "cross-sparc64" ]; then
sudo apt-get -qq install qemu-user g++-sparc64-linux-gnu

elif [ "$TARGET" = "cross-m68k" ]; then
sudo apt-get -qq install qemu-user g++-m68k-linux-gnu

elif [ "$TARGET" = "cross-riscv64" ]; then
sudo apt-get -qq install qemu-user g++-riscv64-linux-gnu

elif [ "$TARGET" = "cross-alpha" ]; then
sudo apt-get -qq install qemu-user g++-alpha-linux-gnu

elif [ "$TARGET" = "cross-arc" ]; then
sudo apt-get -qq install qemu-user g++-arc-linux-gnu

elif [ "$TARGET" = "cross-hppa64" ]; then
sudo apt-get -qq install qemu-user g++-hppa-linux-gnu

elif [ "$TARGET" = "cross-mips" ]; then
sudo apt-get -qq install qemu-user g++-mips-linux-gnu

elif [ "$TARGET" = "cross-mips64" ]; then
sudo apt-get -qq install qemu-user g++-mips64-linux-gnuabi64

Expand Down
34 changes: 33 additions & 1 deletion src/scripts/ci_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,26 @@ def known_targets():
'bsi',
'codeql',
'coverage',
'cross-alpha',
'cross-android-arm32',
'cross-android-arm64',
'cross-android-arm64-amalgamation',
'cross-arm32',
'cross-arm32-baremetal',
'cross-arm64',
'cross-arm64-amalgamation',
'cross-hppa64',
'cross-i386',
'cross-ios-arm64',
'cross-m68k',
'cross-mips',
'cross-mips64',
'cross-ppc32',
'cross-ppc64',
'cross-s390x',
'cross-riscv64',
'cross-s390x',
'cross-sh4',
'cross-sparc64',
'cross-win64',
'docs',
'emscripten',
Expand Down Expand Up @@ -344,10 +350,32 @@ def sanitize_kv(some_string):
flags += ['--cpu=aarch64']
cc_bin = 'aarch64-linux-gnu-g++'
test_prefix = ['qemu-aarch64', '-L', '/usr/aarch64-linux-gnu/']
elif target == 'cross-alpha':
flags += ['--cpu=alpha']
cc_bin = 'alpha-linux-gnu-g++'
test_prefix = ['qemu-alpha', '-L', '/usr/alpha-linux-gnu/']
flags += ['--without-stack-protector'] # not supported
elif target == 'cross-sh4':
flags += ['--cpu=sh4']
cc_bin = 'sh4-linux-gnu-g++'
test_prefix = ['qemu-sh4', '-L', '/usr/sh4-linux-gnu/']
elif target == 'cross-m68k':
flags += ['--cpu=m68k']
cc_bin = 'm68k-linux-gnu-g++'
test_prefix = ['qemu-m68k', '-L', '/usr/m68k-linux-gnu/']
elif target == 'cross-hppa64':
flags += ['--cpu=hppa']
cc_bin = 'hppa-linux-gnu-g++'
test_prefix = ['qemu-hppa', '-L', '/usr/hppa-linux-gnu/']
elif target == 'cross-sparc64':
flags += ['--cpu=sparc64']
cc_bin = 'sparc64-linux-gnu-g++'
test_prefix = ['qemu-sparc64', '-L', '/usr/sparc64-linux-gnu/']
elif target == 'cross-ppc32':
flags += ['--cpu=ppc32']
cc_bin = 'powerpc-linux-gnu-g++'
test_prefix = ['qemu-ppc', '-L', '/usr/powerpc-linux-gnu/']
test_cmd = None # qemu crashes ...
elif target == 'cross-ppc64':
flags += ['--cpu=ppc64', '--with-endian=little']
cc_bin = 'powerpc64le-linux-gnu-g++'
Expand All @@ -360,6 +388,10 @@ def sanitize_kv(some_string):
flags += ['--cpu=s390x']
cc_bin = 's390x-linux-gnu-g++'
test_prefix = ['qemu-s390x', '-L', '/usr/s390x-linux-gnu/']
elif target == 'cross-mips':
flags += ['--cpu=mips32', '--with-endian=big']
cc_bin = 'mips-linux-gnu-g++'
test_prefix = ['qemu-mips', '-L', '/usr/mips-linux-gnu/']
elif target == 'cross-mips64':
flags += ['--cpu=mips64', '--with-endian=big']
cc_bin = 'mips64-linux-gnuabi64-g++'
Expand Down

0 comments on commit 892e810

Please sign in to comment.