Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use -pthread, and on more platforms #558

Merged
merged 2 commits into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions aws-lc-fips-sys/builder/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// Modifications copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0 OR ISC

#![allow(clippy::ref_option)]
// Clippy can only be run on nightly toolchain
#![cfg_attr(clippy, feature(custom_inner_attributes))]
#![cfg_attr(clippy, clippy::msrv = "1.77")]
Expand Down
2 changes: 1 addition & 1 deletion aws-lc-rs/src/buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use zeroize::Zeroize;
/// The buffer will be zeroed on drop if it is owned.
pub struct Buffer<'a, T>(Cow<'a, [u8]>, PhantomData<T>);

impl<'a, T> Drop for Buffer<'a, T> {
impl<T> Drop for Buffer<'_, T> {
fn drop(&mut self) {
if let Cow::Owned(b) = &mut self.0 {
b.zeroize();
Expand Down
4 changes: 2 additions & 2 deletions aws-lc-rs/src/hkdf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -401,13 +401,13 @@ pub struct Okm<'a, L: KeyType> {
len: L,
}

impl<'a, L: KeyType> fmt::Debug for Okm<'a, L> {
impl<L: KeyType> fmt::Debug for Okm<'_, L> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_struct("hkdf::Okm").field("prk", &self.prk).finish()
}
}

impl<'a, L: KeyType> Drop for Okm<'a, L> {
impl<L: KeyType> Drop for Okm<'_, L> {
fn drop(&mut self) {
self.info_bytes.zeroize();
}
Expand Down
4 changes: 2 additions & 2 deletions aws-lc-rs/src/kem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -465,15 +465,15 @@ impl<'a> Ciphertext<'a> {
}
}

impl<'a> Drop for Ciphertext<'a> {
impl Drop for Ciphertext<'_> {
fn drop(&mut self) {
if let Cow::Owned(ref mut v) = self.0 {
v.zeroize();
}
}
}

impl<'a> AsRef<[u8]> for Ciphertext<'a> {
impl AsRef<[u8]> for Ciphertext<'_> {
fn as_ref(&self) -> &[u8] {
match self.0 {
Cow::Borrowed(v) => v,
Expand Down
8 changes: 6 additions & 2 deletions aws-lc-sys/builder/cc_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,12 @@ impl CcBuilder {
let compiler = cc_build.get_compiler();
if compiler.is_like_gnu() || compiler.is_like_clang() {
cc_build.flag("-Wno-unused-parameter");
if target_os() == "linux" || target_env() == "gnu" {
cc_build.define("_XOPEN_SOURCE", "700").flag("-lpthread");
if target_os() == "linux"
|| target_os().ends_with("bsd")
|| target_env() == "gnu"
|| target_env() == "musl"
{
cc_build.define("_XOPEN_SOURCE", "700").flag("-pthread");
}
}

Expand Down
1 change: 1 addition & 0 deletions aws-lc-sys/builder/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// Modifications copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0 OR ISC

#![allow(clippy::ref_option)]
// Clippy can only be run on nightly toolchain
#![cfg_attr(clippy, feature(custom_inner_attributes))]
#![cfg_attr(clippy, clippy::msrv = "1.77")]
Expand Down
Loading