aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2017-04-05 01:07:36 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2017-04-05 01:07:37 +0000
commitbb5e5fb4c5b9ded5fe414613ebac8104079fc566 (patch)
treece6e60cbf961254c737ce4332d86c3a4f748579f
parent866810db9f2328fd14b4572f86a365a31ba714b0 (diff)
parentd8f8d076c09eead970011cc4b43f95ea83fe9e66 (diff)
downloadbuild_soong-bb5e5fb4c5b9ded5fe414613ebac8104079fc566.tar.gz
build_soong-bb5e5fb4c5b9ded5fe414613ebac8104079fc566.tar.bz2
build_soong-bb5e5fb4c5b9ded5fe414613ebac8104079fc566.zip
Merge changes Id38ce60b,I7c24c39b
* changes: Disable .toc generation for windows Add ctx.Windows()
-rw-r--r--android/module.go5
-rw-r--r--cc/binary.go4
-rw-r--r--cc/library.go4
-rw-r--r--cc/linker.go2
-rw-r--r--cc/stl.go2
5 files changed, 11 insertions, 6 deletions
diff --git a/android/module.go b/android/module.go
index 4fba1cf7..3c09b3ea 100644
--- a/android/module.go
+++ b/android/module.go
@@ -57,6 +57,7 @@ type androidBaseContext interface {
Host() bool
Device() bool
Darwin() bool
+ Windows() bool
Debug() bool
PrimaryArch() bool
Proprietary() bool
@@ -611,6 +612,10 @@ func (a *androidBaseContextImpl) Darwin() bool {
return a.target.Os == Darwin
}
+func (a *androidBaseContextImpl) Windows() bool {
+ return a.target.Os == Windows
+}
+
func (a *androidBaseContextImpl) Debug() bool {
return a.debug
}
diff --git a/cc/binary.go b/cc/binary.go
index 637f6c7a..25783113 100644
--- a/cc/binary.go
+++ b/cc/binary.go
@@ -204,7 +204,7 @@ func (binary *binaryDecorator) linkerFlags(ctx ModuleContext, flags Flags) Flags
if ctx.Host() && !binary.static() {
if !ctx.AConfig().IsEnvTrue("DISABLE_HOST_PIE") {
flags.LdFlags = append(flags.LdFlags, "-pie")
- if ctx.Os() == android.Windows {
+ if ctx.Windows() {
flags.LdFlags = append(flags.LdFlags, "-Wl,-e_mainCRTStartup")
}
}
@@ -213,7 +213,7 @@ func (binary *binaryDecorator) linkerFlags(ctx ModuleContext, flags Flags) Flags
// MinGW spits out warnings about -fPIC even for -fpie?!) being ignored because
// all code is position independent, and then those warnings get promoted to
// errors.
- if ctx.Os() != android.Windows {
+ if !ctx.Windows() {
flags.CFlags = append(flags.CFlags, "-fpie")
}
diff --git a/cc/library.go b/cc/library.go
index 953c37a1..e9e796ed 100644
--- a/cc/library.go
+++ b/cc/library.go
@@ -228,7 +228,7 @@ func (library *libraryDecorator) linkerFlags(ctx ModuleContext, flags Flags) Fla
// MinGW spits out warnings about -fPIC even for -fpie?!) being ignored because
// all code is position independent, and then those warnings get promoted to
// errors.
- if ctx.Os() != android.Windows {
+ if !ctx.Windows() {
flags.CFlags = append(flags.CFlags, "-fPIC")
}
@@ -462,7 +462,7 @@ func (library *libraryDecorator) linkShared(ctx ModuleContext,
builderFlags := flagsToBuilderFlags(flags)
- if !ctx.Darwin() {
+ if !ctx.Darwin() && !ctx.Windows() {
// Optimize out relinking against shared libraries whose interface hasn't changed by
// depending on a table of contents file instead of the library itself.
tocPath := outputFile.RelPathString()
diff --git a/cc/linker.go b/cc/linker.go
index 07d9aa80..4d21d99b 100644
--- a/cc/linker.go
+++ b/cc/linker.go
@@ -156,7 +156,7 @@ func (linker *baseLinker) linkerDeps(ctx BaseModuleContext, deps Deps) Deps {
}
}
- if ctx.Os() == android.Windows {
+ if ctx.Windows() {
deps.LateStaticLibs = append(deps.LateStaticLibs, "libwinpthread")
}
diff --git a/cc/stl.go b/cc/stl.go
index 43776f76..9e671456 100644
--- a/cc/stl.go
+++ b/cc/stl.go
@@ -60,7 +60,7 @@ func (stl *stl) begin(ctx BaseModuleContext) {
ctx.ModuleErrorf("stl: %q is not a supported STL with sdk_version set", s)
return ""
}
- } else if ctx.Os() == android.Windows {
+ } else if ctx.Windows() {
switch s {
case "libc++", "libc++_static", "libstdc++", "":
// libc++ is not supported on mingw