aboutsummaryrefslogtreecommitdiffstats
path: root/cc
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2017-07-19 21:36:33 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2017-07-19 21:36:33 +0000
commitcad076b16bcdeea282ea26652e6620a04e17f552 (patch)
tree169fece8540f5d3186b05dc1945ffa483f492ea5 /cc
parent1651953ca53fceb425bd688eb31163bcca4f7313 (diff)
parentf5310e3f88f810dfde6b8859dc00a38a6370345c (diff)
downloadbuild_soong-cad076b16bcdeea282ea26652e6620a04e17f552.tar.gz
build_soong-cad076b16bcdeea282ea26652e6620a04e17f552.tar.bz2
build_soong-cad076b16bcdeea282ea26652e6620a04e17f552.zip
Merge "Add to cflags in compilerFlags()"
Diffstat (limited to 'cc')
-rw-r--r--cc/llndk_library.go5
-rw-r--r--cc/ndk_library.go31
2 files changed, 24 insertions, 12 deletions
diff --git a/cc/llndk_library.go b/cc/llndk_library.go
index 66ffc9fe..c3d3462b 100644
--- a/cc/llndk_library.go
+++ b/cc/llndk_library.go
@@ -61,6 +61,11 @@ type llndkStubDecorator struct {
versionScriptPath android.ModuleGenPath
}
+func (stub *llndkStubDecorator) compilerFlags(ctx ModuleContext, flags Flags) Flags {
+ flags = stub.baseCompiler.compilerFlags(ctx, flags)
+ return addStubLibraryCompilerFlags(flags)
+}
+
func (stub *llndkStubDecorator) compile(ctx ModuleContext, flags Flags, deps PathDeps) Objects {
objs, versionScript := compileStubLibrary(ctx, flags, stub.Properties.Symbol_file, "current", "--vndk")
stub.versionScriptPath = versionScript
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