Skip to content

Commit

Permalink
Revert -ffile-prefix-map usage w/ CMake (#526)
Browse files Browse the repository at this point in the history
* Revert -ffile-prefix-map usage w/ CMake

* AWS-LC now requires SSE2 on x86

* Fix apidiff build

* Satisfy clippy
  • Loading branch information
justsmth authored Sep 18, 2024
1 parent 8d42802 commit 27f1692
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ jobs:
apidiff:
if: github.repository_owner == 'aws'
runs-on: ubuntu-latest
env:
AWS_LC_SYS_CMAKE_BUILDER: 1
strategy:
fail-fast: false
matrix:
Expand Down
2 changes: 1 addition & 1 deletion aws-lc-rs/src/agreement.rs
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ impl PrivateKey {
}

#[cfg(test)]
#[allow(clippy::missing_errors_doc)]
#[allow(clippy::missing_errors_doc, missing_docs)]
pub fn generate_for_test(
alg: &'static Algorithm,
rng: &dyn crate::rand::SecureRandom,
Expand Down
2 changes: 1 addition & 1 deletion aws-lc-rs/src/agreement/ephemeral.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ impl EphemeralPrivateKey {
}

#[cfg(test)]
#[allow(clippy::missing_errors_doc)]
#[allow(clippy::missing_errors_doc, missing_docs)]
pub fn generate_for_test(
alg: &'static Algorithm,
rng: &dyn SecureRandom,
Expand Down
5 changes: 5 additions & 0 deletions aws-lc-sys/builder/cc_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,11 @@ impl CcBuilder {
.define("BORINGSSL_PREFIX", prefix.as_str());
}

let compiler = cc_build.get_compiler();
if target_arch() == "x86" && (compiler.is_like_clang() || compiler.is_like_gnu()) {
cc_build.flag_if_supported("-msse2");
}

let opt_level = cargo_env("OPT_LEVEL");
match opt_level.as_str() {
"0" | "1" | "2" => {}
Expand Down
10 changes: 6 additions & 4 deletions aws-lc-sys/builder/cmake_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,12 @@ impl CmakeBuilder {
} else {
cmake_cfg.define("CMAKE_BUILD_TYPE", "release");
if target_family() == "unix" || target_env() == "gnu" {
cmake_cfg.cflag(format!(
"-ffile-prefix-map={}=",
self.manifest_dir.display()
));
// This flag is not supported on GCC < v8.1
// TODO: re-enable this
// cmake_cfg.cflag(format!(
// "-ffile-prefix-map={}=",
// self.manifest_dir.display()
// ));
}
}
} else {
Expand Down

0 comments on commit 27f1692

Please sign in to comment.