From 4e5f9a15212e13ab660e0eb8a9c36d665ea9b94c Mon Sep 17 00:00:00 2001 From: Mitch Phillips Date: Fri, 29 Apr 2022 13:12:28 -0700 Subject: [PATCH] Remove warnings about mismatched types with builtins for stubs. Looks like new versions of the toolchain have an error about mismatching the definitions used in the stubs with the builtin definitions. Since we don't care about this when building stubs, ignore it by disabling the builtin definitions. Bug: N/A Test: Build platform with ToT LLVM compiler. Change-Id: I4e449c5fb96d0d5442fd57a7fea02ba69463324b --- cc/ndk_library.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cc/ndk_library.go b/cc/ndk_library.go index 5ef41eae5..59cea7696 100644 --- a/cc/ndk_library.go +++ b/cc/ndk_library.go @@ -284,6 +284,10 @@ func parseNativeAbiDefinition(ctx ModuleContext, symbolFile string, } func compileStubLibrary(ctx ModuleContext, flags Flags, src android.Path) Objects { + // libc/libm stubs libraries end up mismatching with clang's internal definition of these + // functions (which have noreturn attributes and other things). Because we just want to create a + // stub with symbol definitions, and types aren't important in C, ignore the mismatch. + flags.Local.ConlyFlags = append(flags.Local.ConlyFlags, "-fno-builtin") return compileObjs(ctx, flagsToBuilderFlags(flags), "", android.Paths{src}, nil, nil, nil, nil) }