Skip to content

Commit

Permalink
Remove now no-longer-necessary patches
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcrichton committed Dec 9, 2020
1 parent eef95f2 commit c73bd12
Showing 1 changed file with 0 additions and 35 deletions.
35 changes: 0 additions & 35 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,6 @@ fn cp_r(src: &Path, dst: &Path) {

fn apply_patches(target: &str, inner: &Path) {
apply_patches_musl(target, inner);
apply_patches_aarch64_apple_darwin(target, inner);
}

fn apply_patches_musl(target: &str, inner: &Path) {
Expand All @@ -473,40 +472,6 @@ fn apply_patches_musl(target: &str, inner: &Path) {
fs::write(path, buf).unwrap();
}

fn apply_patches_aarch64_apple_darwin(target: &str, inner: &Path) {
if target != "aarch64-apple-darwin" {
return;
}

// Apply build system changes to allow configuring and building
// for Apple's ARM64 platform.
// https://github.com/openssl/openssl/pull/12369

let path = inner.join("Configurations/10-main.conf");
let mut buf = fs::read_to_string(&path).unwrap();

assert!(
!buf.contains("darwin64-arm64-cc"),
"{} already contains instructions for aarch64-apple-darwin",
path.display(),
);

const PATCH: &str = r#"
"darwin64-arm64-cc" => {
inherit_from => [ "darwin-common", asm("aarch64_asm") ],
CFLAGS => add("-Wall"),
cflags => add("-arch arm64"),
lib_cppflags => add("-DL_ENDIAN"),
bn_ops => "SIXTY_FOUR_BIT_LONG",
perlasm_scheme => "ios64",
},"#;

let x86_64_stanza = buf.find(r#" "darwin64-x86_64-cc""#).unwrap();
buf.insert_str(x86_64_stanza, PATCH);

fs::write(path, buf).unwrap();
}

fn sanitize_sh(path: &Path) -> String {
if !cfg!(windows) {
return path.to_str().unwrap().to_string();
Expand Down

0 comments on commit c73bd12

Please sign in to comment.