Re: [PATCH v7 7/7] Add Propeller configuration for kernel build

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Rong,

On Sat, Nov 02, 2024 at 10:51:14AM -0700, Rong Xu wrote:
> diff --git a/scripts/Makefile.propeller b/scripts/Makefile.propeller
> new file mode 100644
> index 0000000000000..344190717e471
> --- /dev/null
> +++ b/scripts/Makefile.propeller
> @@ -0,0 +1,28 @@
> +# SPDX-License-Identifier: GPL-2.0
> +
> +# Enable available and selected Clang Propeller features.
> +ifdef CLANG_PROPELLER_PROFILE_PREFIX
> +  CFLAGS_PROPELLER_CLANG := -fbasic-block-sections=list=$(CLANG_PROPELLER_PROFILE_PREFIX)_cc_profile.txt -ffunction-sections
> +  KBUILD_LDFLAGS += --symbol-ordering-file=$(CLANG_PROPELLER_PROFILE_PREFIX)_ld_profile.txt --no-warn-symbol-ordering
> +else
> +  CFLAGS_PROPELLER_CLANG := -fbasic-block-sections=labels
> +endif

It appears that '-fbasic-block-sections=labels' has been deprecated in
the main branch of LLVM, as I see a warning repeated over and over when
building allmodconfig:

  clang: warning: argument '-fbasic-block-sections=labels' is deprecated, use '-fbasic-block-address-map' instead [-Wdeprecated]

https://github.com/llvm/llvm-project/commit/7b7747dc1d3da1a829503ea9505b4cecce4f5bda

Sorry that I missed this during testing, as I was only using clang-19 at
the time.

I think you can send a fixup on top of Masahiro's branch:

https://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild.git/log/?h=kbuild

> +# Propeller requires debug information to embed module names in the profiles.
> +# If CONFIG_DEBUG_INFO is not enabled, set -gmlt option. Skip this for AutoFDO,
> +# as the option should already be set.
> +ifndef CONFIG_DEBUG_INFO
> +  ifndef CONFIG_AUTOFDO_CLANG
> +    CFLAGS_PROPELLER_CLANG += -gmlt
> +  endif
> +endif
> +
> +ifdef CONFIG_LTO_CLANG_THIN
> +  ifdef CLANG_PROPELLER_PROFILE_PREFIX
> +    KBUILD_LDFLAGS += --lto-basic-block-sections=$(CLANG_PROPELLER_PROFILE_PREFIX)_cc_profile.txt
> +  else
> +    KBUILD_LDFLAGS += --lto-basic-block-sections=labels

I think this might have a similar problem but I have not tested.

> +  endif
> +endif
> +
> +export CFLAGS_PROPELLER_CLANG

Cheers,
Nathan




[Index of Archives]     [Kernel Development]     [DCCP]     [Linux ARM Development]     [Linux]     [Photo]     [Yosemite Help]     [Linux ARM Kernel]     [Linux SCSI]     [Linux x86_64]     [Linux Hams]

  Powered by Linux