From 2ee864ca5eb46468e8e0f4237a5532b76b60d715 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Tue, 5 Jul 2022 15:21:20 -0700 Subject: CLI: add support for -fno-builtin --- src/codegen/llvm.zig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/codegen') diff --git a/src/codegen/llvm.zig b/src/codegen/llvm.zig index 590cee3d73..1b7e33a3a4 100644 --- a/src/codegen/llvm.zig +++ b/src/codegen/llvm.zig @@ -2347,7 +2347,9 @@ pub const DeclGen = struct { if (comp.unwind_tables) { dg.addFnAttr(llvm_fn, "uwtable"); } - if (comp.bin_file.options.skip_linker_dependencies) { + if (comp.bin_file.options.skip_linker_dependencies or + comp.bin_file.options.no_builtin) + { // The intent here is for compiler-rt and libc functions to not generate // infinite recursion. For example, if we are compiling the memcpy function, // and llvm detects that the body is equivalent to memcpy, it may replace the -- cgit v1.2.3