Remove unused mips workarounds.

This was never really finished, and hasn't been supported for years.

Test: treehugger
Change-Id: I21d4c3112aa8cf0c56e59f0cc19ff8725ef714b9
This commit is contained in:
Elliott Hughes 2020-03-06 16:55:28 -08:00
parent 03b5185b88
commit da3a071eaa
15 changed files with 9 additions and 432 deletions

View file

@ -143,8 +143,6 @@ bootstrap_go_package {
"cc/config/arm_device.go",
"cc/config/arm64_device.go",
"cc/config/arm64_fuchsia_device.go",
"cc/config/mips_device.go",
"cc/config/mips64_device.go",
"cc/config/x86_device.go",
"cc/config/x86_64_device.go",
"cc/config/x86_64_fuchsia_device.go",

View file

@ -33,8 +33,6 @@ var (
Arm = newArch("arm", "lib32")
Arm64 = newArch("arm64", "lib64")
Mips = newArch("mips", "lib32")
Mips64 = newArch("mips64", "lib64")
X86 = newArch("x86", "lib32")
X86_64 = newArch("x86_64", "lib64")
@ -46,8 +44,6 @@ var (
var archTypeMap = map[string]ArchType{
"arm": Arm,
"arm64": Arm64,
"mips": Mips,
"mips64": Mips64,
"x86": X86,
"x86_64": X86_64,
}
@ -64,12 +60,6 @@ module {
arm64: {
// Host or device variants with arm64 architecture
},
mips: {
// Host or device variants with mips architecture
},
mips64: {
// Host or device variants with mips64 architecture
},
x86: {
// Host or device variants with x86 architecture
},
@ -145,18 +135,6 @@ var archVariants = map[ArchType][]string{
"exynos-m1",
"exynos-m2",
},
Mips: {
"mips32_fp",
"mips32r2_fp",
"mips32r2_fp_xburst",
"mips32r2dsp_fp",
"mips32r2dspr2_fp",
"mips32r6",
},
Mips64: {
"mips64r2",
"mips64r6",
},
X86: {
"amberlake",
"atom",
@ -193,15 +171,6 @@ var archFeatures = map[ArchType][]string{
Arm: {
"neon",
},
Mips: {
"dspr2",
"rev6",
"msa",
},
Mips64: {
"rev6",
"msa",
},
X86: {
"ssse3",
"sse4",
@ -239,19 +208,6 @@ var archFeatureMap = map[ArchType]map[string][]string{
"neon",
},
},
Mips: {
"mips32r2dspr2_fp": {
"dspr2",
},
"mips32r6": {
"rev6",
},
},
Mips64: {
"mips64r6": {
"rev6",
},
},
X86: {
"amberlake": {
"ssse3",
@ -616,7 +572,7 @@ var (
LinuxBionic: []ArchType{X86_64},
Darwin: []ArchType{X86_64},
Windows: []ArchType{X86, X86_64},
Android: []ArchType{Arm, Arm64, Mips, Mips64, X86, X86_64},
Android: []ArchType{Arm, Arm64, X86, X86_64},
Fuchsia: []ArchType{Arm64, X86_64},
}
)
@ -1656,15 +1612,6 @@ func getMegaDeviceConfig() []archConfig {
{"arm64", "armv8-2a", "cortex-a75", []string{"arm64-v8a"}},
{"arm64", "armv8-2a", "cortex-a76", []string{"arm64-v8a"}},
{"arm64", "armv8-2a", "kryo385", []string{"arm64-v8a"}},
{"mips", "mips32-fp", "", []string{"mips"}},
{"mips", "mips32r2-fp", "", []string{"mips"}},
{"mips", "mips32r2-fp-xburst", "", []string{"mips"}},
//{"mips", "mips32r6", "", []string{"mips"}},
{"mips", "mips32r2dsp-fp", "", []string{"mips"}},
{"mips", "mips32r2dspr2-fp", "", []string{"mips"}},
// mips64r2 is mismatching 64r2 and 64r6 libraries during linking to libgcc
//{"mips64", "mips64r2", "", []string{"mips64"}},
{"mips64", "mips64r6", "", []string{"mips64"}},
{"x86", "", "", []string{"x86"}},
{"x86", "atom", "", []string{"x86"}},
{"x86", "haswell", "", []string{"x86"}},

View file

@ -863,16 +863,7 @@ func (c *config) LibartImgHostBaseAddress() string {
}
func (c *config) LibartImgDeviceBaseAddress() string {
archType := Common
if len(c.Targets[Android]) > 0 {
archType = c.Targets[Android][0].Arch.ArchType
}
switch archType {
default:
return "0x70000000"
case Mips, Mips64:
return "0x5C000000"
}
}
func (c *config) ArtUseReadBarrier() bool {

View file

@ -829,8 +829,6 @@ func skip(ctx variableAssignmentContext) error {
var propertyPrefixes = []struct{ mk, bp string }{
{"arm", "arch.arm"},
{"arm64", "arch.arm64"},
{"mips", "arch.mips"},
{"mips64", "arch.mips64"},
{"x86", "arch.x86"},
{"x86_64", "arch.x86_64"},
{"32", "multilib.lib32"},

View file

@ -49,7 +49,7 @@ var ClangUnknownCflags = sorted([]string{
"-Wunused-but-set-variable",
"-fdiagnostics-color",
// arm + arm64 + mips + mips64
// arm + arm64
"-fgcse-after-reload",
"-frerun-cse-after-loop",
"-frename-registers",
@ -68,11 +68,6 @@ var ClangUnknownCflags = sorted([]string{
"-fno-tree-copy-prop",
"-fno-tree-loop-optimize",
// mips + mips64
"-msynci",
"-mno-synci",
"-mno-fused-madd",
// x86 + x86_64
"-finline-limit=300",
"-fno-inline-functions-called-once",

View file

@ -1,147 +0,0 @@
// Copyright 2015 Google Inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package config
import (
"strings"
"android/soong/android"
)
var (
mips64Cflags = []string{
"-Umips",
// Help catch common 32/64-bit errors.
"-Werror=implicit-function-declaration",
}
mips64ClangCflags = append(mips64Cflags, []string{
"-fintegrated-as",
}...)
mips64Cppflags = []string{}
mips64Ldflags = []string{
"-Wl,--allow-shlib-undefined",
}
mips64ArchVariantCflags = map[string][]string{
"mips64r2": []string{
"-mips64r2",
"-msynci",
},
"mips64r6": []string{
"-mips64r6",
"-msynci",
},
}
)
const (
mips64GccVersion = "4.9"
)
func init() {
pctx.StaticVariable("mips64GccVersion", mips64GccVersion)
pctx.SourcePathVariable("Mips64GccRoot",
"prebuilts/gcc/${HostPrebuiltTag}/mips/mips64el-linux-android-${mips64GccVersion}")
pctx.StaticVariable("Mips64IncludeFlags", bionicHeaders("mips"))
// Clang cflags
pctx.StaticVariable("Mips64ClangCflags", strings.Join(ClangFilterUnknownCflags(mips64ClangCflags), " "))
pctx.StaticVariable("Mips64ClangLdflags", strings.Join(ClangFilterUnknownCflags(mips64Ldflags), " "))
pctx.StaticVariable("Mips64ClangCppflags", strings.Join(ClangFilterUnknownCflags(mips64Cppflags), " "))
// Extended cflags
// Architecture variant cflags
for variant, cflags := range mips64ArchVariantCflags {
pctx.StaticVariable("Mips64"+variant+"VariantClangCflags",
strings.Join(ClangFilterUnknownCflags(cflags), " "))
}
}
type toolchainMips64 struct {
toolchain64Bit
clangCflags string
toolchainClangCflags string
}
func (t *toolchainMips64) Name() string {
return "mips64"
}
func (t *toolchainMips64) GccRoot() string {
return "${config.Mips64GccRoot}"
}
func (t *toolchainMips64) GccTriple() string {
return "mips64el-linux-android"
}
func (t *toolchainMips64) GccVersion() string {
return mips64GccVersion
}
func (t *toolchainMips64) IncludeFlags() string {
return "${config.Mips64IncludeFlags}"
}
func (t *toolchainMips64) ClangTriple() string {
return t.GccTriple()
}
func (t *toolchainMips64) ToolchainClangCflags() string {
return t.toolchainClangCflags
}
func (t *toolchainMips64) ClangAsflags() string {
return "-fno-integrated-as"
}
func (t *toolchainMips64) ClangCflags() string {
return t.clangCflags
}
func (t *toolchainMips64) ClangCppflags() string {
return "${config.Mips64ClangCppflags}"
}
func (t *toolchainMips64) ClangLdflags() string {
return "${config.Mips64ClangLdflags}"
}
func (t *toolchainMips64) ClangLldflags() string {
// TODO: define and use Mips64ClangLldflags
return "${config.Mips64ClangLdflags}"
}
func (toolchainMips64) LibclangRuntimeLibraryArch() string {
return "mips64"
}
func mips64ToolchainFactory(arch android.Arch) Toolchain {
return &toolchainMips64{
clangCflags: "${config.Mips64ClangCflags}",
toolchainClangCflags: "${config.Mips64" + arch.ArchVariant + "VariantClangCflags}",
}
}
func init() {
registerToolchainFactory(android.Android, android.Mips64, mips64ToolchainFactory)
}

View file

@ -1,186 +0,0 @@
// Copyright 2015 Google Inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package config
import (
"strings"
"android/soong/android"
)
var (
mipsCflags = []string{
"-fomit-frame-pointer",
"-Umips",
}
mipsClangCflags = append(mipsCflags, []string{
"-fPIC",
"-fintegrated-as",
}...)
mipsCppflags = []string{}
mipsLdflags = []string{
"-Wl,--allow-shlib-undefined",
}
mipsToolchainLdflags = []string{
"-Wl,-melf32ltsmip",
}
mipsArchVariantCflags = map[string][]string{
"mips32-fp": []string{
"-mips32",
"-mfp32",
"-modd-spreg",
"-mno-synci",
},
"mips32r2-fp": []string{
"-mips32r2",
"-mfp32",
"-modd-spreg",
"-msynci",
},
"mips32r2-fp-xburst": []string{
"-mips32r2",
"-mfp32",
"-modd-spreg",
"-mno-fused-madd",
"-mno-synci",
},
"mips32r2dsp-fp": []string{
"-mips32r2",
"-mfp32",
"-modd-spreg",
"-mdsp",
"-msynci",
},
"mips32r2dspr2-fp": []string{
"-mips32r2",
"-mfp32",
"-modd-spreg",
"-mdspr2",
"-msynci",
},
"mips32r6": []string{
"-mips32r6",
"-mfp64",
"-mno-odd-spreg",
"-msynci",
},
}
)
const (
mipsGccVersion = "4.9"
)
func init() {
pctx.StaticVariable("mipsGccVersion", mipsGccVersion)
pctx.SourcePathVariable("MipsGccRoot",
"prebuilts/gcc/${HostPrebuiltTag}/mips/mips64el-linux-android-${mipsGccVersion}")
pctx.StaticVariable("MipsToolchainLdflags", strings.Join(mipsToolchainLdflags, " "))
pctx.StaticVariable("MipsIncludeFlags", bionicHeaders("mips"))
// Clang cflags
pctx.StaticVariable("MipsClangCflags", strings.Join(ClangFilterUnknownCflags(mipsClangCflags), " "))
pctx.StaticVariable("MipsClangLdflags", strings.Join(ClangFilterUnknownCflags(mipsLdflags), " "))
pctx.StaticVariable("MipsClangCppflags", strings.Join(ClangFilterUnknownCflags(mipsCppflags), " "))
// Extended cflags
// Architecture variant cflags
for variant, cflags := range mipsArchVariantCflags {
pctx.StaticVariable("Mips"+variant+"VariantClangCflags",
strings.Join(ClangFilterUnknownCflags(cflags), " "))
}
}
type toolchainMips struct {
toolchain32Bit
clangCflags string
toolchainClangCflags string
}
func (t *toolchainMips) Name() string {
return "mips"
}
func (t *toolchainMips) GccRoot() string {
return "${config.MipsGccRoot}"
}
func (t *toolchainMips) GccTriple() string {
return "mips64el-linux-android"
}
func (t *toolchainMips) GccVersion() string {
return mipsGccVersion
}
func (t *toolchainMips) IncludeFlags() string {
return "${config.MipsIncludeFlags}"
}
func (t *toolchainMips) ClangTriple() string {
return "mipsel-linux-android"
}
func (t *toolchainMips) ToolchainClangLdflags() string {
return "${config.MipsToolchainLdflags}"
}
func (t *toolchainMips) ToolchainClangCflags() string {
return t.toolchainClangCflags
}
func (t *toolchainMips) ClangAsflags() string {
return "-fPIC -fno-integrated-as"
}
func (t *toolchainMips) ClangCflags() string {
return t.clangCflags
}
func (t *toolchainMips) ClangCppflags() string {
return "${config.MipsClangCppflags}"
}
func (t *toolchainMips) ClangLdflags() string {
return "${config.MipsClangLdflags}"
}
func (t *toolchainMips) ClangLldflags() string {
// TODO: define and use MipsClangLldflags
return "${config.MipsClangLdflags}"
}
func (toolchainMips) LibclangRuntimeLibraryArch() string {
return "mips"
}
func mipsToolchainFactory(arch android.Arch) Toolchain {
return &toolchainMips{
clangCflags: "${config.MipsClangCflags}",
toolchainClangCflags: "${config.Mips" + arch.ArchVariant + "VariantClangCflags}",
}
}
func init() {
registerToolchainFactory(android.Android, android.Mips, mipsToolchainFactory)
}

View file

@ -26,8 +26,6 @@ import sys
ALL_ARCHITECTURES = (
'arm',
'arm64',
'mips',
'mips64',
'x86',
'x86_64',
)

View file

@ -438,11 +438,10 @@ func (linker *baseLinker) linkerFlags(ctx ModuleContext, flags Flags) Flags {
}
}
if ctx.useSdk() && (ctx.Arch().ArchType != android.Mips && ctx.Arch().ArchType != android.Mips64) {
if ctx.useSdk() {
// The bionic linker now has support gnu style hashes (which are much faster!), but shipping
// to older devices requires the old style hash. Fortunately, we can build with both and
// it'll work anywhere.
// This is not currently supported on MIPS architectures.
flags.Global.LdFlags = append(flags.Global.LdFlags, "-Wl,--hash-style=both")
}

View file

@ -17,7 +17,6 @@ package cc
import (
"fmt"
"path/filepath"
"strings"
"github.com/google/blueprint"
@ -131,14 +130,6 @@ func (m *headerModule) GenerateAndroidBuildActions(ctx android.ModuleContext) {
m.licensePath = android.PathForModuleSrc(ctx, String(m.properties.License))
// When generating NDK prebuilts, skip installing MIPS headers,
// but keep them when doing regular platform build.
// Ndk_abis property is only set to true with build/soong/scripts/build-ndk-prebuilts.sh
// TODO: Revert this once MIPS is supported in NDK again.
if ctx.Config().NdkAbis() && strings.Contains(ctx.ModuleName(), "mips") {
return
}
srcFiles := android.PathsForModuleSrcExcludes(ctx, m.properties.Srcs, m.properties.Exclude_srcs)
for _, header := range srcFiles {
installDir := getHeaderInstallDir(ctx, header, String(m.properties.From),

View file

@ -133,8 +133,6 @@ func normalizeNdkApiLevel(ctx android.BaseModuleContext, apiLevel string,
firstArchVersions := map[android.ArchType]int{
android.Arm: minVersion,
android.Arm64: 21,
android.Mips: minVersion,
android.Mips64: 21,
android.X86: minVersion,
android.X86_64: 21,
}

View file

@ -307,8 +307,8 @@ func (sanitize *sanitize) begin(ctx BaseModuleContext) {
}
}
// CFI needs gold linker, and mips toolchain does not have one.
if !ctx.Config().EnableCFI() || ctx.Arch().ArchType == android.Mips || ctx.Arch().ArchType == android.Mips64 {
// Is CFI actually enabled?
if !ctx.Config().EnableCFI() {
s.Cfi = nil
s.Diag.Cfi = nil
}

4
doc.go
View file

@ -46,8 +46,8 @@
//
// Target architecture
// The target architecture is the preferred architecture supported by the selected
// device. It is most commonly 32-bit arm, but may also be 64-bit arm, 32-bit or
// 64-bit x86, or mips.
// device. It is most commonly 32-bit arm, but may also be 64-bit arm, 32-bit
// x86, or 64-bit x86.
//
// Secondary architecture
// The secondary architecture specifies the architecture to compile a second copy

View file

@ -33,8 +33,7 @@ func init() {
// /system/framework/boot.art and should be the same for all supported
// architectures on the device. The concrete architecture specific
// content actually ends up in a "filename" that contains an
// architecture specific directory name such as arm, arm64, mips,
// mips64, x86, x86_64.
// architecture specific directory name such as arm, arm64, x86, x86_64.
//
// Here are some example values for an x86_64 / x86 configuration:
//

View file

@ -611,10 +611,6 @@ func (c *configImpl) Tapas(ctx Context, apps []string, arch, variant string) {
product = "aosp_arm"
case "arm64":
product = "aosm_arm64"
case "mips":
product = "aosp_mips"
case "mips64":
product = "aosp_mips64"
case "x86":
product = "aosp_x86"
case "x86_64":