Add an instruction_set property to Arch
Used to allow switching between thumb and arm ISAs
Change-Id: I94aa83cee7179e83c97eedc32fd216965b626d33
diff --git a/cc/toolchain.go b/cc/toolchain.go
index d79f23c..291821b 100644
--- a/cc/toolchain.go
+++ b/cc/toolchain.go
@@ -15,6 +15,8 @@
package cc
import (
+ "fmt"
+
"android/soong/common"
)
@@ -38,6 +40,7 @@
Cppflags() string
Ldflags() string
IncludeFlags() string
+ InstructionSetFlags(string) (string, error)
ClangTriple() string
ClangCflags() string
@@ -47,7 +50,18 @@
Is64Bit() bool
}
+type toolchainBase struct {
+}
+
+func (toolchainBase) InstructionSetFlags(s string) (string, error) {
+ if s != "" {
+ return "", fmt.Errorf("instruction_set: %s is not a supported instruction set", s)
+ }
+ return "", nil
+}
+
type toolchain64Bit struct {
+ toolchainBase
}
func (toolchain64Bit) Is64Bit() bool {
@@ -55,6 +69,7 @@
}
type toolchain32Bit struct {
+ toolchainBase
}
func (toolchain32Bit) Is64Bit() bool {