Merge \\"Remove support for libstdc++ on Android/Linux/Darwin\\" am: d8315c8d1a
am: 969dd4266f
Change-Id: Ic4446d8cc28cd5c1e827e947010d4df47117f359
This commit is contained in:
@@ -109,8 +109,6 @@ func makeVarsToolchain(ctx android.MakeVarsContext, secondPrefix string,
|
|||||||
toolchain.ToolchainLdflags(),
|
toolchain.ToolchainLdflags(),
|
||||||
productExtraLdflags,
|
productExtraLdflags,
|
||||||
}, " "))
|
}, " "))
|
||||||
ctx.Strict(makePrefix+"SYSTEMCPP_CPPFLAGS", toolchain.SystemCppCppflags())
|
|
||||||
ctx.Strict(makePrefix+"SYSTEMCPP_LDFLAGS", toolchain.SystemCppLdflags())
|
|
||||||
|
|
||||||
includeFlags, err := ctx.Eval(toolchain.IncludeFlags())
|
includeFlags, err := ctx.Eval(toolchain.IncludeFlags())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
18
cc/stl.go
18
cc/stl.go
@@ -65,8 +65,7 @@ func (stl *stl) begin(ctx BaseModuleContext) {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
switch stl.Properties.Stl {
|
switch stl.Properties.Stl {
|
||||||
case "libc++", "libc++_static",
|
case "libc++", "libc++_static":
|
||||||
"libstdc++":
|
|
||||||
return stl.Properties.Stl
|
return stl.Properties.Stl
|
||||||
case "none":
|
case "none":
|
||||||
return ""
|
return ""
|
||||||
@@ -87,9 +86,7 @@ func (stl *stl) begin(ctx BaseModuleContext) {
|
|||||||
func (stl *stl) deps(ctx BaseModuleContext, deps Deps) Deps {
|
func (stl *stl) deps(ctx BaseModuleContext, deps Deps) Deps {
|
||||||
switch stl.Properties.SelectedStl {
|
switch stl.Properties.SelectedStl {
|
||||||
case "libstdc++":
|
case "libstdc++":
|
||||||
if ctx.Device() {
|
// Nothing
|
||||||
deps.SharedLibs = append(deps.SharedLibs, stl.Properties.SelectedStl)
|
|
||||||
}
|
|
||||||
case "libc++", "libc++_static":
|
case "libc++", "libc++_static":
|
||||||
if stl.Properties.SelectedStl == "libc++" {
|
if stl.Properties.SelectedStl == "libc++" {
|
||||||
deps.SharedLibs = append(deps.SharedLibs, stl.Properties.SelectedStl)
|
deps.SharedLibs = append(deps.SharedLibs, stl.Properties.SelectedStl)
|
||||||
@@ -143,16 +140,7 @@ func (stl *stl) flags(ctx ModuleContext, flags Flags) Flags {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
case "libstdc++":
|
case "libstdc++":
|
||||||
// Using bionic's basic libstdc++. Not actually an STL. Only around until the
|
// Nothing
|
||||||
// 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())
|
|
||||||
}
|
|
||||||
case "ndk_system":
|
case "ndk_system":
|
||||||
ndkSrcRoot := android.PathForSource(ctx, "prebuilts/ndk/current/sources/cxx-stl/system/include")
|
ndkSrcRoot := android.PathForSource(ctx, "prebuilts/ndk/current/sources/cxx-stl/system/include")
|
||||||
flags.CFlags = append(flags.CFlags, "-isystem "+ndkSrcRoot.String())
|
flags.CFlags = append(flags.CFlags, "-isystem "+ndkSrcRoot.String())
|
||||||
|
@@ -62,9 +62,6 @@ type Toolchain interface {
|
|||||||
ShlibSuffix() string
|
ShlibSuffix() string
|
||||||
ExecutableSuffix() string
|
ExecutableSuffix() string
|
||||||
|
|
||||||
SystemCppCppflags() string
|
|
||||||
SystemCppLdflags() string
|
|
||||||
|
|
||||||
AddressSanitizerRuntimeLibrary() string
|
AddressSanitizerRuntimeLibrary() string
|
||||||
|
|
||||||
AvailableLibraries() []string
|
AvailableLibraries() []string
|
||||||
@@ -119,14 +116,6 @@ func (toolchainBase) ClangAsflags() string {
|
|||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
func (toolchainBase) SystemCppCppflags() string {
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
|
|
||||||
func (toolchainBase) SystemCppLdflags() string {
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
|
|
||||||
func (toolchainBase) AddressSanitizerRuntimeLibrary() string {
|
func (toolchainBase) AddressSanitizerRuntimeLibrary() string {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
@@ -38,14 +38,6 @@ var (
|
|||||||
"-mmacosx-version-min=${macSdkVersion}",
|
"-mmacosx-version-min=${macSdkVersion}",
|
||||||
}
|
}
|
||||||
|
|
||||||
darwinSystemCppCppflags = []string{
|
|
||||||
"-isystem ${macToolchainRoot}/usr/include/c++/v1",
|
|
||||||
}
|
|
||||||
|
|
||||||
darwinSystemCppLdflags = []string{
|
|
||||||
"-stdlib=libc++",
|
|
||||||
}
|
|
||||||
|
|
||||||
// Extended cflags
|
// Extended cflags
|
||||||
darwinX86Cflags = []string{
|
darwinX86Cflags = []string{
|
||||||
"-m32",
|
"-m32",
|
||||||
@@ -129,9 +121,6 @@ func init() {
|
|||||||
pctx.StaticVariable("darwinClangCflags", strings.Join(darwinClangCflags, " "))
|
pctx.StaticVariable("darwinClangCflags", strings.Join(darwinClangCflags, " "))
|
||||||
pctx.StaticVariable("darwinClangLdflags", strings.Join(darwinClangLdflags, " "))
|
pctx.StaticVariable("darwinClangLdflags", strings.Join(darwinClangLdflags, " "))
|
||||||
|
|
||||||
pctx.StaticVariable("darwinSystemCppCppflags", strings.Join(darwinSystemCppCppflags, " "))
|
|
||||||
pctx.StaticVariable("darwinSystemCppLdflags", strings.Join(darwinSystemCppLdflags, " "))
|
|
||||||
|
|
||||||
// Extended cflags
|
// Extended cflags
|
||||||
pctx.StaticVariable("darwinX86Cflags", strings.Join(darwinX86Cflags, " "))
|
pctx.StaticVariable("darwinX86Cflags", strings.Join(darwinX86Cflags, " "))
|
||||||
pctx.StaticVariable("darwinX8664Cflags", strings.Join(darwinX8664Cflags, " "))
|
pctx.StaticVariable("darwinX8664Cflags", strings.Join(darwinX8664Cflags, " "))
|
||||||
@@ -257,14 +246,6 @@ func (t *toolchainDarwin) ShlibSuffix() string {
|
|||||||
return ".dylib"
|
return ".dylib"
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *toolchainDarwin) SystemCppCppflags() string {
|
|
||||||
return "${darwinSystemCppCppflags}"
|
|
||||||
}
|
|
||||||
|
|
||||||
func (t *toolchainDarwin) SystemCppLdflags() string {
|
|
||||||
return "${darwinSystemCppLdflags}"
|
|
||||||
}
|
|
||||||
|
|
||||||
func (t *toolchainDarwin) AvailableLibraries() []string {
|
func (t *toolchainDarwin) AvailableLibraries() []string {
|
||||||
return darwinAvailableLibraries
|
return darwinAvailableLibraries
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user