From 742a5453c26548607c531239642e0c55d111a952 Mon Sep 17 00:00:00 2001 From: Dan Willemsen Date: Mon, 23 Jul 2018 17:19:36 -0700 Subject: [PATCH] Remove `clang: false` support Most everything in Soong is using clang (and we're getting very close for Make as well), so remove the ability to select GCC to build a module. We still need to keep the internal functionality around to find libgcc.a and other toolchain_library modules with GCC. Test: m blueprint_tools Change-Id: I5ef3e3836b9ad3e160669ac32aee39698c9b72c3 --- cc/cc.go | 15 ++++++++------- cc/toolchain_library.go | 2 +- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/cc/cc.go b/cc/cc.go index f8a8225b7..bde8041ea 100644 --- a/cc/cc.go +++ b/cc/cc.go @@ -159,9 +159,12 @@ type ObjectLinkerProperties struct { // Properties used to compile all C or C++ modules type BaseProperties struct { - // compile module with clang instead of gcc + // Deprecated. true is the default, false is invalid. Clang *bool `android:"arch_variant"` + // Some internals still need GCC (toolchain_library) + Gcc bool `blueprint:"mutated"` + // Minimum sdk version supported when compiling against the ndk Sdk_version *string @@ -1080,17 +1083,15 @@ func beginMutator(ctx android.BottomUpMutatorContext) { } func (c *Module) clang(ctx BaseModuleContext) bool { - clang := Bool(c.Properties.Clang) - - if c.Properties.Clang == nil { - clang = true + if c.Properties.Clang != nil && *c.Properties.Clang == false { + ctx.PropertyErrorf("clang", "false (GCC) is no longer supported") } if !c.toolchain(ctx).ClangSupported() { - clang = false + panic("GCC is no longer supported") } - return clang + return !c.Properties.Gcc } // Whether a module can link to another module, taking into diff --git a/cc/toolchain_library.go b/cc/toolchain_library.go index 2bb4018eb..2b117b325 100644 --- a/cc/toolchain_library.go +++ b/cc/toolchain_library.go @@ -43,7 +43,7 @@ func toolchainLibraryFactory() android.Module { } module.compiler = toolchainLibrary module.linker = toolchainLibrary - module.Properties.Clang = BoolPtr(false) + module.Properties.Gcc = true module.stl = nil module.sanitize = nil module.installer = nil