Skip to content

Commit 28d60d9

Browse files
authored
Adjust scudo standalone buildflags (#8)
This adds all flags mentioned in https://llvm.org/docs/ScudoHardenedAllocator.html#library to the allocator build command in build.rs.
1 parent d564020 commit 28d60d9

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

scudo-sys/build.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,17 @@ fn main() {
3434
}
3535
});
3636

37+
// Opt level is inferred from Cargo and environment variables.
3738
cc::Build::new()
3839
.files(scudo_cpp_files)
3940
.file(SCUDO_RUST_WRAPPER)
4041
.include(scudo_dir)
4142
.include(scudo_dir.join("include"))
4243
.cpp(true)
4344
.pic(true) // Position Independent Code.
45+
.flag("-pthread")
46+
.flag_if_supported("-std=c++17")
47+
.flag_if_supported("-msse4.2")
4448
.shared_flag(true)
4549
.compile("scudo");
46-
47-
// Opt level is inferred from Cargo and environment variables.
48-
49-
// TODO(cneo): -pthread -msse -std=c++17? Those flags are present at:
50-
// https://llvm.org/docs/ScudoHardenedAllocator.html#library
5150
}

0 commit comments

Comments
 (0)