From 6ea0f81c3f31a18daf3cf3d254eee4e73df0fc95 Mon Sep 17 00:00:00 2001 From: Stephen Hines Date: Thu, 11 Jan 2018 11:56:19 -0800 Subject: [PATCH] Remove unnecessary DeviceUsesClang. This build function is unnecessary now that GCC is completely unsupported for Android platform builds. It is similar to USE_CLANG_PLATFORM_BUILD from the build/make side of things. Bug: http://b/64032869 Test: Builds Change-Id: Iddf5f91cc997c337c77a644265cb8dc4e5a915b4 --- android/config.go | 7 ------- android/variable.go | 2 -- cc/cc.go | 8 +------- scripts/build-ndk-prebuilts.sh | 1 - 4 files changed, 1 insertion(+), 17 deletions(-) diff --git a/android/config.go b/android/config.go index 630785b8b..43d743b6b 100644 --- a/android/config.go +++ b/android/config.go @@ -430,13 +430,6 @@ func (c *config) DeviceName() string { return *c.ProductVariables.DeviceName } -func (c *config) DeviceUsesClang() bool { - if c.ProductVariables.DeviceUsesClang != nil { - return *c.ProductVariables.DeviceUsesClang - } - return true -} - func (c *config) ResourceOverlays() []string { if c.ProductVariables.ResourceOverlays == nil { return nil diff --git a/android/variable.go b/android/variable.go index 6962b0fcb..d58ed6a9f 100644 --- a/android/variable.go +++ b/android/variable.go @@ -121,7 +121,6 @@ type productVariables struct { DeviceArchVariant *string `json:",omitempty"` DeviceCpuVariant *string `json:",omitempty"` DeviceAbi *[]string `json:",omitempty"` - DeviceUsesClang *bool `json:",omitempty"` DeviceVndkVersion *string `json:",omitempty"` DeviceSecondaryArch *string `json:",omitempty"` @@ -231,7 +230,6 @@ func (v *productVariables) SetDefaultConfig() { DeviceArchVariant: stringPtr("armv8-a"), DeviceCpuVariant: stringPtr("generic"), DeviceAbi: &[]string{"arm64-v8a"}, - DeviceUsesClang: boolPtr(true), DeviceSecondaryArch: stringPtr("arm"), DeviceSecondaryArchVariant: stringPtr("armv8-a"), DeviceSecondaryCpuVariant: stringPtr("generic"), diff --git a/cc/cc.go b/cc/cc.go index 13d0e3b28..e5a483d8f 100644 --- a/cc/cc.go +++ b/cc/cc.go @@ -947,13 +947,7 @@ func (c *Module) clang(ctx BaseModuleContext) bool { clang := Bool(c.Properties.Clang) if c.Properties.Clang == nil { - if ctx.Host() { - clang = true - } - - if ctx.Device() && ctx.Config().DeviceUsesClang() { - clang = true - } + clang = true } if !c.toolchain(ctx).ClangSupported() { diff --git a/scripts/build-ndk-prebuilts.sh b/scripts/build-ndk-prebuilts.sh index 55214b2f6..d15045190 100755 --- a/scripts/build-ndk-prebuilts.sh +++ b/scripts/build-ndk-prebuilts.sh @@ -55,7 +55,6 @@ cat > ${SOONG_OUT}/soong.variables << EOF "DeviceAbi": [ "arm64-v8a" ], - "DeviceUsesClang": true, "DeviceSecondaryArch": "arm", "DeviceSecondaryArchVariant": "armv7-a-neon", "DeviceSecondaryCpuVariant": "denver",