From b979fc1bcd6d1bdc19b7f518498fb8c9740d6dea Mon Sep 17 00:00:00 2001 From: Nick Erdmann Date: Sun, 28 Jul 2019 23:51:51 +0200 Subject: initial work torwards std lib support for uefi --- src/codegen.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/codegen.cpp') diff --git a/src/codegen.cpp b/src/codegen.cpp index 0ac945e8c2..6ab76dea35 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -8540,10 +8540,6 @@ static bool want_startup_code(CodeGen *g) { if (g->is_test_build) return false; - // start code does not handle UEFI target - if (g->zig_target->os == OsUefi) - return false; - // WASM freestanding can still have an entry point but other freestanding targets do not. if (g->zig_target->os == OsFreestanding && !target_is_wasm(g->zig_target)) return false; @@ -8553,8 +8549,12 @@ static bool want_startup_code(CodeGen *g) { return false; // If there is a pub main in the root source file, that means we need start code. - if (g->have_pub_main) + if (g->have_pub_main) { return true; + } else { + if (g->zig_target->os == OsUefi) + return false; + } if (g->out_type == OutTypeExe) { // For build-exe, we might add start code even though there is no pub main, so that the -- cgit v1.2.3 From a9b3700c6e5dbc830b648a585970ad61a34c5d63 Mon Sep 17 00:00:00 2001 From: Nick Erdmann Date: Sat, 10 Aug 2019 01:00:09 +0200 Subject: src/codegen: configure stack probes explicitly --- src/codegen.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/codegen.cpp') diff --git a/src/codegen.cpp b/src/codegen.cpp index 6ab76dea35..91c4a47a5a 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -474,6 +474,8 @@ static LLVMValueRef fn_llvm_value(CodeGen *g, ZigFn *fn_table_entry) { } if (g->have_stack_probing && !fn_table_entry->def_scope->safety_off) { addLLVMFnAttrStr(fn_table_entry->llvm_value, "probe-stack", "__zig_probe_stack"); + } else { + addLLVMFnAttrStr(fn_table_entry->llvm_value, "no-stack-arg-probe", ""); } } else { maybe_import_dll(g, fn_table_entry->llvm_value, linkage); -- cgit v1.2.3