Skip to content

Commit

Permalink
Support build for aarch64-pc-windows-msvc
Browse files Browse the repository at this point in the history
  • Loading branch information
justinwsmith committed Apr 23, 2024
1 parent 575f7d0 commit cf93498
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 5 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/cross.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,3 +114,21 @@ jobs:
target: x86_64-pc-windows-gnu
- name: Test on `x86_64-pc-windows-gnu`
run: cargo test -p aws-lc-rs --target x86_64-pc-windows-gnu --features bindgen

aws-lc-rs-windows-arm64:
if: github.repository_owner == 'aws'
name: aarch64-pc-windows-msvc
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: Install ninja-build tool
uses: seanmiddleditch/gha-setup-ninja@v4
- uses: dtolnay/rust-toolchain@master
id: toolchain
with:
toolchain: stable
target: aarch64-pc-windows-msvc
- name: Build for `aarch64-pc-windows-msvc`
run: cargo build -p aws-lc-rs --target aarch64-pc-windows-msvc --features bindgen
2 changes: 1 addition & 1 deletion aws-lc-sys/aws-lc
Submodule aws-lc updated 88 files
+54 −1 .github/workflows/windows-alt.yml
+1 −1 API-CONVENTIONS.md
+1 −1 BUILDING.md
+31 −1 CMakeLists.txt
+3 −2 INCORPORATING.md
+1 −1 SANDBOXING.md
+38 −38 crypto/CMakeLists.txt
+4 −0 crypto/bio/bio_mem.c
+3 −1 crypto/bytestring/cbs.c
+23 −3 crypto/cipher_extra/cipher_test.cc
+1 −1 crypto/decrepit/x509/x509_decrepit.c
+14 −0 crypto/endian_test.cc
+8 −8 crypto/fipsmodule/FIPS.md
+2 −8 crypto/fipsmodule/bn/add.c
+10 −41 crypto/fipsmodule/bn/generic.c
+2 −6 crypto/fipsmodule/bn/mul.c
+19 −2 crypto/fipsmodule/cipher/cipher.c
+7 −6 crypto/fipsmodule/ec/p224-64.c
+2 −2 crypto/fipsmodule/ecdsa/ecdsa.c
+2 −2 crypto/fipsmodule/rsa/rsa.c
+2 −2 crypto/fipsmodule/service_indicator/service_indicator_test.cc
+167 −0 crypto/internal.h
+2 −0 crypto/mem.c
+0 −2 crypto/x509/asn1_gen.c
+8 −5 crypto/x509/by_dir.c
+23 −33 crypto/x509/by_file.c
+0 −0 crypto/x509/ext_dat.h
+130 −29 crypto/x509/internal.h
+0 −2 crypto/x509/policy.c
+1 −1 crypto/x509/t_crl.c
+0 −1 crypto/x509/t_req.c
+0 −1 crypto/x509/t_x509.c
+1 −1 crypto/x509/tab_test.cc
+1 −1 crypto/x509/v3_akey.c
+1 −1 crypto/x509/v3_akeya.c
+1 −2 crypto/x509/v3_alt.c
+1 −1 crypto/x509/v3_bcons.c
+1 −1 crypto/x509/v3_bitst.c
+0 −2 crypto/x509/v3_conf.c
+1 −1 crypto/x509/v3_cpols.c
+1 −2 crypto/x509/v3_crld.c
+1 −1 crypto/x509/v3_enum.c
+1 −1 crypto/x509/v3_extku.c
+1 −1 crypto/x509/v3_genn.c
+1 −1 crypto/x509/v3_ia5.c
+1 −1 crypto/x509/v3_info.c
+1 −1 crypto/x509/v3_int.c
+3 −2 crypto/x509/v3_lib.c
+2 −2 crypto/x509/v3_ncons.c
+1 −1 crypto/x509/v3_ocsp.c
+1 −1 crypto/x509/v3_pcons.c
+1 −1 crypto/x509/v3_pmaps.c
+3 −4 crypto/x509/v3_prn.c
+12 −38 crypto/x509/v3_purp.c
+1 −2 crypto/x509/v3_skey.c
+1 −1 crypto/x509/v3_utl.c
+0 −2 crypto/x509/x509_cmp.c
+0 −1 crypto/x509/x509_ext.c
+49 −173 crypto/x509/x509_lu.c
+1 −1 crypto/x509/x509_req.c
+0 −1 crypto/x509/x509_set.c
+0 −2 crypto/x509/x509_test.cc
+1 −2 crypto/x509/x509_trs.c
+0 −1 crypto/x509/x509_v3.c
+16 −71 crypto/x509/x509_vfy.c
+66 −119 crypto/x509/x509_vpm.c
+0 −1 crypto/x509/x_crl.c
+0 −1 crypto/x509/x_x509.c
+0 −195 crypto/x509v3/internal.h
+1 −1 fuzz/cert.cc
+0 −1 fuzz/conf.cc
+2 −1 include/openssl/base.h
+4 −0 include/openssl/bio.h
+11 −0 include/openssl/mem.h
+16 −0 include/openssl/opensslconf.h
+18 −34 include/openssl/pem.h
+29 −10 include/openssl/ssl.h
+1,161 −95 include/openssl/x509.h
+16 −1,108 include/openssl/x509v3.h
+124 −0 include/openssl/x509v3_errors.h
+5 −0 ssl/internal.h
+9 −0 ssl/ssl_cipher.cc
+37 −15 ssl/ssl_lib.cc
+77 −1 ssl/ssl_test.cc
+0 −1 ssl/ssl_x509.cc
+54 −22 tests/ci/integration/python_patch/main/aws-lc-cpython.patch
+1 −0 util/doc.config
+12 −5 util/make_errors.go
28 changes: 24 additions & 4 deletions aws-lc-sys/builder/cmake_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
// SPDX-License-Identifier: Apache-2.0 OR ISC

use crate::OutputLib::{Crypto, RustWrapper, Ssl};
use crate::{target, target_arch, target_os, target_vendor, test_command, OutputLibType};
use crate::{
target, target_arch, target_env, target_os, target_vendor, test_command, OutputLibType,
};
use std::env;
use std::ffi::OsStr;
use std::path::PathBuf;
Expand All @@ -14,6 +16,11 @@ pub(crate) struct CmakeBuilder {
output_lib_type: OutputLibType,
}

fn test_ninja_command() -> bool {
test_command("ninja".as_ref(), &["--version".as_ref()]).status
|| test_command("ninja-build".as_ref(), &["--version".as_ref()]).status
}

fn test_nasm_command() -> bool {
test_command("nasm".as_ref(), &["-version".as_ref()]).status
}
Expand Down Expand Up @@ -118,6 +125,13 @@ impl CmakeBuilder {
}
}

if target_os() == "windows" && target_arch() == "aarch64" && target_env() == "msvc" {
cmake_cfg.generator("Ninja");
cmake_cfg.define("CMAKE_C_COMPILER", "clang-cl");
cmake_cfg.define("CMAKE_CXX_COMPILER", "clang-cl");
cmake_cfg.define("CMAKE_ASM_COMPILER", "clang-cl");
}

if cfg!(feature = "asan") {
env::set_var("CC", "clang");
env::set_var("CXX", "clang++");
Expand Down Expand Up @@ -146,9 +160,15 @@ impl crate::Builder for CmakeBuilder {
eprintln!("Missing dependency: cmake");
missing_dependency = true;
};
if target_os() == "windows" && target_arch() == "x86_64" && !test_nasm_command() {
eprintln!("Missing dependency: nasm");
missing_dependency = true;
if target_os() == "windows" {
if target_arch() == "x86_64" && !test_nasm_command() {
eprintln!("Missing dependency: nasm");
missing_dependency = true;
}
if target_arch() == "aarch64" && target_env() == "msvc" && !test_ninja_command() {
eprintln!("Missing dependency: ninja");
missing_dependency = true;
}
}

if missing_dependency {
Expand Down

0 comments on commit cf93498

Please sign in to comment.