mirror of
https://github.com/Ed94/Odin.git
synced 2026-06-18 11:52:22 -07:00
Support -sanitize:<string> for address, memory, thread for LLVM 17
This commit is contained in:
@@ -264,6 +264,14 @@ u64 get_vet_flag_from_name(String const &name) {
|
||||
}
|
||||
|
||||
|
||||
enum SanitizerFlags : u32 {
|
||||
SanitizerFlag_NONE = 0,
|
||||
SanitizerFlag_Address = 1u<<0,
|
||||
SanitizerFlag_Memory = 1u<<1,
|
||||
SanitizerFlag_Thread = 1u<<2,
|
||||
};
|
||||
|
||||
|
||||
|
||||
// This stores the information for the specify architecture of this build
|
||||
struct BuildContext {
|
||||
@@ -305,6 +313,7 @@ struct BuildContext {
|
||||
String pdb_filepath;
|
||||
|
||||
u64 vet_flags;
|
||||
u32 sanitizer_flags;
|
||||
|
||||
bool has_resource;
|
||||
String link_flags;
|
||||
@@ -1738,6 +1747,13 @@ gb_internal bool init_build_paths(String init_filename) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (build_context.sanitizer_flags & SanitizerFlag_Memory) {
|
||||
if (build_context.metrics.os != TargetOs_linux) {
|
||||
gb_printf_err("-sanitize:memory is only supported on linux\n");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (bc->target_features_string.len != 0) {
|
||||
enable_target_feature({}, bc->target_features_string);
|
||||
|
||||
Reference in New Issue
Block a user