From 0605c7b0e3882edd940b85a41a0b8f3c859c28cc Mon Sep 17 00:00:00 2001 From: Jeroen van Rijn Date: Wed, 22 Oct 2025 10:27:27 +0200 Subject: [PATCH] Add target triple and LLVM code mode debug prints (#5839) --- src/llvm_backend.cpp | 6 ++++++ src/main.cpp | 1 + 2 files changed, 7 insertions(+) diff --git a/src/llvm_backend.cpp b/src/llvm_backend.cpp index 23efa8d22..7742fb39d 100644 --- a/src/llvm_backend.cpp +++ b/src/llvm_backend.cpp @@ -3036,8 +3036,14 @@ gb_internal bool lb_generate_code(lbGenerator *gen) { LLVMCodeModel code_mode = LLVMCodeModelDefault; if (is_arch_wasm()) { code_mode = LLVMCodeModelJITDefault; + debugf("LLVM code mode: LLVMCodeModelJITDefault\n"); } else if (is_arch_x86() && build_context.metrics.os == TargetOs_freestanding) { code_mode = LLVMCodeModelKernel; + debugf("LLVM code mode: LLVMCodeModelKernel\n"); + } + + if (code_mode == LLVMCodeModelDefault) { + debugf("LLVM code mode: LLVMCodeModelDefault\n"); } String llvm_cpu = get_final_microarchitecture(); diff --git a/src/main.cpp b/src/main.cpp index 5fcdedd99..4cc53f319 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3840,6 +3840,7 @@ int main(int arg_count, char const **arg_ptr) { if (build_context.show_debug_messages) { debugf("Selected microarch: %.*s\n", LIT(march)); debugf("Default microarch features: %.*s\n", LIT(default_features)); + debugf("Target triplet: %.*s\n", LIT(build_context.metrics.target_triplet)); for_array(i, build_context.build_paths) { String build_path = path_to_string(heap_allocator(), build_context.build_paths[i]); debugf("build_paths[%ld]: %.*s\n", i, LIT(build_path));