diff --git a/README.md b/README.md index 7ea3ef1019a698f589f2adcfb2b987bf40e1c453..868bdfc22eb6bc19ade42b98c02b88611a3a6f6d 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,7 @@ the Zig compiler itself: #### Library Dependencies These libraries must be installed on your system, with the development files -available. The Zig compiler dynamically links against them. +available. The Zig compiler links against them. * LLVM, Clang, and LLD libraries == 4.x diff --git a/src/codegen.cpp b/src/codegen.cpp index a80610b73177a9793665bde32d1a37066ea6614f..2b484507113ba1cb6655104e6f8541bb662d820a 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -720,6 +720,11 @@ static LLVMValueRef get_safety_crash_err_fn(CodeGen *g) { addLLVMFnAttr(fn_val, "cold"); LLVMSetLinkage(fn_val, LLVMInternalLinkage); LLVMSetFunctionCallConv(fn_val, LLVMFastCallConv); + addLLVMFnAttr(fn_val, "nounwind"); + if (!g->is_release_build) { + ZigLLVMAddFunctionAttr(fn_val, "no-frame-pointer-elim", "true"); + ZigLLVMAddFunctionAttr(fn_val, "no-frame-pointer-elim-non-leaf", nullptr); + } LLVMBasicBlockRef entry_block = LLVMAppendBasicBlock(fn_val, "Entry"); LLVMBasicBlockRef prev_block = LLVMGetInsertBlock(g->builder);