Skip to content

Commit bee5448

Browse files
committed
fix: remove feature "build-with-clang"
1 parent 8cdaba3 commit bee5448

File tree

2 files changed

+14
-26
lines changed

2 files changed

+14
-26
lines changed

Cargo.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ default = ["std", "with-blake2b-rs"]
2121
std = []
2222

2323
# SMT implemented in C
24-
smtc = ["build-with-clang"]
25-
# used with feature "smtc"
26-
build-with-clang = []
24+
smtc = []
2725

2826
# A storage optimized SMT implemented in trie (https://ouvrard-pierre-alain.medium.com/sparse-merkle-tree-86e6e2fc26da)
2927
trie = []

build.rs

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -49,32 +49,22 @@ fn setup_compiler_riscv(build: &mut cc::Build) {
4949
None => "clang-19".into(),
5050
};
5151

52-
if cfg!(feature = "build-with-clang") {
53-
build.compiler(clang);
54-
}
52+
build.compiler(clang);
5553

56-
let compiler = build.get_compiler();
57-
if compiler.is_like_clang() {
58-
build
59-
.no_default_flags(true)
60-
.flag("--target=riscv64")
61-
.flag("-march=rv64imc_zba_zbb_zbc_zbs");
54+
build
55+
.no_default_flags(true)
56+
.flag("--target=riscv64")
57+
.flag("-march=rv64imc_zba_zbb_zbc_zbs");
6258

63-
if env::var("DEBUG").map(|v| v != "false").unwrap_or(false) {
64-
build.flag("-g").flag("-fno-omit-frame-pointer");
65-
}
59+
if env::var("DEBUG").map(|v| v != "false").unwrap_or(false) {
60+
build.flag("-g").flag("-fno-omit-frame-pointer");
61+
}
6662

67-
let opt_level = env::var("OPT_LEVEL").expect("fetching OPT_LEVEL");
68-
if opt_level == "z" {
69-
build.flag("-Os");
70-
} else {
71-
build.flag(format!("-O{}", opt_level));
72-
}
73-
} else if compiler.is_like_gnu() {
74-
build
75-
.flag("-nostartfiles")
76-
.flag("-Wno-dangling-pointer")
77-
.flag("-Wno-nonnull-compare");
63+
let opt_level = env::var("OPT_LEVEL").expect("fetching OPT_LEVEL");
64+
if opt_level == "z" {
65+
build.flag("-Os");
66+
} else {
67+
build.flag(format!("-O{}", opt_level));
7868
}
7969
}
8070

0 commit comments

Comments
 (0)