Add windows x86_64

Bug: 26957718
Change-Id: I5cfa2f44c27eac0805d21865c45546ed3c2c2103
This commit is contained in:
Dan Willemsen
2016-02-03 23:16:33 -08:00
parent 7f730fd0ad
commit 07cd051a17
3 changed files with 61 additions and 12 deletions

View File

@@ -55,10 +55,25 @@ var (
} }
windowsLdflags = []string{ windowsLdflags = []string{
"-m32",
"-L${windowsGccRoot}/${windowsGccTriple}", "-L${windowsGccRoot}/${windowsGccTriple}",
"--enable-stdcall-fixup", "--enable-stdcall-fixup",
} }
windowsX86Cflags = []string{
"-m32",
}
windowsX8664Cflags = []string{
"-m64",
}
windowsX86Ldflags = []string{
"-m32",
}
windowsX8664Ldflags = []string{
"-m64",
}
) )
const ( const (
@@ -75,18 +90,35 @@ func init() {
pctx.StaticVariable("windowsCflags", strings.Join(windowsCflags, " ")) pctx.StaticVariable("windowsCflags", strings.Join(windowsCflags, " "))
pctx.StaticVariable("windowsLdflags", strings.Join(windowsLdflags, " ")) 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 { type toolchainWindows struct {
toolchain32Bit
cFlags, ldFlags string cFlags, ldFlags string
} }
func (t *toolchainWindows) Name() string { type toolchainWindowsX86 struct {
toolchain32Bit
toolchainWindows
}
type toolchainWindowsX8664 struct {
toolchain64Bit
toolchainWindows
}
func (t *toolchainWindowsX86) Name() string {
return "x86" return "x86"
} }
func (t *toolchainWindowsX8664) Name() string {
return "x86_64"
}
func (t *toolchainWindows) GccRoot() string { func (t *toolchainWindows) GccRoot() string {
return "${windowsGccRoot}" return "${windowsGccRoot}"
} }
@@ -99,16 +131,24 @@ func (t *toolchainWindows) GccVersion() string {
return windowsGccVersion return windowsGccVersion
} }
func (t *toolchainWindows) Cflags() string { func (t *toolchainWindowsX86) Cflags() string {
return "${windowsCflags}" return "${windowsCflags} ${windowsX86Cflags}"
}
func (t *toolchainWindowsX8664) Cflags() string {
return "${windowsCflags} ${windowsX8664Cflags}"
} }
func (t *toolchainWindows) Cppflags() string { func (t *toolchainWindows) Cppflags() string {
return "" return ""
} }
func (t *toolchainWindows) Ldflags() string { func (t *toolchainWindowsX86) Ldflags() string {
return "${windowsLdflags}" return "${windowsLdflags} ${windowsX86Ldflags}"
}
func (t *toolchainWindowsX8664) Ldflags() string {
return "${windowsLdflags} ${windowsX8664Ldflags}"
} }
func (t *toolchainWindows) IncludeFlags() string { func (t *toolchainWindows) IncludeFlags() string {
@@ -143,12 +183,18 @@ func (t *toolchainWindows) ExecutableSuffix() string {
return ".exe" return ".exe"
} }
var toolchainWindowsSingleton Toolchain = &toolchainWindows{} var toolchainWindowsX86Singleton Toolchain = &toolchainWindowsX86{}
var toolchainWindowsX8664Singleton Toolchain = &toolchainWindowsX8664{}
func windowsToolchainFactory(arch common.Arch) Toolchain { func windowsX86ToolchainFactory(arch common.Arch) Toolchain {
return toolchainWindowsSingleton return toolchainWindowsX86Singleton
}
func windowsX8664ToolchainFactory(arch common.Arch) Toolchain {
return toolchainWindowsX8664Singleton
} }
func init() { func init() {
registerHostToolchainFactory(common.Windows, common.X86, windowsToolchainFactory) registerHostToolchainFactory(common.Windows, common.X86, windowsX86ToolchainFactory)
registerHostToolchainFactory(common.Windows, common.X86_64, windowsX8664ToolchainFactory)
} }

View File

@@ -264,6 +264,8 @@ type archProperties struct {
Windows interface{} `blueprint:"filter(android:\"arch_variant\")"` Windows interface{} `blueprint:"filter(android:\"arch_variant\")"`
// Properties for module variants being built to run on windows x86 hosts // Properties for module variants being built to run on windows x86 hosts
Windows_x86 interface{} `blueprint:"filter(android:\"arch_variant\")"` 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 // Properties for module variants being built to run on linux or darwin hosts
Not_windows interface{} `blueprint:"filter(android:\"arch_variant\")"` Not_windows interface{} `blueprint:"filter(android:\"arch_variant\")"`
} }

View File

@@ -117,6 +117,7 @@ func (v *productVariables) SetDefaultConfig() {
if runtime.GOOS == "linux" { if runtime.GOOS == "linux" {
v.CrossHost = stringPtr("windows") v.CrossHost = stringPtr("windows")
v.CrossHostArch = stringPtr("x86") v.CrossHostArch = stringPtr("x86")
v.CrossHostSecondaryArch = stringPtr("x86_64")
} }
} }