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

Generate outlined_atomics.rs in a deterministic order. #549

Merged
merged 1 commit into from
Aug 29, 2023
Merged
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
6 changes: 3 additions & 3 deletions build.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::{collections::HashMap, env, sync::atomic::Ordering};
use std::{collections::BTreeMap, env, sync::atomic::Ordering};

fn main() {
println!("cargo:rerun-if-changed=build.rs");
Expand Down Expand Up @@ -118,7 +118,7 @@ fn generate_aarch64_outlined_atomics() {

// Generate different macros for add/clr/eor/set so that we can test them separately.
let sym_names = ["cas", "ldadd", "ldclr", "ldeor", "ldset", "swp"];
let mut macros = HashMap::new();
let mut macros = BTreeMap::new();
for sym in sym_names {
macros.insert(sym, gen_macro(sym));
}
Expand Down Expand Up @@ -146,7 +146,7 @@ fn generate_aarch64_outlined_atomics() {
let mut buf = String::new();
for macro_def in macros.values().chain(std::iter::once(&cas16)) {
buf += macro_def;
buf += "}; }";
buf += "}; }\n";
}
let dst = std::env::var("OUT_DIR").unwrap() + "/outlined_atomics.rs";
std::fs::write(dst, buf).unwrap();
Expand Down