On Wed, 2023-11-29 at 21:07 +0800, Tiezhu Yang wrote:
+KBUILD_AFLAGS += $(call cc-option,-mthin-add-sub) $(call cc-option,-Wa$(comma)-mthin-add-sub)
+KBUILD_CFLAGS += $(call cc-option,-mthin-add-sub) $(call cc-option,-Wa$(comma)-mthin-add-sub)
+
+ifdef CONFIG_OBJTOOL
+KBUILD_CFLAGS += -fno-optimize-sibling-calls -fno-jump-tables -falign-functions=4 -falign-labels=4
+endif
I still hate regressing the optimization with a passion.
And -falign-labels=4 implies -falign-functions=4 so at least we can
remove -falign-functions=4.
And in GCC >= 14 the defaults are -falign-labels=16 and -falign-
functions=32. These values are determined by benchmarking on LA464 so
I'd suggest using them (maybe unless CONFIG_CC_OPTIMIZE_FOR_SIZE).