1# SPDX-License-Identifier: GPL-2.0 2 3# Enable available and selected Clang Propeller features. 4ifdef CLANG_PROPELLER_PROFILE_PREFIX 5 CFLAGS_PROPELLER_CLANG := -fbasic-block-sections=list=$(CLANG_PROPELLER_PROFILE_PREFIX)_cc_profile.txt -ffunction-sections 6 KBUILD_LDFLAGS += --symbol-ordering-file=$(CLANG_PROPELLER_PROFILE_PREFIX)_ld_profile.txt --no-warn-symbol-ordering 7else 8 CFLAGS_PROPELLER_CLANG := -fbasic-block-sections=labels 9endif 10 11# Propeller requires debug information to embed module names in the profiles. 12# If CONFIG_DEBUG_INFO is not enabled, set -gmlt option. Skip this for AutoFDO, 13# as the option should already be set. 14ifndef CONFIG_DEBUG_INFO 15 ifndef CONFIG_AUTOFDO_CLANG 16 CFLAGS_PROPELLER_CLANG += -gmlt 17 endif 18endif 19 20ifdef CONFIG_LTO_CLANG_THIN 21 ifdef CLANG_PROPELLER_PROFILE_PREFIX 22 KBUILD_LDFLAGS += --lto-basic-block-sections=$(CLANG_PROPELLER_PROFILE_PREFIX)_cc_profile.txt 23 else 24 KBUILD_LDFLAGS += --lto-basic-block-sections=labels 25 endif 26endif 27 28export CFLAGS_PROPELLER_CLANG 29