Skip to content

Commit eda1ae4

Browse files
adding gcc-specific flags
1 parent 2410fae commit eda1ae4

File tree

3 files changed

+18
-11
lines changed

3 files changed

+18
-11
lines changed

crates/intrinsic-test/src/arm/compile.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@ pub fn build_cpp_compilation(config: &ProcessedCli) -> Option<CppCompilation> {
1818
command = command.add_arch_flags(["faminmax", "lut", "sha3"]);
1919
}
2020

21-
if !cpp_compiler.contains("clang") {
22-
command = command.add_extra_flag("-flax-vector-conversions");
23-
}
21+
command = if !cpp_compiler.contains("clang") {
22+
command.add_extra_flag("-flax-vector-conversions")
23+
} else {
24+
command.add_extra_flag(format!("--target={}", config.target).as_str())
25+
};
2426

2527
let mut cpp_compiler = command.into_cpp_compilation();
2628

crates/intrinsic-test/src/common/compile_c.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,6 @@ impl CompilationCommandBuilder {
8484

8585
cpp_compiler.args(self.extra_flags);
8686

87-
if let Some(target) = &self.target {
88-
cpp_compiler.arg(format!("--target={target}"));
89-
}
90-
9187
CppCompilation(cpp_compiler)
9288
}
9389
}

crates/intrinsic-test/src/x86/compile.rs

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,22 @@ pub fn build_cpp_compilation(config: &ProcessedCli) -> Option<CppCompilation> {
3333
"-mavx512vbmi2",
3434
"-mavx512vnni",
3535
"-mavx512vpopcntdq",
36-
"-ferror-limit=1000",
3736
"-std=c++23",
3837
]);
3938

40-
if !cpp_compiler.contains("clang") {
41-
command = command.add_extra_flag("-flax-vector-conversions");
42-
}
39+
command = if !cpp_compiler.contains("clang") {
40+
command
41+
.add_extra_flags(vec![
42+
"-fmax-errors=1000",
43+
"-flax-vector-conversions",
44+
])
45+
} else {
46+
command
47+
.add_extra_flags(vec![
48+
"-ferror-limit=1000",
49+
format!("--target={}", config.target).as_str(),
50+
])
51+
};
4352

4453
let cpp_compiler = command.into_cpp_compilation();
4554

0 commit comments

Comments
 (0)