Merge "Remove support for libstdc++ on Android/Linux/Darwin"

This commit is contained in:
Dan Willemsen 2016-06-15 22:49:33 +00:00 committed by Gerrit Code Review
commit d8315c8d1a
4 changed files with 3 additions and 47 deletions

View File

@ -109,8 +109,6 @@ func makeVarsToolchain(ctx android.MakeVarsContext, secondPrefix string,
toolchain.ToolchainLdflags(),
productExtraLdflags,
}, " "))
ctx.Strict(makePrefix+"SYSTEMCPP_CPPFLAGS", toolchain.SystemCppCppflags())
ctx.Strict(makePrefix+"SYSTEMCPP_LDFLAGS", toolchain.SystemCppLdflags())
includeFlags, err := ctx.Eval(toolchain.IncludeFlags())
if err != nil {

View File

@ -65,8 +65,7 @@ func (stl *stl) begin(ctx BaseModuleContext) {
}
} else {
switch stl.Properties.Stl {
case "libc++", "libc++_static",
"libstdc++":
case "libc++", "libc++_static":
return stl.Properties.Stl
case "none":
return ""
@ -87,9 +86,7 @@ func (stl *stl) begin(ctx BaseModuleContext) {
func (stl *stl) deps(ctx BaseModuleContext, deps Deps) Deps {
switch stl.Properties.SelectedStl {
case "libstdc++":
if ctx.Device() {
deps.SharedLibs = append(deps.SharedLibs, stl.Properties.SelectedStl)
}
// Nothing
case "libc++", "libc++_static":
if stl.Properties.SelectedStl == "libc++" {
deps.SharedLibs = append(deps.SharedLibs, stl.Properties.SelectedStl)
@ -143,16 +140,7 @@ func (stl *stl) flags(ctx ModuleContext, flags Flags) Flags {
}
}
case "libstdc++":
// Using bionic's basic libstdc++. Not actually an STL. Only around until the
// tree is in good enough shape to not need it.
// Host builds will use GNU libstdc++.
if ctx.Device() {
flags.CFlags = append(flags.CFlags, "-I"+android.PathForSource(ctx, "bionic/libstdc++/include").String())
} else {
// Host builds will use the system C++. libc++ on Darwin, GNU libstdc++ everywhere else
flags.CppFlags = append(flags.CppFlags, flags.Toolchain.SystemCppCppflags())
flags.LdFlags = append(flags.LdFlags, flags.Toolchain.SystemCppLdflags())
}
// Nothing
case "ndk_system":
ndkSrcRoot := android.PathForSource(ctx, "prebuilts/ndk/current/sources/cxx-stl/system/include")
flags.CFlags = append(flags.CFlags, "-isystem "+ndkSrcRoot.String())

View File

@ -62,9 +62,6 @@ type Toolchain interface {
ShlibSuffix() string
ExecutableSuffix() string
SystemCppCppflags() string
SystemCppLdflags() string
AddressSanitizerRuntimeLibrary() string
AvailableLibraries() []string
@ -119,14 +116,6 @@ func (toolchainBase) ClangAsflags() string {
return ""
}
func (toolchainBase) SystemCppCppflags() string {
return ""
}
func (toolchainBase) SystemCppLdflags() string {
return ""
}
func (toolchainBase) AddressSanitizerRuntimeLibrary() string {
return ""
}

View File

@ -38,14 +38,6 @@ var (
"-mmacosx-version-min=${macSdkVersion}",
}
darwinSystemCppCppflags = []string{
"-isystem ${macToolchainRoot}/usr/include/c++/v1",
}
darwinSystemCppLdflags = []string{
"-stdlib=libc++",
}
// Extended cflags
darwinX86Cflags = []string{
"-m32",
@ -129,9 +121,6 @@ func init() {
pctx.StaticVariable("darwinClangCflags", strings.Join(darwinClangCflags, " "))
pctx.StaticVariable("darwinClangLdflags", strings.Join(darwinClangLdflags, " "))
pctx.StaticVariable("darwinSystemCppCppflags", strings.Join(darwinSystemCppCppflags, " "))
pctx.StaticVariable("darwinSystemCppLdflags", strings.Join(darwinSystemCppLdflags, " "))
// Extended cflags
pctx.StaticVariable("darwinX86Cflags", strings.Join(darwinX86Cflags, " "))
pctx.StaticVariable("darwinX8664Cflags", strings.Join(darwinX8664Cflags, " "))
@ -257,14 +246,6 @@ func (t *toolchainDarwin) ShlibSuffix() string {
return ".dylib"
}
func (t *toolchainDarwin) SystemCppCppflags() string {
return "${darwinSystemCppCppflags}"
}
func (t *toolchainDarwin) SystemCppLdflags() string {
return "${darwinSystemCppLdflags}"
}
func (t *toolchainDarwin) AvailableLibraries() []string {
return darwinAvailableLibraries
}