Skip to content

Commit

Permalink
Update aws-lc-sys, align w/ AWS-LC v1.34.2 (#509)
Browse files Browse the repository at this point in the history
* Use C11; Align with AWS-LC v1.34.2

* Symbols from ubuntu-latest

* Symbols from macos-13-xlarge

* Symbols from  x86_64-pc-windows-gnu

* Symbols from macos-12

* Symbols for powerpc-unknown-linux-gnu

* Symbols for aarch64-unknown-linux-gnu

* Symbols for i686-unknown-linux-gnu

* Symbols from  x86_64-pc-windows-msvc

* Symbols for arm-unknown-linux-gnueabi

* Symbols for aarch64-unknown-linux-musl

* Symbols from  i686-pc-windows-msvc

* Symbols for powerpc64le-unknown-linux-gnu

* Symbols for x86_64-unknown-linux-musl

* Symbols for armv7-unknown-linux-gnueabihf

* Symbols from  aarch64-pc-windows-msvc

* Generated headers

* Generated bindings from macos-13-xlarge

* Generated bindings from ubuntu-latest

* Generated bindings for x86_64-pc-windows-gnu

* Generated bindings from macos-12

* Generated bindings for aarch64-unknown-linux-musl

* Generated bindings for x86_64-unknown-linux-musl

* Generated bindings for i686-unknown-linux-gnu

* Generated bindings for x86_64-pc-windows-msvc

* Generated bindings for aarch64-pc-windows-msvc

* Generated bindings for i686-pc-windows-msvc

* Generated bindings for aarch64-unknown-linux-gnu

* Collected source files from macos-13-xlarge

* Collected source files from ubuntu-latest

* Collected source files from macos-12

* Collected source files for x86_64-unknown-linux-musl

* Collected source files for i686-unknown-linux-gnu

* Collected source files for aarch64-unknown-linux-gnu

* Collected source files for aarch64-unknown-linux-musl

* Collected NASM files

---------

Co-authored-by: aws-lc-sys-bindings-generator <aws-lc-github-bot@amazon.com>
  • Loading branch information
justsmth and aws-lc-sys-bindings-generator authored Sep 3, 2024
1 parent 8fb6869 commit 1e9c807
Show file tree
Hide file tree
Showing 89 changed files with 22,716 additions and 22,784 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/sys-bindings-generator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ jobs:
- name: No-prefix build for ${{ matrix.os }}
env:
AWS_LC_SYS_NO_PREFIX: "1"
# Ensure that we collect symbols unique to C99 builds
AWS_LC_SYS_C_STD: "99"
run: |
cargo test -p aws-lc-sys --features bindgen
- name: Collect symbols
Expand Down
2 changes: 1 addition & 1 deletion aws-lc-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,4 @@ libc = "0.2.121"
paste = "1.0.11"

[package.metadata.aws-lc-sys]
commit-hash = "05747780676652f41d0b9c570a495e4bb6608560"
commit-hash = "2f1879759b2e0fc70592665bdf10087b64f44b7d"
2 changes: 1 addition & 1 deletion aws-lc-sys/aws-lc
Submodule aws-lc updated 123 files
13 changes: 10 additions & 3 deletions aws-lc-sys/builder/cc_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ mod x86_64_unknown_linux_gnu;
mod x86_64_unknown_linux_musl;

use crate::{
cargo_env, env_var_to_bool, execute_command, out_dir, target, target_arch, target_os,
target_vendor, OutputLibType,
cargo_env, env_var_to_bool, execute_command, out_dir, requested_c_std, target, target_arch,
target_os, target_vendor, CStdRequested, OutputLibType,
};
use std::path::PathBuf;

Expand Down Expand Up @@ -96,15 +96,22 @@ impl CcBuilder {
}
}

fn apply_c_std(cc_build: &mut cc::Build) {
match requested_c_std() {
CStdRequested::C99 => cc_build.std("c99"),
_ => cc_build.std("c11"),
};
}

fn create_builder(&self) -> cc::Build {
let mut cc_build = cc::Build::default();
cc_build
.out_dir(&self.out_dir)
.flag("-std=c99")
.flag("-Wno-unused-parameter")
.cpp(false)
.shared_flag(false)
.static_flag(true);
CcBuilder::apply_c_std(&mut cc_build);
if target_os() == "linux" {
cc_build.define("_XOPEN_SOURCE", "700").flag("-lpthread");
}
Expand Down
4 changes: 2 additions & 2 deletions aws-lc-sys/builder/cc_builder/aarch64_apple_darwin.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0 OR ISC
// Wed Aug 21 22:12:32 UTC 2024
// Wed Aug 28 14:44:16 UTC 2024

use crate::cc_builder::Library;

Expand Down Expand Up @@ -164,7 +164,7 @@ pub(super) const CRYPTO_LIBRARY: Library = Library {
"crypto/rand_extra/pq_custom_randombytes.c",
"crypto/rand_extra/rand_extra.c",
"crypto/rc4/rc4.c",
"crypto/refcount_lock.c",
"crypto/refcount_c11.c",
"crypto/rsa_extra/rsa_asn1.c",
"crypto/rsa_extra/rsa_crypt.c",
"crypto/rsa_extra/rsa_print.c",
Expand Down
2 changes: 1 addition & 1 deletion aws-lc-sys/builder/cc_builder/aarch64_unknown_linux_gnu.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0 OR ISC
// Wed Aug 21 22:18:30 UTC 2024
// Wed Aug 28 14:49:41 UTC 2024

use crate::cc_builder::Library;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0 OR ISC
// Wed Aug 21 22:18:54 UTC 2024
// Wed Aug 28 14:50:47 UTC 2024

use crate::cc_builder::Library;

Expand Down
2 changes: 1 addition & 1 deletion aws-lc-sys/builder/cc_builder/i686_unknown_linux_gnu.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0 OR ISC
// Wed Aug 21 22:19:08 UTC 2024
// Wed Aug 28 14:50:40 UTC 2024

use crate::cc_builder::Library;

Expand Down
4 changes: 2 additions & 2 deletions aws-lc-sys/builder/cc_builder/x86_64_apple_darwin.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0 OR ISC
// Wed Aug 21 22:13:39 UTC 2024
// Wed Aug 28 14:45:46 UTC 2024

use crate::cc_builder::Library;

Expand Down Expand Up @@ -164,7 +164,7 @@ pub(super) const CRYPTO_LIBRARY: Library = Library {
"crypto/rand_extra/pq_custom_randombytes.c",
"crypto/rand_extra/rand_extra.c",
"crypto/rc4/rc4.c",
"crypto/refcount_lock.c",
"crypto/refcount_c11.c",
"crypto/rsa_extra/rsa_asn1.c",
"crypto/rsa_extra/rsa_crypt.c",
"crypto/rsa_extra/rsa_print.c",
Expand Down
2 changes: 1 addition & 1 deletion aws-lc-sys/builder/cc_builder/x86_64_unknown_linux_gnu.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0 OR ISC
// Wed Aug 21 22:12:14 UTC 2024
// Wed Aug 28 14:45:50 UTC 2024

use crate::cc_builder::Library;

Expand Down
2 changes: 1 addition & 1 deletion aws-lc-sys/builder/cc_builder/x86_64_unknown_linux_musl.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0 OR ISC
// Wed Aug 21 22:18:39 UTC 2024
// Wed Aug 28 14:49:39 UTC 2024

use crate::cc_builder::Library;

Expand Down
13 changes: 11 additions & 2 deletions aws-lc-sys/builder/cmake_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
use crate::OutputLib::{Crypto, RustWrapper, Ssl};
use crate::{
allow_prebuilt_nasm, cargo_env, emit_warning, execute_command, is_crt_static, is_no_asm,
option_env, target, target_arch, target_env, target_family, target_os, target_underscored,
target_vendor, test_nasm_command, OutputLibType,
option_env, requested_c_std, target, target_arch, target_env, target_family, target_os,
target_underscored, target_vendor, test_nasm_command, CStdRequested, OutputLibType,
};
use std::env;
use std::ffi::OsString;
Expand Down Expand Up @@ -135,6 +135,15 @@ impl CmakeBuilder {

cmake_cfg.define("ASAN", "1");
}
match requested_c_std() {
CStdRequested::C99 => {
cmake_cfg.define("CMAKE_C_STANDARD", "99");
}
CStdRequested::C11 => {
cmake_cfg.define("CMAKE_C_STANDARD", "11");
}
CStdRequested::None => {}
}

// Allow environment to specify CMake toolchain.
if let Some(toolchain) = option_env("CMAKE_TOOLCHAIN_FILE").or(option_env(format!(
Expand Down
31 changes: 31 additions & 0 deletions aws-lc-sys/builder/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -314,13 +314,39 @@ trait Builder {
fn build(&self) -> Result<(), String>;
}

#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub(crate) enum CStdRequested {
C99,
C11,
None,
}

impl CStdRequested {
fn from_env() -> Self {
if let Some(val) = option_env("AWS_LC_SYS_C_STD") {
let cstd = match val.as_str() {
"99" => CStdRequested::C99,
"11" => CStdRequested::C11,
_ => CStdRequested::None,
};
emit_warning(&format!(
"AWS_LC_SYS_C_STD environment variable set: {cstd:?}"
));
return cstd;
}
CStdRequested::None
}
}

static mut PREGENERATED: bool = false;
static mut AWS_LC_SYS_NO_PREFIX: bool = false;
static mut AWS_LC_SYS_INTERNAL_BINDGEN: bool = false;
static mut AWS_LC_SYS_EXTERNAL_BINDGEN: bool = false;
static mut AWS_LC_SYS_NO_ASM: bool = false;
static mut AWS_LC_SYS_PREBUILT_NASM: Option<bool> = None;

static mut AWS_LC_SYS_C_STD: CStdRequested = CStdRequested::None;

fn initialize() {
unsafe {
AWS_LC_SYS_NO_PREFIX = env_var_to_bool("AWS_LC_SYS_NO_PREFIX").unwrap_or(false);
Expand All @@ -330,6 +356,7 @@ fn initialize() {
env_var_to_bool("AWS_LC_SYS_EXTERNAL_BINDGEN").unwrap_or(false);
AWS_LC_SYS_NO_ASM = env_var_to_bool("AWS_LC_SYS_NO_ASM").unwrap_or(false);
AWS_LC_SYS_PREBUILT_NASM = env_var_to_bool("AWS_LC_SYS_PREBUILT_NASM");
AWS_LC_SYS_C_STD = CStdRequested::from_env();
}

if !is_external_bindgen() && (is_internal_bindgen() || !has_bindgen_feature()) {
Expand Down Expand Up @@ -392,6 +419,10 @@ fn allow_prebuilt_nasm() -> Option<bool> {
unsafe { AWS_LC_SYS_PREBUILT_NASM }
}

fn requested_c_std() -> CStdRequested {
unsafe { AWS_LC_SYS_C_STD }
}

fn has_bindgen_feature() -> bool {
cfg!(feature = "bindgen")
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
Microsoft (R) COFF/PE Dumper Version 14.40.33813.0
Copyright (C) Microsoft Corporation. All rights reserved.


Expand Down
Binary file modified aws-lc-sys/builder/prebuilt-nasm/aes128gcmsiv-x86_64.obj
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
Microsoft (R) COFF/PE Dumper Version 14.40.33813.0
Copyright (C) Microsoft Corporation. All rights reserved.


Expand Down
Binary file modified aws-lc-sys/builder/prebuilt-nasm/aesni-gcm-avx512.obj
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
Microsoft (R) COFF/PE Dumper Version 14.40.33813.0
Copyright (C) Microsoft Corporation. All rights reserved.


Expand Down
Binary file modified aws-lc-sys/builder/prebuilt-nasm/aesni-gcm-x86_64.obj
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
Microsoft (R) COFF/PE Dumper Version 14.40.33813.0
Copyright (C) Microsoft Corporation. All rights reserved.


Expand Down
Binary file modified aws-lc-sys/builder/prebuilt-nasm/aesni-sha1-x86_64.obj
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
Microsoft (R) COFF/PE Dumper Version 14.40.33813.0
Copyright (C) Microsoft Corporation. All rights reserved.


Expand Down
Binary file modified aws-lc-sys/builder/prebuilt-nasm/aesni-sha256-x86_64.obj
Binary file not shown.
Loading

0 comments on commit 1e9c807

Please sign in to comment.