aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cc/cc.go1
-rw-r--r--cc/mips_device.go4
-rw-r--r--cc/toolchain.go5
3 files changed, 10 insertions, 0 deletions
diff --git a/cc/cc.go b/cc/cc.go
index f324c748..b909cc08 100644
--- a/cc/cc.go
+++ b/cc/cc.go
@@ -566,6 +566,7 @@ func (c *CCBase) collectFlags(ctx common.AndroidModuleContext, toolchain Toolcha
flags.GlobalFlags = append(flags.GlobalFlags, instructionSetFlags)
if flags.Clang {
+ flags.AsFlags = append(flags.AsFlags, toolchain.ClangAsflags())
flags.CppFlags = append(flags.CppFlags, "${commonClangGlobalCppflags}")
flags.GlobalFlags = append(flags.GlobalFlags,
toolchain.ClangCflags(),
diff --git a/cc/mips_device.go b/cc/mips_device.go
index d88c9060..cd92eab1 100644
--- a/cc/mips_device.go
+++ b/cc/mips_device.go
@@ -211,6 +211,10 @@ func (t *toolchainMips) ToolchainClangCflags() string {
return t.toolchainClangCflags
}
+func (t *toolchainMips) ClangAsflags() string {
+ return "-fPIC"
+}
+
func (t *toolchainMips) ClangCflags() string {
return t.clangCflags
}
diff --git a/cc/toolchain.go b/cc/toolchain.go
index ac511143..9f6ad2ea 100644
--- a/cc/toolchain.go
+++ b/cc/toolchain.go
@@ -60,6 +60,7 @@ type Toolchain interface {
ClangSupported() bool
ClangTriple() string
ToolchainClangCflags() string
+ ClangAsflags() string
ClangCflags() string
ClangCppflags() string
ClangLdflags() string
@@ -112,6 +113,10 @@ func (toolchainBase) ExecutableSuffix() string {
return ""
}
+func (toolchainBase) ClangAsflags() string {
+ return ""
+}
+
type toolchain64Bit struct {
toolchainBase
}