diff --git a/aws-lc-sys/builder/cc_builder.rs b/aws-lc-sys/builder/cc_builder.rs index 9724b680ea5..2d27d7b5a5e 100644 --- a/aws-lc-sys/builder/cc_builder.rs +++ b/aws-lc-sys/builder/cc_builder.rs @@ -1,7 +1,7 @@ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 OR ISC -use crate::{target, target_os, OutputLibType}; +use crate::{target, target_os, target_vendor, OutputLibType}; use std::path::PathBuf; pub(crate) struct CcBuilder { @@ -94,6 +94,8 @@ impl crate::Builder for CcBuilder { .file(self.manifest_dir.join("rust_wrapper.c")); if target_os() == "linux" { cc_build.define("_XOPEN_SOURCE", "700").flag("-lpthread"); + } else if target_vendor() == "apple" { + cc_build.asm_flag("-xassembler-with-cpp"); } for source in &lib.sources { diff --git a/scripts/build/generate_build_toml.sh b/scripts/build/generate_build_toml.sh index 1b6b7b54ee8..930fccfefbd 100755 --- a/scripts/build/generate_build_toml.sh +++ b/scripts/build/generate_build_toml.sh @@ -47,6 +47,10 @@ function find_generated_src_dir() { exit 1 fi ARCH_NAME=$(uname -m) + if [[ "${ARCH_NAME}" == arm64 && ${OS_NAME} == "mac" ]]; then + OS_NAME=ios + ARCH_NAME=aarch64 + fi echo "${OS_NAME}-${ARCH_NAME}" }