aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Willemsen <dwillemsen@google.com>2016-02-03 23:16:33 -0800
committerDan Willemsen <dwillemsen@google.com>2016-02-08 16:07:22 -0800
commit07cd051a176589fda0ad6a5a2fa6793960c50fbb (patch)
treed0e65b300ae28ebc3fe049671ae85ce3ac7af926
parent7f730fd0ad2e3e7e33dbb3f2b63889d7dab98edf (diff)
downloadbuild_soong-07cd051a176589fda0ad6a5a2fa6793960c50fbb.tar.gz
build_soong-07cd051a176589fda0ad6a5a2fa6793960c50fbb.tar.bz2
build_soong-07cd051a176589fda0ad6a5a2fa6793960c50fbb.zip
Add windows x86_64
Bug: 26957718 Change-Id: I5cfa2f44c27eac0805d21865c45546ed3c2c2103
-rw-r--r--cc/x86_windows_host.go68
-rw-r--r--common/arch.go2
-rw-r--r--common/variable.go1
3 files changed, 60 insertions, 11 deletions
diff --git a/cc/x86_windows_host.go b/cc/x86_windows_host.go
index 8556a645..ad6fdf3d 100644
--- a/cc/x86_windows_host.go
+++ b/cc/x86_windows_host.go
@@ -55,10 +55,25 @@ var (
}
windowsLdflags = []string{
- "-m32",
"-L${windowsGccRoot}/${windowsGccTriple}",
"--enable-stdcall-fixup",
}
+
+ windowsX86Cflags = []string{
+ "-m32",
+ }
+
+ windowsX8664Cflags = []string{
+ "-m64",
+ }
+
+ windowsX86Ldflags = []string{
+ "-m32",
+ }
+
+ windowsX8664Ldflags = []string{
+ "-m64",
+ }
)
const (
@@ -75,18 +90,35 @@ func init() {
pctx.StaticVariable("windowsCflags", strings.Join(windowsCflags, " "))
pctx.StaticVariable("windowsLdflags", strings.Join(windowsLdflags, " "))
+
+ pctx.StaticVariable("windowsX86Cflags", strings.Join(windowsX86Cflags, " "))
+ pctx.StaticVariable("windowsX8664Cflags", strings.Join(windowsX8664Cflags, " "))
+ pctx.StaticVariable("windowsX86Ldflags", strings.Join(windowsX86Ldflags, " "))
+ pctx.StaticVariable("windowsX8664Ldflags", strings.Join(windowsX8664Ldflags, " "))
}
type toolchainWindows struct {
+ cFlags, ldFlags string
+}
+
+type toolchainWindowsX86 struct {
toolchain32Bit
+ toolchainWindows
+}
- cFlags, ldFlags string
+type toolchainWindowsX8664 struct {
+ toolchain64Bit
+ toolchainWindows
}
-func (t *toolchainWindows) Name() string {
+func (t *toolchainWindowsX86) Name() string {
return "x86"
}
+func (t *toolchainWindowsX8664) Name() string {
+ return "x86_64"
+}
+
func (t *toolchainWindows) GccRoot() string {
return "${windowsGccRoot}"
}
@@ -99,16 +131,24 @@ func (t *toolchainWindows) GccVersion() string {
return windowsGccVersion
}
-func (t *toolchainWindows) Cflags() string {
- return "${windowsCflags}"
+func (t *toolchainWindowsX86) Cflags() string {
+ return "${windowsCflags} ${windowsX86Cflags}"
+}
+
+func (t *toolchainWindowsX8664) Cflags() string {
+ return "${windowsCflags} ${windowsX8664Cflags}"
}
func (t *toolchainWindows) Cppflags() string {
return ""
}
-func (t *toolchainWindows) Ldflags() string {
- return "${windowsLdflags}"
+func (t *toolchainWindowsX86) Ldflags() string {
+ return "${windowsLdflags} ${windowsX86Ldflags}"
+}
+
+func (t *toolchainWindowsX8664) Ldflags() string {
+ return "${windowsLdflags} ${windowsX8664Ldflags}"
}
func (t *toolchainWindows) IncludeFlags() string {
@@ -143,12 +183,18 @@ func (t *toolchainWindows) ExecutableSuffix() string {
return ".exe"
}
-var toolchainWindowsSingleton Toolchain = &toolchainWindows{}
+var toolchainWindowsX86Singleton Toolchain = &toolchainWindowsX86{}
+var toolchainWindowsX8664Singleton Toolchain = &toolchainWindowsX8664{}
+
+func windowsX86ToolchainFactory(arch common.Arch) Toolchain {
+ return toolchainWindowsX86Singleton
+}
-func windowsToolchainFactory(arch common.Arch) Toolchain {
- return toolchainWindowsSingleton
+func windowsX8664ToolchainFactory(arch common.Arch) Toolchain {
+ return toolchainWindowsX8664Singleton
}
func init() {
- registerHostToolchainFactory(common.Windows, common.X86, windowsToolchainFactory)
+ registerHostToolchainFactory(common.Windows, common.X86, windowsX86ToolchainFactory)
+ registerHostToolchainFactory(common.Windows, common.X86_64, windowsX8664ToolchainFactory)
}
diff --git a/common/arch.go b/common/arch.go
index 08c570e7..ee1cfae6 100644
--- a/common/arch.go
+++ b/common/arch.go
@@ -264,6 +264,8 @@ type archProperties struct {
Windows interface{} `blueprint:"filter(android:\"arch_variant\")"`
// Properties for module variants being built to run on windows x86 hosts
Windows_x86 interface{} `blueprint:"filter(android:\"arch_variant\")"`
+ // Properties for module variants being built to run on windows x86_64 hosts
+ Windows_x86_64 interface{} `blueprint:"filter(android:\"arch_variant\")"`
// Properties for module variants being built to run on linux or darwin hosts
Not_windows interface{} `blueprint:"filter(android:\"arch_variant\")"`
}
diff --git a/common/variable.go b/common/variable.go
index c899bb41..e9f59151 100644
--- a/common/variable.go
+++ b/common/variable.go
@@ -117,6 +117,7 @@ func (v *productVariables) SetDefaultConfig() {
if runtime.GOOS == "linux" {
v.CrossHost = stringPtr("windows")
v.CrossHostArch = stringPtr("x86")
+ v.CrossHostSecondaryArch = stringPtr("x86_64")
}
}