aboutsummaryrefslogtreecommitdiffstats
path: root/cc
diff options
context:
space:
mode:
Diffstat (limited to 'cc')
-rw-r--r--cc/config/clang.go3
-rw-r--r--cc/config/x86_windows_host.go70
2 files changed, 65 insertions, 8 deletions
diff --git a/cc/config/clang.go b/cc/config/clang.go
index 2ef153be..302c68ee 100644
--- a/cc/config/clang.go
+++ b/cc/config/clang.go
@@ -77,6 +77,9 @@ var ClangUnknownCflags = sorted([]string{
"-fno-inline-functions-called-once",
"-mfpmath=sse",
"-mbionic",
+
+ // windows
+ "--enable-stdcall-fixup",
})
var ClangLibToolingUnknownCflags = []string{
diff --git a/cc/config/x86_windows_host.go b/cc/config/x86_windows_host.go
index c9bafe61..016e7112 100644
--- a/cc/config/x86_windows_host.go
+++ b/cc/config/x86_windows_host.go
@@ -41,15 +41,30 @@ var (
"--sysroot ${WindowsGccRoot}/${WindowsGccTriple}",
}
+ windowsClangCflags = append(ClangFilterUnknownCflags(windowsCflags), []string{}...)
windowsIncludeFlags = []string{
"-isystem ${WindowsGccRoot}/${WindowsGccTriple}/include",
"-isystem ${WindowsGccRoot}/lib/gcc/${WindowsGccTriple}/4.8.3/include",
}
+ windowsClangCppflags = []string{
+ "-isystem ${WindowsGccRoot}/${WindowsGccTriple}/include/c++/4.8.3",
+ "-isystem ${WindowsGccRoot}/${WindowsGccTriple}/include/c++/4.8.3/backward",
+ }
+
+ windowsX86ClangCppflags = []string{
+ "-isystem ${WindowsGccRoot}/${WindowsGccTriple}/include/c++/4.8.3/${WindowsGccTriple}/32",
+ }
+
+ windowsX8664ClangCppflags = []string{
+ "-isystem ${WindowsGccRoot}/${WindowsGccTriple}/include/c++/4.8.3/${WindowsGccTriple}",
+ }
+
windowsLdflags = []string{
"--enable-stdcall-fixup",
}
+ windowsClangLdflags = append(ClangFilterUnknownCflags(windowsLdflags), []string{}...)
windowsX86Cflags = []string{
"-m32",
@@ -64,11 +79,21 @@ var (
"-Wl,--large-address-aware",
"-L${WindowsGccRoot}/${WindowsGccTriple}/lib32",
}
+ windowsX86ClangLdflags = append(ClangFilterUnknownCflags(windowsX86Ldflags), []string{
+ "-B${WindowsGccRoot}/lib/gcc/${WindowsGccTriple}/4.8.3/32",
+ "-L${WindowsGccRoot}/lib/gcc/${WindowsGccTriple}/4.8.3/32",
+ "-B${WindowsGccRoot}/${WindowsGccTriple}/lib32",
+ }...)
windowsX8664Ldflags = []string{
"-m64",
"-L${WindowsGccRoot}/${WindowsGccTriple}/lib64",
}
+ windowsX8664ClangLdflags = append(ClangFilterUnknownCflags(windowsX8664Ldflags), []string{
+ "-B${WindowsGccRoot}/lib/gcc/${WindowsGccTriple}/4.8.3",
+ "-L${WindowsGccRoot}/lib/gcc/${WindowsGccTriple}/4.8.3",
+ "-B${WindowsGccRoot}/${WindowsGccTriple}/lib64",
+ }...)
windowsAvailableLibraries = addPrefix([]string{
"gdi32",
@@ -101,11 +126,24 @@ func init() {
pctx.StaticVariable("WindowsCflags", strings.Join(windowsCflags, " "))
pctx.StaticVariable("WindowsLdflags", strings.Join(windowsLdflags, " "))
+ pctx.StaticVariable("WindowsClangCflags", strings.Join(windowsClangCflags, " "))
+ pctx.StaticVariable("WindowsClangLdflags", strings.Join(windowsClangLdflags, " "))
+ pctx.StaticVariable("WindowsClangCppflags", strings.Join(windowsClangCppflags, " "))
+
pctx.StaticVariable("WindowsX86Cflags", strings.Join(windowsX86Cflags, " "))
pctx.StaticVariable("WindowsX8664Cflags", strings.Join(windowsX8664Cflags, " "))
pctx.StaticVariable("WindowsX86Ldflags", strings.Join(windowsX86Ldflags, " "))
pctx.StaticVariable("WindowsX8664Ldflags", strings.Join(windowsX8664Ldflags, " "))
+ pctx.StaticVariable("WindowsX86ClangCflags",
+ strings.Join(ClangFilterUnknownCflags(windowsX86Cflags), " "))
+ pctx.StaticVariable("WindowsX8664ClangCflags",
+ strings.Join(ClangFilterUnknownCflags(windowsX8664Cflags), " "))
+ pctx.StaticVariable("WindowsX86ClangLdflags", strings.Join(windowsX86ClangLdflags, " "))
+ pctx.StaticVariable("WindowsX8664ClangLdflags", strings.Join(windowsX8664ClangLdflags, " "))
+ pctx.StaticVariable("WindowsX86ClangCppflags", strings.Join(windowsX86ClangCppflags, " "))
+ pctx.StaticVariable("WindowsX8664ClangCppflags", strings.Join(windowsX8664ClangCppflags, " "))
+
pctx.StaticVariable("WindowsIncludeFlags", strings.Join(windowsIncludeFlags, " "))
}
@@ -179,20 +217,36 @@ func (t *toolchainWindows) ClangSupported() bool {
return false
}
-func (t *toolchainWindows) ClangTriple() string {
- panic("Clang is not supported under mingw")
+func (t *toolchainWindowsX86) ClangTriple() string {
+ return "i686-windows-gnu"
+}
+
+func (t *toolchainWindowsX8664) ClangTriple() string {
+ return "x86_64-pc-windows-gnu"
+}
+
+func (t *toolchainWindowsX86) ClangCflags() string {
+ return "${config.WindowsClangCflags} ${config.WindowsX86ClangCflags}"
+}
+
+func (t *toolchainWindowsX8664) ClangCflags() string {
+ return "${config.WindowsClangCflags} ${config.WindowsX8664ClangCflags}"
+}
+
+func (t *toolchainWindowsX86) ClangCppflags() string {
+ return "${config.WindowsClangCppflags} ${config.WindowsX86ClangCppflags}"
}
-func (t *toolchainWindows) ClangCflags() string {
- panic("Clang is not supported under mingw")
+func (t *toolchainWindowsX8664) ClangCppflags() string {
+ return "${config.WindowsClangCppflags} ${config.WindowsX8664ClangCppflags}"
}
-func (t *toolchainWindows) ClangCppflags() string {
- panic("Clang is not supported under mingw")
+func (t *toolchainWindowsX86) ClangLdflags() string {
+ return "${config.WindowsClangLdflags} ${config.WindowsX86ClangLdflags}"
}
-func (t *toolchainWindows) ClangLdflags() string {
- panic("Clang is not supported under mingw")
+func (t *toolchainWindowsX8664) ClangLdflags() string {
+ return "${config.WindowsClangLdflags} ${config.WindowsX8664ClangLdflags}"
}
func (t *toolchainWindows) ShlibSuffix() string {