Skip to content

Commit

Permalink
CI update for ubuntu 24.04 (#1599)
Browse files Browse the repository at this point in the history
### Description of changes: 
* Fixes previous CI failures due to gcc-13 not being present.
* Updates CI compilation "sanity test" to included compilers on Ubuntu
24.04
* Cherry-picked recent [commit from
BoringSSL](google/boringssl@c701903)
that fixes gcc-14 build error.
* Add CI cross-compilation test for `loongaarch64`.

### Callout
* The gcc-14 FIPS build failure is related to the "delocator" and is
still being researched.

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license and the ISC license.

---------

Co-authored-by: David Benjamin <[email protected]>
  • Loading branch information
justsmth and davidben authored May 24, 2024
1 parent fe06851 commit dde8d51
Show file tree
Hide file tree
Showing 3 changed files with 123 additions and 36 deletions.
115 changes: 99 additions & 16 deletions .github/workflows/actions-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -168,24 +168,80 @@ jobs:
echo ${env:SDEROOT}
.\tests\ci\run_windows_tests.bat "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x64 true
gcc-9-13-sanity:
gcc-ubuntu-2004-sanity:
if: github.repository_owner == 'aws'
needs: [sanity-test-run]
strategy:
fail-fast: false
matrix:
gccversion:
- "10"
fips:
- "0"
- "1"
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '>=1.18'
- name: Setup CMake
uses: threeal/[email protected]
with:
generator: Ninja
c-compiler: gcc-${{ matrix.gccversion }}
cxx-compiler: g++-${{ matrix.gccversion }}
options: FIPS=${{ matrix.fips }} CMAKE_BUILD_TYPE=Release
- name: Build Project
run: cmake --build ./build --target all
- name: Run tests
run: cmake --build ./build --target run_tests

gcc-ubuntu-2204-sanity:
if: github.repository_owner == 'aws'
needs: [sanity-test-run]
strategy:
fail-fast: false
matrix:
gccversion:
- "9"
- "10"
- "11"
- "12"
fips:
- "0"
- "1"
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '>=1.18'
- name: Setup CMake
uses: threeal/[email protected]
with:
generator: Ninja
c-compiler: gcc-${{ matrix.gccversion }}
cxx-compiler: g++-${{ matrix.gccversion }}
options: FIPS=${{ matrix.fips }} CMAKE_BUILD_TYPE=Release
- name: Build Project
run: cmake --build ./build --target all
- name: Run tests
run: cmake --build ./build --target run_tests

gcc-ubuntu-2404-sanity:
if: github.repository_owner == 'aws'
needs: [ sanity-test-run ]
strategy:
fail-fast: false
matrix:
gccversion:
- "12"
- "13"
os:
- "ubuntu-latest"
- "14"
fips:
- "0"
- "1"
runs-on: ${{ matrix.os }}
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
Expand All @@ -203,7 +259,38 @@ jobs:
- name: Run tests
run: cmake --build ./build --target run_tests

clang-13-15-sanity:
clang-ubuntu-2004-sanity:
if: github.repository_owner == 'aws'
needs: [sanity-test-run]
strategy:
fail-fast: false
matrix:
gccversion:
- "10"
- "11"
- "12"
fips:
- "0"
- "1"
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '>=1.18'
- name: Setup CMake
uses: threeal/[email protected]
with:
generator: Ninja
c-compiler: clang-${{ matrix.gccversion }}
cxx-compiler: clang++-${{ matrix.gccversion }}
options: FIPS=${{ matrix.fips }} CMAKE_BUILD_TYPE=Release
- name: Build Project
run: cmake --build ./build --target all
- name: Run tests
run: cmake --build ./build --target run_tests

clang-ubuntu-2204-sanity:
if: github.repository_owner == 'aws'
needs: [sanity-test-run]
strategy:
Expand All @@ -213,12 +300,10 @@ jobs:
- "13"
- "14"
- "15"
os:
- "ubuntu-latest"
fips:
- "0"
- "1"
runs-on: ${{ matrix.os }}
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
Expand All @@ -236,22 +321,20 @@ jobs:
- name: Run tests
run: cmake --build ./build --target run_tests

clang-10-12-sanity:
clang-ubuntu-2404-sanity:
if: github.repository_owner == 'aws'
needs: [sanity-test-run]
strategy:
fail-fast: false
matrix:
gccversion:
- "10"
- "11"
- "12"
os:
- "ubuntu-20.04"
- "16"
- "17"
- "18"
fips:
- "0"
- "1"
runs-on: ${{ matrix.os }}
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
Expand Down
37 changes: 17 additions & 20 deletions .github/workflows/cross-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ concurrency:
jobs:
ppc64-build-test:
if: github.repository_owner == 'aws'
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- name: Install qemu
run: |
Expand All @@ -21,7 +21,7 @@ jobs:
run: tests/ci/run_cross_tests.sh ppc64 powerpc64-unknown-linux-gnu "-DCMAKE_BUILD_TYPE=Release" "-DCMAKE_BUILD_TYPE=Release -DFIPS=1 -DBUILD_SHARED_LIBS=1"
ppc32-non-fips-build-test:
if: github.repository_owner == 'aws'
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- name: Install qemu
run: |
Expand All @@ -32,7 +32,7 @@ jobs:
run: tests/ci/run_cross_tests.sh ppc powerpc-unknown-linux-gnu "-DCMAKE_BUILD_TYPE=Release"
ppc32-fips-build-test:
if: github.repository_owner == 'aws'
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- name: Install qemu
run: |
Expand All @@ -43,7 +43,7 @@ jobs:
run: tests/ci/run_cross_tests.sh ppc powerpc-unknown-linux-gnu "-DCMAKE_BUILD_TYPE=Release -DFIPS=1 -DBUILD_SHARED_LIBS=1"
ppc64le-build-test:
if: github.repository_owner == 'aws'
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- name: Install qemu
run: |
Expand All @@ -54,7 +54,7 @@ jobs:
run: tests/ci/run_cross_tests.sh ppc64le powerpc64le-unknown-linux-gnu "-DCMAKE_BUILD_TYPE=Release" "-DCMAKE_BUILD_TYPE=Release -DFIPS=1 -DBUILD_SHARED_LIBS=1"
riscv64-non-fips-build-test:
if: github.repository_owner == 'aws'
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- name: Install qemu
run: |
Expand All @@ -72,7 +72,7 @@ jobs:
run: tests/ci/run_cross_tests.sh riscv riscv64-unknown-linux-gnu "-DCMAKE_BUILD_TYPE=Release"
armv6-non-fips-build-test:
if: github.repository_owner == 'aws'
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- name: Install qemu
run: |
Expand All @@ -81,22 +81,19 @@ jobs:
- uses: actions/checkout@v4
- name: armv6 Build/Test
run: tests/ci/run_cross_tests.sh armv6 armv6-unknown-linux-gnueabi "-DCMAKE_BUILD_TYPE=Release"
# TODO: enable once qemu-user-binfmt in ubuntu-latest supports loongarch64
# * QEMU added support for loongarch64 in 7.1: https://www.qemu.org/2022/08/30/qemu-7-1-0/
# * The next Ubuntu LTS should have a QEMU 8.x: https://packages.ubuntu.com/noble/qemu-user-binfmt
# loongarch64-non-fips-build-test:
# runs-on: ubuntu-latest
# steps:
# - name: Install qemu
# run: |
# sudo apt-get update
# sudo apt-get -y install qemu-user qemu-user-binfmt
# - uses: actions/checkout@v4
# - name: armv6 Build/Test
# run: tests/ci/run_cross_tests.sh loongarch64 loongarch64-unknown-linux-gnu "-DCMAKE_BUILD_TYPE=Release"
loongarch64-non-fips-build-test:
runs-on: ubuntu-24.04
steps:
- name: Install qemu
run: |
sudo apt-get update
sudo apt-get -y install qemu-user qemu-user-binfmt
- uses: actions/checkout@v4
- name: loongarch64 Build/Test
run: tests/ci/run_cross_tests.sh loongarch64 loongarch64-unknown-linux-gnu "-DCMAKE_BUILD_TYPE=Release"
s390x-non-fips-build-test:
if: github.repository_owner == 'aws'
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- name: Install qemu
run: |
Expand Down
7 changes: 7 additions & 0 deletions crypto/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -1086,6 +1086,11 @@ static inline uint64_t CRYPTO_rotr_u64(uint64_t value, int shift) {

// Arithmetic functions.

// The most efficient versions of these functions on GCC and Clang depend on C11
// |_Generic|. If we ever need to call these from C++, we'll need to add a
// variant that uses C++ overloads instead.
#if !defined(__cplusplus)

// CRYPTO_addc_* returns |x + y + carry|, and sets |*out_carry| to the carry
// bit. |carry| must be zero or one.
#if OPENSSL_HAS_BUILTIN(__builtin_addc)
Expand Down Expand Up @@ -1187,6 +1192,8 @@ static inline uint64_t CRYPTO_subc_u64(uint64_t x, uint64_t y, uint64_t borrow,
#define CRYPTO_subc_w CRYPTO_subc_u32
#endif

#endif // !__cplusplus


// FIPS functions.

Expand Down

0 comments on commit dde8d51

Please sign in to comment.