CLI: add support for -fno-builtin

This commit is contained in:
Andrew Kelley
2022-07-05 15:21:20 -07:00
parent 927e59d053
commit 2ee864ca5e
6 changed files with 52 additions and 4 deletions

View File

@@ -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