Remove Fuchsia support from Soong

Bug: 194215932
Test: m checkbuild
Change-Id: Id7d3964d9417f8b0938af9b168bb4c00cebe9390
This commit is contained in:
Colin Cross
2021-07-20 13:17:15 -07:00
parent 34c32fabea
commit cb0ac95bde
18 changed files with 12 additions and 377 deletions

View File

@@ -215,7 +215,7 @@ func (binary *binaryDecorator) linkerInit(ctx BaseModuleContext) {
if binary.Properties.Static_executable == nil && ctx.Config().HostStaticBinaries() {
binary.Properties.Static_executable = BoolPtr(true)
}
} else if !ctx.Fuchsia() {
} else {
// Static executables are not supported on Darwin or Windows
binary.Properties.Static_executable = nil
}

View File

@@ -152,71 +152,6 @@ func TestPrepareForTestWithCcDefaultModules(t *testing.T) {
).RunTest(t)
}
func TestFuchsiaDeps(t *testing.T) {
t.Helper()
bp := `
cc_library {
name: "libTest",
srcs: ["foo.c"],
target: {
fuchsia: {
srcs: ["bar.c"],
},
},
}`
result := android.GroupFixturePreparers(
prepareForCcTest,
PrepareForTestOnFuchsia,
).RunTestWithBp(t, bp)
rt := false
fb := false
ld := result.ModuleForTests("libTest", "fuchsia_arm64_shared").Rule("ld")
implicits := ld.Implicits
for _, lib := range implicits {
if strings.Contains(lib.Rel(), "libcompiler_rt") {
rt = true
}
if strings.Contains(lib.Rel(), "libbioniccompat") {
fb = true
}
}
if !rt || !fb {
t.Errorf("fuchsia libs must link libcompiler_rt and libbioniccompat")
}
}
func TestFuchsiaTargetDecl(t *testing.T) {
t.Helper()
bp := `
cc_library {
name: "libTest",
srcs: ["foo.c"],
target: {
fuchsia: {
srcs: ["bar.c"],
},
},
}`
result := android.GroupFixturePreparers(
prepareForCcTest,
PrepareForTestOnFuchsia,
).RunTestWithBp(t, bp)
ld := result.ModuleForTests("libTest", "fuchsia_arm64_shared").Rule("ld")
var objs []string
for _, o := range ld.Inputs {
objs = append(objs, o.Base())
}
android.AssertArrayString(t, "libTest inputs", []string{"foo.o", "bar.o"}, objs)
}
func TestVendorSrc(t *testing.T) {
ctx := testCc(t, `
cc_library {

View File

@@ -21,10 +21,8 @@ bootstrap_go_package {
"arm_device.go",
"arm64_device.go",
"arm64_fuchsia_device.go",
"x86_device.go",
"x86_64_device.go",
"x86_64_fuchsia_device.go",
"x86_darwin_host.go",
"x86_linux_host.go",

View File

@@ -1,81 +0,0 @@
// Copyright 2018 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 (
"android/soong/android"
)
var fuchsiaArm64SysRoot string = "prebuilts/fuchsia_sdk/arch/arm64/sysroot"
var fuchsiaArm64PrebuiltLibsRoot string = "fuchsia/prebuilt_libs/"
type toolchainFuchsiaArm64 struct {
toolchain64Bit
toolchainFuchsia
}
func (t *toolchainFuchsiaArm64) Name() string {
return "arm64"
}
func (t *toolchainFuchsiaArm64) GccRoot() string {
return "${config.Arm64GccRoot}"
}
func (t *toolchainFuchsiaArm64) GccTriple() string {
return "aarch64-linux-android"
}
func (t *toolchainFuchsiaArm64) GccVersion() string {
return arm64GccVersion
}
func (t *toolchainFuchsiaArm64) IncludeFlags() string {
return ""
}
func (t *toolchainFuchsiaArm64) ClangTriple() string {
return "arm64-fuchsia-android"
}
func (t *toolchainFuchsiaArm64) Cppflags() string {
return "-Wno-error=deprecated-declarations"
}
func (t *toolchainFuchsiaArm64) Ldflags() string {
return "--target=arm64-fuchsia --sysroot=" + fuchsiaArm64SysRoot + " -L" + fuchsiaArm64PrebuiltLibsRoot + "/aarch64-fuchsia/lib " + "-Lprebuilts/fuchsia_sdk/arch/arm64/dist/"
}
func (t *toolchainFuchsiaArm64) Lldflags() string {
return "--target=arm64-fuchsia --sysroot=" + fuchsiaArm64SysRoot + " -L" + fuchsiaArm64PrebuiltLibsRoot + "/aarch64-fuchsia/lib " + "-Lprebuilts/fuchsia_sdk/arch/arm64/dist/"
}
func (t *toolchainFuchsiaArm64) Cflags() string {
return "--target=arm64-fuchsia --sysroot=" + fuchsiaArm64SysRoot + " -I" + fuchsiaArm64SysRoot + "/include"
}
func (t *toolchainFuchsiaArm64) ToolchainCflags() string {
return "-march=armv8-a"
}
var toolchainArm64FuchsiaSingleton Toolchain = &toolchainFuchsiaArm64{}
func arm64FuchsiaToolchainFactory(arch android.Arch) Toolchain {
return toolchainArm64FuchsiaSingleton
}
func init() {
registerToolchainFactory(android.Fuchsia, android.Arm64, arm64FuchsiaToolchainFactory)
}

View File

@@ -1,90 +0,0 @@
// Copyright 2018 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 (
"android/soong/android"
)
var fuchsiaSysRoot string = "prebuilts/fuchsia_sdk/arch/x64/sysroot"
var fuchsiaPrebuiltLibsRoot string = "fuchsia/prebuilt_libs"
type toolchainFuchsia struct {
cFlags, ldFlags string
}
type toolchainFuchsiaX8664 struct {
toolchain64Bit
toolchainFuchsia
}
func (t *toolchainFuchsiaX8664) Name() string {
return "x86_64"
}
func (t *toolchainFuchsiaX8664) GccRoot() string {
return "${config.X86_64GccRoot}"
}
func (t *toolchainFuchsiaX8664) GccTriple() string {
return "x86_64-linux-android"
}
func (t *toolchainFuchsiaX8664) GccVersion() string {
return x86_64GccVersion
}
func (t *toolchainFuchsiaX8664) IncludeFlags() string {
return ""
}
func (t *toolchainFuchsiaX8664) ClangTriple() string {
return "x86_64-fuchsia-android"
}
func (t *toolchainFuchsiaX8664) Cppflags() string {
return "-Wno-error=deprecated-declarations"
}
func (t *toolchainFuchsiaX8664) Ldflags() string {
return "--target=x86_64-fuchsia --sysroot=" + fuchsiaSysRoot + " -L" + fuchsiaPrebuiltLibsRoot + "/x86_64-fuchsia/lib " + "-Lprebuilts/fuchsia_sdk/arch/x64/dist/"
}
func (t *toolchainFuchsiaX8664) Lldflags() string {
return "--target=x86_64-fuchsia --sysroot=" + fuchsiaSysRoot + " -L" + fuchsiaPrebuiltLibsRoot + "/x86_64-fuchsia/lib " + "-Lprebuilts/fuchsia_sdk/arch/x64/dist/"
}
func (t *toolchainFuchsiaX8664) Cflags() string {
return "--target=x86_64-fuchsia --sysroot=" + fuchsiaSysRoot + " -I" + fuchsiaSysRoot + "/include"
}
func (t *toolchainFuchsiaX8664) YasmFlags() string {
return "-f elf64 -m amd64"
}
func (t *toolchainFuchsiaX8664) ToolchainCflags() string {
return "-mssse3"
}
var toolchainFuchsiaSingleton Toolchain = &toolchainFuchsiaX8664{}
func fuchsiaToolchainFactory(arch android.Arch) Toolchain {
return toolchainFuchsiaSingleton
}
func init() {
registerToolchainFactory(android.Fuchsia, android.X86_64, fuchsiaToolchainFactory)
}

View File

@@ -15,9 +15,10 @@
package cc
import (
"fmt"
"android/soong/android"
"android/soong/cc/config"
"fmt"
"github.com/google/blueprint"
"github.com/google/blueprint/proptools"
@@ -389,18 +390,6 @@ func (linker *baseLinker) linkerDeps(ctx DepsContext, deps Deps) Deps {
deps.LateSharedLibs = append(deps.LateSharedLibs, deps.SystemSharedLibs...)
if ctx.Fuchsia() {
if ctx.ModuleName() != "libbioniccompat" &&
ctx.ModuleName() != "libcompiler_rt-extras" &&
ctx.ModuleName() != "libcompiler_rt" {
deps.StaticLibs = append(deps.StaticLibs, "libbioniccompat")
}
if ctx.ModuleName() != "libcompiler_rt" && ctx.ModuleName() != "libcompiler_rt-extras" {
deps.LateStaticLibs = append(deps.LateStaticLibs, "libcompiler_rt")
}
}
if ctx.Windows() {
deps.LateStaticLibs = append(deps.LateStaticLibs, "libwinpthread")
}
@@ -484,7 +473,7 @@ func (linker *baseLinker) linkerFlags(ctx ModuleContext, flags Flags) Flags {
flags.Global.LdFlags = append(flags.Global.LdFlags, toolchain.Ldflags())
}
if !ctx.toolchain().Bionic() && !ctx.Fuchsia() {
if !ctx.toolchain().Bionic() {
CheckBadHostLdlibs(ctx, "host_ldlibs", linker.Properties.Host_ldlibs)
flags.Local.LdFlags = append(flags.Local.LdFlags, linker.Properties.Host_ldlibs...)
@@ -503,10 +492,6 @@ func (linker *baseLinker) linkerFlags(ctx ModuleContext, flags Flags) Flags {
}
}
if ctx.Fuchsia() {
flags.Global.LdFlags = append(flags.Global.LdFlags, "-lfdio", "-lzircon")
}
if ctx.toolchain().LibclangRuntimeLibraryArch() != "" {
flags.Global.LdFlags = append(flags.Global.LdFlags, "-Wl,--exclude-libs="+config.BuiltinsRuntimeLibrary(ctx.toolchain())+".a")
}

View File

@@ -150,12 +150,6 @@ func (this *stubDecorator) stubsVersions(ctx android.BaseMutatorContext) []strin
if !ctx.Module().Enabled() {
return nil
}
if ctx.Os() != android.Android {
// These modules are always android.DeviceEnabled only, but
// those include Fuchsia devices, which we don't support.
ctx.Module().Disable()
return nil
}
if ctx.Target().NativeBridge == android.NativeBridgeEnabled {
ctx.Module().Disable()
return nil

View File

@@ -101,10 +101,6 @@ func classifySourceAbiDump(ctx android.BaseModuleContext) string {
// Called from sabiDepsMutator to check whether ABI dumps should be created for this module.
// ctx should be wrapping a native library type module.
func shouldCreateSourceAbiDumpForLibrary(ctx android.BaseModuleContext) bool {
if ctx.Fuchsia() {
return false
}
// Only generate ABI dump for device modules.
if !ctx.Device() {
return false

View File

@@ -265,7 +265,6 @@ type SanitizeUserProps struct {
}
type SanitizeProperties struct {
// Sanitizers are not supported for Fuchsia.
Sanitize SanitizeUserProps `android:"arch_variant"`
SanitizerEnabled bool `blueprint:"mutated"`
SanitizeDep bool `blueprint:"mutated"`
@@ -305,11 +304,6 @@ func (sanitize *sanitize) begin(ctx BaseModuleContext) {
s.Never = BoolPtr(true)
}
// Sanitizers do not work on Fuchsia yet.
if ctx.Fuchsia() {
s.Never = BoolPtr(true)
}
// Never always wins.
if Bool(s.Never) {
return

View File

@@ -15,8 +15,9 @@
package cc
import (
"android/soong/android"
"fmt"
"android/soong/android"
)
func getNdkStlFamily(m LinkableInterface) string {
@@ -92,26 +93,6 @@ func (stl *stl) begin(ctx BaseModuleContext) {
ctx.ModuleErrorf("stl: %q is not a supported STL for windows", s)
return ""
}
} else if ctx.Fuchsia() {
switch s {
case "c++_static":
return "libc++_static"
case "c++_shared":
return "libc++"
case "libc++", "libc++_static":
return s
case "none":
return ""
case "":
if ctx.static() {
return "libc++_static"
} else {
return "libc++"
}
default:
ctx.ModuleErrorf("stl: %q is not a supported STL on Fuchsia", s)
return ""
}
} else {
switch s {
case "libc++", "libc++_static":

View File

@@ -44,9 +44,6 @@ func GatherRequiredDepsForTest(oses ...android.OsType) string {
supportLinuxBionic := false
for _, os := range oses {
if os == android.Fuchsia {
ret += withFuchsiaModules()
}
if os == android.Windows {
ret += withWindowsModules()
}
@@ -471,19 +468,6 @@ func withWindowsModules() string {
`
}
func withFuchsiaModules() string {
return `
cc_library {
name: "libbioniccompat",
stl: "none",
}
cc_library {
name: "libcompiler_rt",
stl: "none",
}
`
}
func withLinuxBionic() string {
return `
cc_binary {
@@ -625,14 +609,6 @@ var PrepareForTestOnLinuxBionic = android.GroupFixturePreparers(
android.FixtureOverrideTextFile(linuxBionicDefaultsPath, withLinuxBionic()),
)
// The preparer to include if running a cc related test for fuchsia.
var PrepareForTestOnFuchsia = android.GroupFixturePreparers(
// Place the default cc test modules for fuschia in a location that will not conflict with default
// test modules defined by other packages.
android.FixtureAddTextFile("defaults/cc/fuschia/Android.bp", withFuchsiaModules()),
android.PrepareForTestSetDeviceToFuchsia,
)
// This adds some additional modules and singletons which might negatively impact the performance
// of tests so they are not included in the PrepareForIntegrationTestWithCc.
var PrepareForTestWithCcIncludeVndk = android.GroupFixturePreparers(
@@ -663,14 +639,7 @@ func TestConfig(buildDir string, os android.OsType, env map[string]string,
mockFS[k] = v
}
var config android.Config
if os == android.Fuchsia {
panic("Fuchsia not supported use test fixture instead")
} else {
config = android.TestArchConfig(buildDir, env, bp, mockFS)
}
return config
return android.TestArchConfig(buildDir, env, bp, mockFS)
}
// CreateTestContext is the legacy way of creating a TestContext for testing cc modules.