mirror of
https://github.com/odin-lang/Odin.git
synced 2026-01-06 13:07:59 +00:00
Add asan lib for Windows
This commit is contained in:
BIN
bin/llvm/windows/clang_rt.asan-x86_64.lib
Normal file
BIN
bin/llvm/windows/clang_rt.asan-x86_64.lib
Normal file
Binary file not shown.
24
build.bat
24
build.bat
@@ -82,9 +82,9 @@ set libs= ^
|
||||
|
||||
rem DO NOT TOUCH!
|
||||
rem THIS TILDE STUFF IS FOR DEVELOPMENT ONLY!
|
||||
set tilde_backend=0
|
||||
set tilde_backend=1
|
||||
if %tilde_backend% EQU 1 (
|
||||
set libs=%libs% src\tilde\tb.lib
|
||||
set libs=%libs% src\tilde\tb.lib onecore.lib
|
||||
set compiler_defines=%compiler_defines% -DODIN_TILDE_BACKEND
|
||||
)
|
||||
rem DO NOT TOUCH!
|
||||
@@ -107,10 +107,26 @@ del *.ilk > NUL 2> NUL
|
||||
cl %compiler_settings% "src\main.cpp" "src\libtommath.cpp" /link %linker_settings% -OUT:%exe_name%
|
||||
if %errorlevel% neq 0 goto end_of_build
|
||||
|
||||
call build_vendor.bat
|
||||
rem call build_vendor.bat
|
||||
rem if %errorlevel% neq 0 goto end_of_build
|
||||
|
||||
rem if %release_mode% EQU 0 odin run examples/demo
|
||||
|
||||
rem %exe_name% check examples/all -show-timings
|
||||
rem %exe_name% build examples/demo -show-timings -keep-temp-files
|
||||
%exe_name% run examples/bug -show-timings -o:none -sanitize:address
|
||||
rem %exe_name% run examples/bug -tilde -debug
|
||||
|
||||
|
||||
if %errorlevel% neq 0 goto end_of_build
|
||||
|
||||
if %release_mode% EQU 0 odin run examples/demo
|
||||
pushd W:\JangaFX\EmberGen\embergen2
|
||||
rem W:\Odin\odin build . -show-timings
|
||||
rem W:\Odin\odin run . -show-timings
|
||||
popd
|
||||
|
||||
|
||||
rem %exe_name% check examples/all -vet -strict-style -show-timings
|
||||
|
||||
del *.obj > NUL 2> NUL
|
||||
|
||||
|
||||
@@ -2586,6 +2586,21 @@ gb_internal bool lb_generate_code(lbGenerator *gen) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if (build_context.sanitizer_flags & SanitizerFlag_Address) {
|
||||
auto paths = array_make<String>(heap_allocator(), 0, 1);
|
||||
if (build_context.metrics.os == TargetOs_windows) {
|
||||
String path = concatenate_strings(permanent_allocator(), build_context.ODIN_ROOT, str_lit("\\bin\\llvm\\windows\\clang_rt.asan-x86_64.lib"));
|
||||
array_add(&paths, path);
|
||||
}
|
||||
Entity *lib = alloc_entity_library_name(nullptr, make_token_ident("asan_lib"), nullptr, slice_from_array(paths), str_lit("asan_lib"));
|
||||
array_add(&gen->foreign_libraries, lib);
|
||||
}
|
||||
if (build_context.sanitizer_flags & SanitizerFlag_Memory) {
|
||||
}
|
||||
if (build_context.sanitizer_flags & SanitizerFlag_Thread) {
|
||||
}
|
||||
|
||||
gb_sort_array(gen->foreign_libraries.data, gen->foreign_libraries.count, foreign_library_cmp);
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user