Skip to content

Commit 885f566

Browse files
Ansuelstorulf
authored andcommitted
pmdomain: airoha: Fix compilation error with Clang-20 and Thumb2 mode
The use of R7 in the SMCCC conflicts with the compiler's use of R7 as a frame pointer in Thumb2 mode, which is forcibly enabled by Clang when profiling hooks are inserted via the -pg switch. This is a known issue and similar driver workaround this with a Makefile ifdef. Exact workaround are applied in drivers/firmware/arm_scmi/transports/Makefile and other similar driver. Suggested-by: Sudeep Holla <sudeep.holla@arm.com> Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202501201840.XmpHXpQ4-lkp@intel.com/ Fixes: 82e703d ("pmdomain: airoha: Add Airoha CPU PM Domain support") Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> Link: https://lore.kernel.org/r/20250120153817.11807-1-ansuelsmth@gmail.com Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
1 parent c2d7aa3 commit 885f566

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/pmdomain/mediatek/Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,10 @@
22
obj-$(CONFIG_MTK_SCPSYS) += mtk-scpsys.o
33
obj-$(CONFIG_MTK_SCPSYS_PM_DOMAINS) += mtk-pm-domains.o
44
obj-$(CONFIG_AIROHA_CPU_PM_DOMAIN) += airoha-cpu-pmdomain.o
5+
6+
ifeq ($(CONFIG_THUMB2_KERNEL)$(CONFIG_CC_IS_CLANG),yy)
7+
# The use of R7 in the SMCCC conflicts with the compiler's use of R7 as a frame
8+
# pointer in Thumb2 mode, which is forcibly enabled by Clang when profiling
9+
# hooks are inserted via the -pg switch.
10+
CFLAGS_REMOVE_airoha-cpu-pmdomain.o += $(CC_FLAGS_FTRACE)
11+
endif

0 commit comments

Comments
 (0)