Merge changes from topic "windows-libcxx"
* changes: Remove --allow-multiple-definitions for 32-bit Windows Change STL for Windows to libc++.
This commit is contained in:
@@ -47,18 +47,11 @@ var (
|
|||||||
"-isystem ${WindowsGccRoot}/${WindowsGccTriple}/include",
|
"-isystem ${WindowsGccRoot}/${WindowsGccTriple}/include",
|
||||||
}
|
}
|
||||||
|
|
||||||
windowsClangCppflags = []string{
|
windowsClangCppflags = []string{}
|
||||||
"-isystem ${WindowsGccRoot}/${WindowsGccTriple}/include/c++/4.8.3",
|
|
||||||
"-isystem ${WindowsGccRoot}/${WindowsGccTriple}/include/c++/4.8.3/backward",
|
|
||||||
}
|
|
||||||
|
|
||||||
windowsX86ClangCppflags = []string{
|
windowsX86ClangCppflags = []string{}
|
||||||
"-isystem ${WindowsGccRoot}/${WindowsGccTriple}/include/c++/4.8.3/${WindowsGccTriple}/32",
|
|
||||||
}
|
|
||||||
|
|
||||||
windowsX8664ClangCppflags = []string{
|
windowsX8664ClangCppflags = []string{}
|
||||||
"-isystem ${WindowsGccRoot}/${WindowsGccTriple}/include/c++/4.8.3/${WindowsGccTriple}",
|
|
||||||
}
|
|
||||||
|
|
||||||
windowsLdflags = []string{
|
windowsLdflags = []string{
|
||||||
"--enable-stdcall-fixup",
|
"--enable-stdcall-fixup",
|
||||||
@@ -80,24 +73,18 @@ var (
|
|||||||
"-m32",
|
"-m32",
|
||||||
"-Wl,--large-address-aware",
|
"-Wl,--large-address-aware",
|
||||||
"-L${WindowsGccRoot}/${WindowsGccTriple}/lib32",
|
"-L${WindowsGccRoot}/${WindowsGccTriple}/lib32",
|
||||||
"-static-libgcc",
|
|
||||||
}
|
}
|
||||||
windowsX86ClangLdflags = append(ClangFilterUnknownCflags(windowsX86Ldflags), []string{
|
windowsX86ClangLdflags = append(ClangFilterUnknownCflags(windowsX86Ldflags), []string{
|
||||||
"-B${WindowsGccRoot}/${WindowsGccTriple}/bin",
|
"-B${WindowsGccRoot}/${WindowsGccTriple}/bin",
|
||||||
"-B${WindowsGccRoot}/lib/gcc/${WindowsGccTriple}/4.8.3/32",
|
"-B${WindowsGccRoot}/lib/gcc/${WindowsGccTriple}/4.8.3/32",
|
||||||
"-L${WindowsGccRoot}/lib/gcc/${WindowsGccTriple}/4.8.3/32",
|
"-L${WindowsGccRoot}/lib/gcc/${WindowsGccTriple}/4.8.3/32",
|
||||||
"-B${WindowsGccRoot}/${WindowsGccTriple}/lib32",
|
"-B${WindowsGccRoot}/${WindowsGccTriple}/lib32",
|
||||||
"-pthread",
|
|
||||||
// Bug: http://b/109759970 - WAR until issue with ld.bfd's
|
|
||||||
// inability to handle Clang-generated section names is fixed.
|
|
||||||
"-Wl,--allow-multiple-definition",
|
|
||||||
}...)
|
}...)
|
||||||
windowsX86ClangLldflags = ClangFilterUnknownLldflags(windowsX86ClangLdflags)
|
windowsX86ClangLldflags = ClangFilterUnknownLldflags(windowsX86ClangLdflags)
|
||||||
|
|
||||||
windowsX8664Ldflags = []string{
|
windowsX8664Ldflags = []string{
|
||||||
"-m64",
|
"-m64",
|
||||||
"-L${WindowsGccRoot}/${WindowsGccTriple}/lib64",
|
"-L${WindowsGccRoot}/${WindowsGccTriple}/lib64",
|
||||||
"-static-libgcc",
|
|
||||||
"-Wl,--high-entropy-va",
|
"-Wl,--high-entropy-va",
|
||||||
}
|
}
|
||||||
windowsX8664ClangLdflags = append(ClangFilterUnknownCflags(windowsX8664Ldflags), []string{
|
windowsX8664ClangLdflags = append(ClangFilterUnknownCflags(windowsX8664Ldflags), []string{
|
||||||
@@ -105,7 +92,6 @@ var (
|
|||||||
"-B${WindowsGccRoot}/lib/gcc/${WindowsGccTriple}/4.8.3",
|
"-B${WindowsGccRoot}/lib/gcc/${WindowsGccTriple}/4.8.3",
|
||||||
"-L${WindowsGccRoot}/lib/gcc/${WindowsGccTriple}/4.8.3",
|
"-L${WindowsGccRoot}/lib/gcc/${WindowsGccTriple}/4.8.3",
|
||||||
"-B${WindowsGccRoot}/${WindowsGccTriple}/lib64",
|
"-B${WindowsGccRoot}/${WindowsGccTriple}/lib64",
|
||||||
"-pthread",
|
|
||||||
}...)
|
}...)
|
||||||
windowsX8664ClangLldflags = ClangFilterUnknownLldflags(windowsX8664ClangLdflags)
|
windowsX8664ClangLldflags = ClangFilterUnknownLldflags(windowsX8664ClangLdflags)
|
||||||
|
|
||||||
|
27
cc/stl.go
27
cc/stl.go
@@ -81,9 +81,9 @@ func (stl *stl) begin(ctx BaseModuleContext) {
|
|||||||
}
|
}
|
||||||
} else if ctx.Windows() {
|
} else if ctx.Windows() {
|
||||||
switch s {
|
switch s {
|
||||||
case "libc++", "libc++_static", "libstdc++", "":
|
case "libc++", "libc++_static", "":
|
||||||
// libc++ is not supported on mingw
|
// Only use static libc++ for Windows.
|
||||||
return "libstdc++"
|
return "libc++_static"
|
||||||
case "none":
|
case "none":
|
||||||
return ""
|
return ""
|
||||||
default:
|
default:
|
||||||
@@ -177,6 +177,20 @@ func (stl *stl) flags(ctx ModuleContext, flags Flags) Flags {
|
|||||||
} else {
|
} else {
|
||||||
flags.LdFlags = append(flags.LdFlags, hostDynamicGccLibs[ctx.Os()]...)
|
flags.LdFlags = append(flags.LdFlags, hostDynamicGccLibs[ctx.Os()]...)
|
||||||
}
|
}
|
||||||
|
if ctx.Windows() {
|
||||||
|
// Use SjLj exceptions for 32-bit. libgcc_eh implements SjLj
|
||||||
|
// exception model for 32-bit.
|
||||||
|
if ctx.Arch().ArchType == android.X86 {
|
||||||
|
flags.CppFlags = append(flags.CppFlags, "-fsjlj-exceptions")
|
||||||
|
}
|
||||||
|
flags.CppFlags = append(flags.CppFlags,
|
||||||
|
// Disable visiblity annotations since we're using static
|
||||||
|
// libc++.
|
||||||
|
"-D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS",
|
||||||
|
"-D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS",
|
||||||
|
// Use Win32 threads in libc++.
|
||||||
|
"-D_LIBCPP_HAS_THREAD_API_WIN32")
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if ctx.Arch().ArchType == android.Arm {
|
if ctx.Arch().ArchType == android.Arm {
|
||||||
flags.LdFlags = append(flags.LdFlags, "-Wl,--exclude-libs,libunwind_llvm.a")
|
flags.LdFlags = append(flags.LdFlags, "-Wl,--exclude-libs,libunwind_llvm.a")
|
||||||
@@ -213,9 +227,10 @@ func init() {
|
|||||||
hostDynamicGccLibs = map[android.OsType][]string{
|
hostDynamicGccLibs = map[android.OsType][]string{
|
||||||
android.Linux: []string{"-lgcc_s", "-lgcc", "-lc", "-lgcc_s", "-lgcc"},
|
android.Linux: []string{"-lgcc_s", "-lgcc", "-lc", "-lgcc_s", "-lgcc"},
|
||||||
android.Darwin: []string{"-lc", "-lSystem"},
|
android.Darwin: []string{"-lc", "-lSystem"},
|
||||||
android.Windows: []string{"-lmingw32", "-lgcc", "-lmoldname", "-lmingwex", "-lmsvcr110",
|
android.Windows: []string{"-Wl,--start-group", "-lmingw32", "-lgcc", "-lgcc_eh",
|
||||||
"-lmsvcrt", "-ladvapi32", "-lshell32", "-luser32", "-lkernel32", "-lmingw32",
|
"-lmoldname", "-lmingwex", "-lmsvcr110", "-lmsvcrt", "-lpthread",
|
||||||
"-lgcc", "-lmoldname", "-lmingwex", "-lmsvcrt"},
|
"-ladvapi32", "-lshell32", "-luser32", "-lkernel32", "-lpsapi",
|
||||||
|
"-Wl,--end-group"},
|
||||||
}
|
}
|
||||||
hostStaticGccLibs = map[android.OsType][]string{
|
hostStaticGccLibs = map[android.OsType][]string{
|
||||||
android.Linux: []string{"-Wl,--start-group", "-lgcc", "-lgcc_eh", "-lc", "-Wl,--end-group"},
|
android.Linux: []string{"-Wl,--start-group", "-lgcc", "-lgcc_eh", "-lc", "-Wl,--end-group"},
|
||||||
|
Reference in New Issue
Block a user