mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-06-21 15:43:21 +02:00
7594302d9d
Starting with Rust 1.98.0 (expected 2026-08-20), the
`-Zdebug-info-for-profiling` flag has been renamed to
`-Zdebuginfo-for-profiling` (i.e. one less dash, to match `debuginfo`s
in other flags) [1].
Without this change, one gets in the latest nightlies:
error: unknown unstable option: `debug-info-for-profiling`
Thus pass the right name.
Link: https://github.com/rust-lang/rust/pull/156887 [1]
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Acked-by: Nathan Chancellor <nathan@kernel.org>
Link: https://patch.msgid.link/20260602151638.14358-1-ojeda@kernel.org
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
29 lines
1.2 KiB
Makefile
29 lines
1.2 KiB
Makefile
# SPDX-License-Identifier: GPL-2.0
|
|
|
|
# Enable available and selected Clang AutoFDO features.
|
|
|
|
CFLAGS_AUTOFDO_CLANG := -fdebug-info-for-profiling -mllvm -enable-fs-discriminator=true -mllvm -improved-fs-discriminator=true
|
|
RUSTFLAGS_AUTOFDO_CLANG := $(if $(call rustc-min-version,109800),-Zdebuginfo-for-profiling,-Zdebug-info-for-profiling) -Cllvm-args=-enable-fs-discriminator=true -Cllvm-args=-improved-fs-discriminator=true
|
|
|
|
ifndef CONFIG_DEBUG_INFO
|
|
CFLAGS_AUTOFDO_CLANG += -gmlt
|
|
RUSTFLAGS_AUTOFDO_CLANG += -Cdebuginfo=line-tables-only
|
|
endif
|
|
|
|
ifdef CLANG_AUTOFDO_PROFILE
|
|
CFLAGS_AUTOFDO_CLANG += -fprofile-sample-use=$(CLANG_AUTOFDO_PROFILE) -ffunction-sections
|
|
CFLAGS_AUTOFDO_CLANG += -fsplit-machine-functions
|
|
RUSTFLAGS_AUTOFDO_CLANG += -Zprofile-sample-use=$(CLANG_AUTOFDO_PROFILE) -Zfunction-sections=y
|
|
RUSTFLAGS_AUTOFDO_CLANG += -Cllvm-args=-split-machine-functions
|
|
endif
|
|
|
|
ifdef CONFIG_LTO_CLANG_THIN
|
|
ifdef CLANG_AUTOFDO_PROFILE
|
|
KBUILD_LDFLAGS += --lto-sample-profile=$(CLANG_AUTOFDO_PROFILE)
|
|
endif
|
|
KBUILD_LDFLAGS += --mllvm=-enable-fs-discriminator=true --mllvm=-improved-fs-discriminator=true -plugin-opt=thinlto
|
|
KBUILD_LDFLAGS += -plugin-opt=-split-machine-functions
|
|
endif
|
|
|
|
export CFLAGS_AUTOFDO_CLANG RUSTFLAGS_AUTOFDO_CLANG
|