diff options
| author | gingerBill <bill@gingerbill.org> | 2018-06-03 15:55:14 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2018-06-03 15:55:14 +0100 |
| commit | 05c5f98e8eb3d7d17130e8baa2395a1eb4e473a0 (patch) | |
| tree | 5f9db9798ea5df62ff4700f4dade005dbf46da1a /src/build_settings.cpp | |
| parent | d556fa2cd8570363a66a7d8a2a5abf5ba306e954 (diff) | |
Add -debug-compile parameter for llc
Diffstat (limited to 'src/build_settings.cpp')
| -rw-r--r-- | src/build_settings.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/build_settings.cpp b/src/build_settings.cpp index 36e59f1f3..2519d7d2c 100644 --- a/src/build_settings.cpp +++ b/src/build_settings.cpp @@ -490,12 +490,17 @@ void init_build_context(void) { #define LINK_FLAG_X86 "-arch x86" #endif + gbString llc_flags = gb_string_make_reserve(heap_allocator(), 64); + if (bc->ODIN_DEBUG) { + llc_flags = gb_string_appendc(llc_flags, "-debug-compile "); + } if (bc->ODIN_ARCH == "amd64") { bc->word_size = 8; bc->max_align = 16; - bc->llc_flags = str_lit("-march=x86-64 "); + llc_flags = gb_string_appendc(llc_flags, "-march=x86-64 "); + if (str_eq_ignore_case(cross_compile_target, str_lit("Essence"))) { bc->link_flags = str_lit(" "); } else { @@ -504,13 +509,15 @@ void init_build_context(void) { } else if (bc->ODIN_ARCH == "x86") { bc->word_size = 4; bc->max_align = 8; - bc->llc_flags = str_lit("-march=x86 "); + llc_flags = gb_string_appendc(llc_flags, "-march=x86 "); bc->link_flags = str_lit(LINK_FLAG_X86 " "); } else { gb_printf_err("This current architecture is not supported"); gb_exit(1); } + bc->llc_flags = make_string_c(llc_flags); + isize opt_max = 1023; char *opt_flags_string = gb_alloc_array(heap_allocator(), char, opt_max+1); |