Skip to content

Commit

Permalink
Merge branch 'main' into dit-flag
Browse files Browse the repository at this point in the history
  • Loading branch information
nebeid authored Aug 1, 2024
2 parents b02247a + 2fb00e7 commit 6f45e71
Show file tree
Hide file tree
Showing 349 changed files with 37,731 additions and 8,542 deletions.
20 changes: 20 additions & 0 deletions .github/docker_images/gcc-4.8/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0 OR ISC

FROM gcc:4.8

VOLUME ["/awslc"]

COPY awslc_build.sh /
COPY entry.sh /

WORKDIR /

RUN curl -LOk "https://github.com/Kitware/CMake/releases/download/v3.6.3/cmake-3.6.3-Linux-x86_64.tar.gz"
RUN sha256sum cmake-3.6.3-Linux-x86_64.tar.gz | grep -q "9d915d505c07d84b610e1be6242c7cad68b4b7a4090ce85ecf9cec5effa47c43"
RUN tar -C /usr/local -xzf cmake-3.6.3-Linux-x86_64.tar.gz
RUN rm cmake-3.6.3-Linux-x86_64.tar.gz

ENV PATH="${PATH}:/usr/local/cmake-3.6.3-Linux-x86_64/bin"

ENTRYPOINT ["/entry.sh"]
18 changes: 18 additions & 0 deletions .github/docker_images/gcc-4.8/awslc_build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env bash

# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0 OR ISC

set -ex -o pipefail

echo "Building with GCC Version: $(gcc --version)"

BUILD_DIR=$(mktemp -d)
SRC_DIR="${SRC_DIR:-/awslc}"

pushd "${BUILD_DIR}"

cmake "${SRC_DIR}" "-DDISABLE_GO=ON" "-DDISABLE_PERL=ON" "-DMY_ASSEMBLER_IS_TOO_OLD_FOR_512AVX=1"
make -j 4 ssl

popd # ${BUILD_DIR}
8 changes: 8 additions & 0 deletions .github/docker_images/gcc-4.8/entry.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash

# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0 OR ISC

set -ex -o pipefail

/awslc_build.sh "${argv[@]}"
14 changes: 14 additions & 0 deletions .github/workflows/actions-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,20 @@ jobs:
env
tests/ci/run_openbsd_tests.sh ${{ matrix.args }}
EOF
gcc-4_8:
needs: [sanity-test-run]
runs-on: ubuntu-latest
env:
DOCKER_BUILDKIT: 1
steps:
- uses: actions/checkout@v4
- name: Build Docker Image
working-directory: .github/docker_images/gcc-4.8
run: |
docker build -t "gcc-4.8" .
- name: Build using pre-generated assembly
run: |
docker run -v "${{ github.workspace }}:/awslc" "gcc-4.8"
# TODO: Investigate sudden hanging tests and failures in GHA runners (P114059413)
# MSVC-SDE-32-bit:
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Go Compatability
on:
push:
branches: [ '*' ]
pull_request:
branches: [ '*' ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true
env:
DOCKER_BUILDKIT: 1
GOPROXY: https://proxy.golang.org,direct
jobs:
go-version-1_17_13:
if: github.repository_owner == 'aws'
env:
GOROOT: "/usr/local/go"
GO_ARCHIVE: "go1.17.13.linux-amd64.tar.gz"
runs-on: ubuntu-latest
steps:
- name: Install OS Dependencies
run: |
which go
sudo apt-get update
sudo apt-get -y --no-install-recommends install cmake gcc ninja-build make
sudo rm -rf /usr/local/go
sudo rm /usr/bin/go
wget -q "https://dl.google.com/go/${GO_ARCHIVE}"
sudo tar -C /usr/local -xf $GO_ARCHIVE
echo "${GOROOT}/bin" >> $GITHUB_PATH
- uses: actions/checkout@v3
- name: Run integration build
run: |
./tests/ci/run_fips_tests.sh
29 changes: 29 additions & 0 deletions .github/workflows/integrations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,21 @@ jobs:
- name: Run strongswan build
run: |
./tests/ci/integration/run_strongswan_integration.sh
openvpn:
if: github.repository_owner == 'aws'
runs-on: ubuntu-latest
steps:
- name: Install OS Dependencies
run: |
sudo apt-get update
sudo apt-get -y --no-install-recommends install \
cmake gcc ninja-build golang libnl-3-dev libnl-genl-3-dev \
libcap-ng-dev liblz4-dev liblzo2-dev libpam-dev libcmocka-dev \
python3-docutils
- uses: actions/checkout@v4
- name: Run openvpn build
run: |
./tests/ci/integration/run_openvpn_integration.sh
libevent:
if: github.repository_owner == 'aws'
runs-on: ubuntu-latest
Expand All @@ -188,3 +203,17 @@ jobs:
- name: Run libevent build
run: |
./tests/ci/integration/run_libevent_integration.sh
amazon-corretto-crypto-provider:
if: github.repository_owner == 'aws'
runs-on: ubuntu-latest
steps:
- name: Install OS Dependencies
run: |
sudo apt-get update
sudo apt-get -y --no-install-recommends install \
curl gnupg build-essential lcov wget python3-pip cmake gcc ninja-build golang
sudo pip3 install gcovr
- uses: actions/checkout@v4
- name: Run accp build
run: |
./tests/ci/integration/run_accp_integration.sh
27 changes: 27 additions & 0 deletions .github/workflows/opensslcomparison.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: OpenSSL CLI Comparison Tests
on:
push:
branches: [ '*' ]
pull_request:
branches: [ '*' ]

jobs:
openssl_comparison_tests:
if: github.repository_owner == 'aws'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Install OS Dependencies
run: |
sudo apt-get update
sudo apt-get -y --no-install-recommends install \
cmake gcc ninja-build golang make autoconf pkg-config openssl
- name: Make the script executable
run: chmod +x ./tests/ci/run_openssl_comparison_tests.sh

- name: Build AWS-LC & OpenSSL and Run Comparison Tests
run: |
./tests/ci/run_openssl_comparison_tests.sh
48 changes: 42 additions & 6 deletions .github/workflows/windows-alt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,53 @@ jobs:
options: |
CMAKE_SYSTEM_NAME=Windows \
CMAKE_SYSTEM_PROCESSOR=x86_64 \
CMAKE_MAKE_PROGRAM=ninja.exe \
CMAKE_BUILD_TYPE=Release \
- name: Build Project
run: cmake --build ./build --target all
- name: Run tests
run: cmake --build ./build --target run_tests
clang-cl:
clang-cl-msbuild:
if: github.repository_owner == 'aws'
strategy:
fail-fast: false
matrix:
target:
- x64
- x64_arm64
runs-on: windows-latest
env:
CMAKE_GENERATOR: "Visual Studio 17 2022"
CMAKE_GENERATOR_TOOLSET: "ClangCL,host=x64"
steps:
- if: ${{ matrix.target == 'x64' }}
name: Install NASM
uses: ilammy/[email protected]
- name: Checkout
uses: actions/checkout@v4
- uses: TheMrMilchmann/setup-msvc-dev@v3
with:
arch: ${{ matrix.target }}
- if: ${{ matrix.target == 'x64' }}
name: Setup CMake
uses: threeal/[email protected]
with:
options: |
CMAKE_BUILD_TYPE=Release \
- if: ${{ matrix.target == 'x64_arm64' }}
name: Setup CMake
uses: threeal/[email protected]
with:
options: |
CMAKE_GENERATOR_PLATFORM=ARM64 \
CMAKE_SYSTEM_NAME=Windows \
CMAKE_SYSTEM_PROCESSOR=ARM64 \
CMAKE_BUILD_TYPE=Release \
- name: Build Project
run: cmake --build ./build --target all_tests
- if: ${{ matrix.target == 'x64' }}
name: Run tests
run: cmake --build ./build --target run_tests
clang-cl-ninja:
if: github.repository_owner == 'aws'
strategy:
fail-fast: false
Expand Down Expand Up @@ -97,9 +137,6 @@ jobs:
c-compiler: clang-cl
cxx-compiler: clang-cl
options: |
CMAKE_CROSSCOMPILING=${{ ((matrix.target == 'x64') && '0') || '1' }} \
CMAKE_SYSTEM_NAME=Windows \
CMAKE_SYSTEM_PROCESSOR=x86_64 \
CMAKE_BUILD_TYPE=Release \
- if: ${{ matrix.target == 'x64_arm64' }}
name: Setup CMake
Expand All @@ -109,7 +146,6 @@ jobs:
c-compiler: clang-cl
cxx-compiler: clang-cl
options: |
CMAKE_CROSSCOMPILING=1 \
CMAKE_SYSTEM_NAME=Windows \
CMAKE_SYSTEM_PROCESSOR=ARM64 \
CMAKE_C_COMPILER_TARGET=arm64-pc-windows-msvc \
Expand Down
17 changes: 10 additions & 7 deletions BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ If in doubt, use the most recent stable version of each build tool.
`PERL_EXECUTABLE`.
* To build without Perl (not recommended) see [this section.](#using-pre-generated-build-files)

* [Go](https://golang.org/dl/) 1.18 or later is required. If not found by
* [Go](https://golang.org/dl/) 1.17.13 or later is required. If not found by
CMake, the go executable may be configured explicitly by setting
`GO_EXECUTABLE`.
* To build without Go (not recommended) see [this section.](#using-pre-generated-build-files)
Expand Down Expand Up @@ -62,13 +62,12 @@ Using Make (does not work on Windows):
cmake -B build
make -C build

You usually don't need to run `cmake` again after changing `CMakeLists.txt`
files because the build scripts will detect changes to them and rebuild
themselves automatically.
This produces a debug build by default. Optimisation isn't enabled, and debug
assertions are included. Pass `-DCMAKE_BUILD_TYPE=Release` to `cmake` to
configure a release build:

Note that the default build flags in the top-level `CMakeLists.txt` are for
debugging—optimisation isn't enabled. Pass `-DCMAKE_BUILD_TYPE=Release` to
`cmake` to configure a release build.
cmake -GNinja -B build -DCMAKE_BUILD_TYPE=Release
ninja -C build

If you want to cross-compile then there is an example toolchain file for 32-bit
Intel in `util/`. Wipe out the build directory, run `cmake` like this:
Expand All @@ -87,6 +86,10 @@ remove some code that is especially large.
See [CMake's documentation](https://cmake.org/cmake/help/v3.4/manual/cmake-variables.7.html)
for other variables which may be used to configure the build.

You usually don't need to run `cmake` again after changing `CMakeLists.txt`
files because the build scripts will detect changes to them and rebuild
themselves automatically.

### Building for Android

It's possible to build BoringSSL with the Android NDK using CMake. Recent
Expand Down
Loading

0 comments on commit 6f45e71

Please sign in to comment.