From d49aa55cf1b0acec040ad7fdf27fd75085ea7123 Mon Sep 17 00:00:00 2001 From: Stephen Hines Date: Mon, 5 Apr 2021 17:12:32 -0700 Subject: [PATCH] Remove all unused, legacy FDO build rules There are no current users of this feature. All remaining references are legacy scripts that aren't actually in-use today. https://source.corp.google.com/search?q=BUILD_FDO_INSTRUMENT%20-file:build%2F https://source.corp.google.com/search?q=LOCAL_FDO&ct=os&sq=package:%5Eandroid$ Test: build Change-Id: I86ff6531a0868fb8e30741f0d04de1739fba4586 --- core/binary.mk | 27 ------------------------- core/clear_vars.mk | 1 - core/combo/TARGET_linux-arm.mk | 1 - core/combo/TARGET_linux-arm64.mk | 1 - core/combo/TARGET_linux-x86.mk | 1 - core/combo/TARGET_linux-x86_64.mk | 1 - core/combo/fdo.mk | 33 ------------------------------- 7 files changed, 65 deletions(-) delete mode 100644 core/combo/fdo.mk diff --git a/core/binary.mk b/core/binary.mk index 0d7206f1a..cf47374b5 100644 --- a/core/binary.mk +++ b/core/binary.mk @@ -471,27 +471,6 @@ ifneq ($(foreach i,$(my_c_includes),$(filter %/..,$(i))$(findstring /../,$(i))), my_soong_problems += dotdot_incs endif -#################################################### -## Add FDO flags if FDO is turned on and supported -## Please note that we will do option filtering during FDO build. -## i.e. Os->O2, remove -fno-early-inline and -finline-limit. -################################################################## -my_fdo_build := -ifneq ($(filter true always, $(LOCAL_FDO_SUPPORT)),) - ifeq ($(BUILD_FDO_INSTRUMENT),true) - my_cflags += $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_FDO_INSTRUMENT_CFLAGS) - my_ldflags += $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_FDO_INSTRUMENT_LDFLAGS) - my_fdo_build := true - else ifneq ($(filter true,$(BUILD_FDO_OPTIMIZE))$(filter always,$(LOCAL_FDO_SUPPORT)),) - my_cflags += $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_FDO_OPTIMIZE_CFLAGS) - my_fdo_build := true - endif - # Disable ccache (or other compiler wrapper) except gomacc, which - # can handle -fprofile-use properly. - my_cc_wrapper := $(filter $(GOMA_CC) $(RBE_WRAPPER),$(my_cc_wrapper)) - my_cxx_wrapper := $(filter $(GOMA_CC) $(RBE_WRAPPER),$(my_cxx_wrapper)) -endif - ########################################################### ## Explicitly declare assembly-only __ASSEMBLY__ macro for ## assembly source @@ -1479,12 +1458,6 @@ my_cppflags := $(call convert-to-clang-flags,$(my_cppflags)) my_asflags := $(call convert-to-clang-flags,$(my_asflags)) my_ldflags := $(call convert-to-clang-flags,$(my_ldflags)) -ifeq ($(my_fdo_build), true) - my_cflags := $(patsubst -Os,-O2,$(my_cflags)) - fdo_incompatible_flags := -fno-early-inlining -finline-limit=% - my_cflags := $(filter-out $(fdo_incompatible_flags),$(my_cflags)) -endif - # No one should ever use this flag. On GCC it's mere presence will disable all # warnings, even those that are specified after it (contrary to typical warning # flag behavior). This circumvents CFLAGS_NO_OVERRIDE from forcibly enabling the diff --git a/core/clear_vars.mk b/core/clear_vars.mk index 019892e5e..e2864bf27 100644 --- a/core/clear_vars.mk +++ b/core/clear_vars.mk @@ -100,7 +100,6 @@ LOCAL_EXPORT_STATIC_LIBRARY_HEADERS:= LOCAL_EXTRA_FULL_TEST_CONFIGS:= LOCAL_EXTRACT_APK:= LOCAL_EXTRACT_DPI_APK:= -LOCAL_FDO_SUPPORT:= LOCAL_FILE_CONTEXTS:= LOCAL_FINDBUGS_FLAGS:= LOCAL_FORCE_STATIC_EXECUTABLE:= diff --git a/core/combo/TARGET_linux-arm.mk b/core/combo/TARGET_linux-arm.mk index e45c1a6ba..11c19444b 100644 --- a/core/combo/TARGET_linux-arm.mk +++ b/core/combo/TARGET_linux-arm.mk @@ -64,7 +64,6 @@ ifeq ($(strip $(wildcard $(TARGET_ARCH_SPECIFIC_MAKEFILE))),) endif include $(TARGET_ARCH_SPECIFIC_MAKEFILE) -include $(BUILD_SYSTEM)/combo/fdo.mk define $(combo_var_prefix)transform-shared-lib-to-toc $(call _gen_toc_command_for_elf,$(1),$(2)) diff --git a/core/combo/TARGET_linux-arm64.mk b/core/combo/TARGET_linux-arm64.mk index a3f59a774..5d481cb8f 100644 --- a/core/combo/TARGET_linux-arm64.mk +++ b/core/combo/TARGET_linux-arm64.mk @@ -39,7 +39,6 @@ $(error Unknown ARM architecture version: $(TARGET_ARCH_VARIANT)) endif include $(TARGET_ARCH_SPECIFIC_MAKEFILE) -include $(BUILD_SYSTEM)/combo/fdo.mk define $(combo_var_prefix)transform-shared-lib-to-toc $(call _gen_toc_command_for_elf,$(1),$(2)) diff --git a/core/combo/TARGET_linux-x86.mk b/core/combo/TARGET_linux-x86.mk index 2c4614b6c..acbae519f 100644 --- a/core/combo/TARGET_linux-x86.mk +++ b/core/combo/TARGET_linux-x86.mk @@ -32,7 +32,6 @@ $(error Unknown $(TARGET_$(combo_2nd_arch_prefix)ARCH) architecture version: $(T endif include $(TARGET_ARCH_SPECIFIC_MAKEFILE) -include $(BUILD_SYSTEM)/combo/fdo.mk define $(combo_var_prefix)transform-shared-lib-to-toc $(call _gen_toc_command_for_elf,$(1),$(2)) diff --git a/core/combo/TARGET_linux-x86_64.mk b/core/combo/TARGET_linux-x86_64.mk index d2172d601..9e7e3630d 100644 --- a/core/combo/TARGET_linux-x86_64.mk +++ b/core/combo/TARGET_linux-x86_64.mk @@ -32,7 +32,6 @@ $(error Unknown $(TARGET_ARCH) architecture version: $(TARGET_ARCH_VARIANT)) endif include $(TARGET_ARCH_SPECIFIC_MAKEFILE) -include $(BUILD_SYSTEM)/combo/fdo.mk define $(combo_var_prefix)transform-shared-lib-to-toc $(call _gen_toc_command_for_elf,$(1),$(2)) diff --git a/core/combo/fdo.mk b/core/combo/fdo.mk deleted file mode 100644 index 8fb8fd3a5..000000000 --- a/core/combo/fdo.mk +++ /dev/null @@ -1,33 +0,0 @@ -# -# Copyright (C) 2006 The Android Open Source Project -# -# 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. -# - -# Setup FDO related flags. - -$(combo_2nd_arch_prefix)TARGET_FDO_CFLAGS:= - -# Set BUILD_FDO_INSTRUMENT=true to turn on FDO instrumentation. -# The profile will be generated on /sdcard/fdo_profile on the device. -$(combo_2nd_arch_prefix)TARGET_FDO_INSTRUMENT_CFLAGS := -fprofile-generate=/sdcard/fdo_profile -DANDROID_FDO -$(combo_2nd_arch_prefix)TARGET_FDO_INSTRUMENT_LDFLAGS := -lgcov -lgcc - -# Set TARGET_FDO_PROFILE_PATH to set a custom profile directory for your build. -ifeq ($(strip $($(combo_2nd_arch_prefix)TARGET_FDO_PROFILE_PATH)),) - $(combo_2nd_arch_prefix)TARGET_FDO_PROFILE_PATH := vendor/google_data/fdo_profile -endif - -$(combo_2nd_arch_prefix)TARGET_FDO_OPTIMIZE_CFLAGS := \ - -fprofile-use=$($(combo_2nd_arch_prefix)TARGET_FDO_PROFILE_PATH) \ - -DANDROID_FDO -fprofile-correction -Wcoverage-mismatch -Wno-error