Skip to content

Commit

Permalink
Update to use Ubuntu22.04 with newer clang
Browse files Browse the repository at this point in the history
  • Loading branch information
Yan Peng committed Nov 1, 2023
1 parent 62e36cd commit efa5477
Show file tree
Hide file tree
Showing 7 changed files with 84 additions and 17 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,19 @@ jobs:
# Runs the formal verification action
- name: Coq Proofs
uses: ./.github/actions/Coq
nsym:
# The type of runner that the job will run on
runs-on: aws-lc-verification_ubuntu-latest_16-core

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Check out main repo and submodules.
- uses: actions/checkout@v2
name: check out top-level repository and all submodules
with:
submodules: true

# Runs the formal verification action
- name: NSym Proofs
uses: ./NSym/

28 changes: 28 additions & 0 deletions Dockerfile.nsym
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0


FROM ubuntu:22.04
ENV GOROOT=/usr/local/go
ENV PATH="$GOROOT/bin:$PATH"
ARG GO_VERSION=1.20.1
ARG GO_ARCHIVE="go${GO_VERSION}.linux-amd64.tar.gz"
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
RUN apt-get update
RUN apt-get install -y wget unzip git cmake clang llvm python3-pip libncurses5 opam libgmp-dev cabal-install
RUN apt-get install -y g++-aarch64-linux-gnu lld

RUN wget "https://dl.google.com/go/${GO_ARCHIVE}" && tar -xvf $GO_ARCHIVE && \
mkdir $GOROOT && mv go/* $GOROOT && rm $GO_ARCHIVE
RUN pip3 install wllvm
RUN pip3 install psutil

ADD ./SAW/scripts /lc/scripts
RUN /lc/scripts/docker_install.sh
ENV CRYPTOLPATH="../../../cryptol-specs:../../spec"

# This container expects all files in the directory to be mounted or copied.
# The GitHub action will mount the workspace and set the working directory of the container.
# Another way to mount the files is: docker run -v `pwd`:`pwd` -w `pwd` <name>

ENTRYPOINT ["./NSym/scripts/docker_entrypoint.sh"]
9 changes: 9 additions & 0 deletions NSym/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0

name: 'AWS-LC Formal Verification NSym Proofs'
description: 'Check NSym proofs to validate some specifications used in AWS-LC'
runs:
using: 'docker'
image: '../Dockerfile.nsym'
entrypoint: 'NSym/scripts/docker_entrypoint.sh'
24 changes: 15 additions & 9 deletions NSym/scripts/build_aarch64.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# https://cmake.org/cmake/help/book/mastering-cmake/chapter/Cross%20Compiling%20With%20CMake.html

# the name of the target operating system
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR aarch64)
Expand All @@ -7,13 +8,18 @@ set(CMAKE_SYSTEM_PROCESSOR aarch64)
set(CMAKE_C_COMPILER clang)
set(CMAKE_CXX_COMPILER clang++)

# where is the target environment located
set(CMAKE_FIND_ROOT_PATH /usr/aarch64-linux-gnu)
set(CMAKE_SYSROOT /usr/aarch64-linux-gnu)
# The following settings are needed on Ubuntu20.04 with Clang-10,
# but not on Ubuntu22.04 with Clang-14 for some reason
# ------------
# # where is the target environment located
# # set(CMAKE_FIND_ROOT_PATH /usr/aarch64-linux-gnu)
# # set(CMAKE_SYSROOT /usr/aarch64-linux-gnu)

# adjust the default behavior of the FIND_XXX() commands:
# search programs in the host environment
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# search headers and libraries in the target environment
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
# # adjust the default behavior of the FIND_XXX() commands:
# # search programs in the host environment
# set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# # search headers and libraries in the target environment
# set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
# set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
# set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
# ------------
16 changes: 9 additions & 7 deletions NSym/scripts/build_aarch64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,22 @@
set -ex

BUILD_TYPE=$1
MICRO_ARCH=$2
TARGET="aarch64-none-linux-gnu"

mkdir -p build_src/aarch64
cd build_src/aarch64
export LDFLAGS="-fuse-ld=lld"
cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE \
-DKEEP_LOCAL_SYMBOLS=1 \
-DKEEP_ASM_LOCAL_SYMBOLS=1 \
-DBUILD_LIBSSL=OFF \
-DCMAKE_TOOLCHAIN_FILE=../../scripts/build_aarch64.cmake \
-DCMAKE_C_FLAGS="-mcpu=neoverse-n1 -I/usr/aarch64-linux-gnu/include/c++/9/aarch64-linux-gnu" \
-DCMAKE_CXX_FLAGS="-mcpu=neoverse-n1 -I/usr/aarch64-linux-gnu/include/c++/9/aarch64-linux-gnu" \
-DCMAKE_ASM_FLAGS="-mcpu=neoverse-n1 -I/usr/aarch64-linux-gnu/include/c++/9/aarch64-linux-gnu" \
-DCMAKE_C_COMPILER_TARGET="aarch64-none-linux-gnu" \
-DCMAKE_CXX_COMPILER_TARGET="aarch64-none-linux-gnu" \
-DCMAKE_ASM_COMPILER_TARGET="aarch64-none-linux-gnu" \
-DCMAKE_C_FLAGS="-mcpu="$MICRO_ARCH \
-DCMAKE_CXX_FLAGS="-mcpu="$MICRO_ARCH \
-DCMAKE_ASM_FLAGS="-mcpu="$MICRO_ARCH \
-DCMAKE_C_COMPILER_TARGET=$TARGET \
-DCMAKE_CXX_COMPILER_TARGET=$TARGET \
-DCMAKE_ASM_COMPILER_TARGET=$TARGET \
../../../src

NUM_CPU_THREADS=$(grep -c ^processor /proc/cpuinfo)
Expand Down
7 changes: 7 additions & 0 deletions NSym/scripts/docker_entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh -ex

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

cd NSym
./scripts/build_aarch64.sh "Release" "neoverse-n1"
2 changes: 1 addition & 1 deletion src
Submodule src updated 84 files
+3 −0 .github/workflows/abidiff.yml
+4 −1 .github/workflows/aws-lc-rs.yml
+3 −0 .github/workflows/integrations.yml
+27 −0 .github/workflows/osx.yml
+95 −0 .github/workflows/windows.yml
+7 −4 CMakeLists.txt
+3 −8 crypto/CMakeLists.txt
+34 −1 crypto/asn1/a_time.c
+4 −1 crypto/asn1/a_utctm.c
+41 −0 crypto/asn1/asn1_test.cc
+6 −7 crypto/bio/bio_mem.c
+125 −16 crypto/bio/bio_test.cc
+12 −0 crypto/bio/file.c
+30 −7 crypto/chacha/chacha.c
+56 −29 crypto/curve25519/curve25519.c
+4 −4 crypto/curve25519/spake25519.c
+8 −2 crypto/dsa/dsa_test.cc
+18 −0 crypto/dsa/internal.h
+4 −2 crypto/dynamic_loading_test.c
+5 −7 crypto/endian_test.cc
+7 −6 crypto/evp_extra/print.c
+13 −1 crypto/evp_extra/scrypt.c
+6 −4 crypto/fipsmodule/CMakeLists.txt
+18 −6 crypto/fipsmodule/aes/aes_nohw.c
+2 −0 crypto/fipsmodule/bcm.c
+2 −2 crypto/fipsmodule/cipher/aead.c
+25 −0 crypto/fipsmodule/ec/ec_test.cc
+7 −1 crypto/fipsmodule/ec/internal.h
+6 −8 crypto/fipsmodule/ec/p384.c
+4 −6 crypto/fipsmodule/ec/p521.c
+26 −3 crypto/fipsmodule/modes/xts.c
+1 −1 crypto/fipsmodule/rand/cpu_jitter_test.cc
+6 −0 crypto/fipsmodule/rand/rand.c
+2 −2 crypto/fipsmodule/service_indicator/service_indicator_test.cc
+105 −97 crypto/fipsmodule/sha/sha3_test.cc
+9 −1 crypto/impl_dispatch_test.cc
+12 −5 crypto/siphash/siphash.c
+5 −5 crypto/siphash/siphash_test.cc
+126 −72 crypto/stack/stack.c
+36 −0 crypto/stack/stack_test.cc
+1 −1 crypto/x509/x509_trs.c
+4 −6 crypto/x509v3/v3_purp.c
+2 −2 include/openssl/aead.h
+5 −0 include/openssl/asn1.h
+2 −2 include/openssl/base.h
+24 −11 include/openssl/bio.h
+0 −21 include/openssl/dsa.h
+7 −2 include/openssl/ssl.h
+229 −208 include/openssl/stack.h
+1 −1 include/openssl/x509.h
+3 −2 include/openssl/x509v3.h
+13 −5 ssl/ssl_cipher.cc
+3 −0 ssl/ssl_test.cc
+0 −20 tests/ci/cdk/cdk/aws_lc_ec2_test_framework_ci_stack.py
+0 −11 tests/ci/cdk/cdk/codebuild/ec2_test_framework_omnibus.yaml
+20 −0 tests/ci/cdk/cdk/codebuild/github_ci_integration_omnibus.yaml
+20 −8 tests/ci/cdk/cdk/codebuild/github_ci_linux_x86_omnibus.yaml
+9 −3 tests/ci/cdk/cdk/codebuild/github_ci_windows_x86_omnibus.yaml
+0 −34 tests/ci/cdk/cdk/ssm/m1_tests_ssm_document.yaml
+0 −21 tests/ci/codebuild/linux-x86/amazonlinux-2_gcc-7x_intel-sde.yml
+0 −14 tests/ci/codebuild/windows-x86/windows-msvc2015.yml
+0 −14 tests/ci/codebuild/windows-x86/windows-msvc2017.yml
+2 −2 tests/ci/codebuild/windows/run_windows_target.yml
+10 −0 tests/ci/common_posix_setup.sh
+5 −4 tests/ci/docker_images/linux-x86/amazonlinux-2_gcc-7x-intel-sde/Dockerfile
+1 −0 tests/ci/docker_images/linux-x86/build_images.sh
+2 −1 tests/ci/docker_images/linux-x86/push_images.sh
+42 −0 tests/ci/docker_images/linux-x86/ubuntu-22.04_clang-14x-sde/Dockerfile
+14 −0 tests/ci/docker_images/windows/vs2017/Dockerfile
+3 −0 tests/ci/docker_images/windows/windows_base/Dockerfile
+12 −0 tests/ci/integration/README.md
+68 −23 tests/ci/integration/nginx_patch/aws-lc-nginx.patch
+27 −0 tests/ci/integration/run_crt_integration.sh
+2 −2 tests/ci/integration/sslproxy_patch/aws-lc-sslproxy.patch
+14 −2 tests/ci/run_fips_tests.sh
+0 −96 tests/ci/run_m1_ec2_instance.sh
+4 −1 tests/ci/run_tests_with_sde.sh
+14 −0 tests/ci/run_tests_with_sde_asan.sh
+39 −3 tests/ci/run_windows_tests.bat
+8 −2 tool/speed.cc
+42 −6 util/all_tests.go
+4 −4 util/bot/DEPS
+8 −2 util/bot/update_clang.py
+2 −0 util/fipstools/test-break-kat.sh

0 comments on commit efa5477

Please sign in to comment.