diff options
Diffstat (limited to 'cc/ndk_library.go')
-rw-r--r-- | cc/ndk_library.go | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/cc/ndk_library.go b/cc/ndk_library.go index 5765aa92..dbfc5be3 100644 --- a/cc/ndk_library.go +++ b/cc/ndk_library.go @@ -242,6 +242,25 @@ func (c *stubDecorator) compilerInit(ctx BaseModuleContext) { ndkMigratedLibs = append(ndkMigratedLibs, name) } +func addStubLibraryCompilerFlags(flags Flags) Flags { + flags.CFlags = append(flags.CFlags, + // We're knowingly doing some otherwise unsightly things with builtin + // functions here. We're just generating stub libraries, so ignore it. + "-Wno-incompatible-library-redeclaration", + "-Wno-builtin-requires-header", + "-Wno-invalid-noreturn", + // These libraries aren't actually used. Don't worry about unwinding + // (avoids the need to link an unwinder into a fake library). + "-fno-unwind-tables", + ) + return flags +} + +func (stub *stubDecorator) compilerFlags(ctx ModuleContext, flags Flags) Flags { + flags = stub.baseCompiler.compilerFlags(ctx, flags) + return addStubLibraryCompilerFlags(flags) +} + func compileStubLibrary(ctx ModuleContext, flags Flags, symbolFile, apiLevel, vndk string) (Objects, android.ModuleGenPath) { arch := ctx.Arch().ArchType.String() @@ -263,18 +282,6 @@ func compileStubLibrary(ctx ModuleContext, flags Flags, symbolFile, apiLevel, vn }, }) - flags.CFlags = append(flags.CFlags, - // We're knowingly doing some otherwise unsightly things with builtin - // functions here. We're just generating stub libraries, so ignore it. - "-Wno-incompatible-library-redeclaration", - "-Wno-builtin-requires-header", - "-Wno-invalid-noreturn", - - // These libraries aren't actually used. Don't worry about unwinding - // (avoids the need to link an unwinder into a fake library). - "-fno-unwind-tables", - ) - subdir := "" srcs := []android.Path{stubSrcPath} return compileObjs(ctx, flagsToBuilderFlags(flags), subdir, srcs, nil), versionScriptPath |