Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

kbuild: remove cc-option-align

Documentation/kbuild/makefiles.txt says the change for align options
occurred at GCC 3.0, and Documentation/process/changes.rst says the
minimal supported GCC version is 3.2, so it should be safe to hard-code
-falign* options.

Fix the only user arch/x86/Makefile_32.cpu and remove cc-option-align.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Ingo Molnar <mingo@kernel.org>

+3 -25
-16
Documentation/kbuild/makefiles.txt
··· 486 486 respectively. 487 487 Note: cc-option-yn uses KBUILD_CFLAGS for $(CC) options 488 488 489 - cc-option-align 490 - gcc versions >= 3.0 changed the type of options used to specify 491 - alignment of functions, loops etc. $(cc-option-align), when used 492 - as prefix to the align options, will select the right prefix: 493 - gcc < 3.00 494 - cc-option-align = -malign 495 - gcc >= 3.00 496 - cc-option-align = -falign 497 - 498 - Example: 499 - KBUILD_CFLAGS += $(cc-option-align)-functions=4 500 - 501 - In the above example, the option -falign-functions=4 is used for 502 - gcc >= 3.00. For gcc < 3.00, -malign-functions=4 is used. 503 - Note: cc-option-align uses KBUILD_CFLAGS for $(CC) options 504 - 505 489 cc-disable-warning 506 490 cc-disable-warning checks if gcc supports a given warning and returns 507 491 the commandline switch to disable it. This special function is needed,
+3 -4
arch/x86/Makefile_32.cpu
··· 9 9 tune = $(call cc-option,-mcpu=$(1),$(2)) 10 10 endif 11 11 12 - align := $(cc-option-align) 13 12 cflags-$(CONFIG_M486) += -march=i486 14 13 cflags-$(CONFIG_M586) += -march=i586 15 14 cflags-$(CONFIG_M586TSC) += -march=i586 ··· 23 24 # They make zero difference whatsosever to performance at this time. 24 25 cflags-$(CONFIG_MK7) += -march=athlon 25 26 cflags-$(CONFIG_MK8) += $(call cc-option,-march=k8,-march=athlon) 26 - cflags-$(CONFIG_MCRUSOE) += -march=i686 $(align)-functions=0 $(align)-jumps=0 $(align)-loops=0 27 - cflags-$(CONFIG_MEFFICEON) += -march=i686 $(call tune,pentium3) $(align)-functions=0 $(align)-jumps=0 $(align)-loops=0 27 + cflags-$(CONFIG_MCRUSOE) += -march=i686 -falign-functions=0 -falign-jumps=0 -falign-loops=0 28 + cflags-$(CONFIG_MEFFICEON) += -march=i686 $(call tune,pentium3) -falign-functions=0 -falign-jumps=0 -falign-loops=0 28 29 cflags-$(CONFIG_MWINCHIPC6) += $(call cc-option,-march=winchip-c6,-march=i586) 29 30 cflags-$(CONFIG_MWINCHIP3D) += $(call cc-option,-march=winchip2,-march=i586) 30 - cflags-$(CONFIG_MCYRIXIII) += $(call cc-option,-march=c3,-march=i486) $(align)-functions=0 $(align)-jumps=0 $(align)-loops=0 31 + cflags-$(CONFIG_MCYRIXIII) += $(call cc-option,-march=c3,-march=i486) -falign-functions=0 -falign-jumps=0 -falign-loops=0 31 32 cflags-$(CONFIG_MVIAC3_2) += $(call cc-option,-march=c3-2,-march=i686) 32 33 cflags-$(CONFIG_MVIAC7) += -march=i686 33 34 cflags-$(CONFIG_MCORE2) += -march=i686 $(call tune,core2)
-5
scripts/Kbuild.include
··· 123 123 cc-option-yn = $(call try-run,\ 124 124 $(CC) -Werror $(KBUILD_CPPFLAGS) $(CC_OPTION_CFLAGS) $(1) -c -x c /dev/null -o "$$TMP",y,n) 125 125 126 - # cc-option-align 127 - # Prefix align with either -falign or -malign 128 - cc-option-align = $(subst -functions=0,,\ 129 - $(call cc-option,-falign-functions=0,-malign-functions=0)) 130 - 131 126 # cc-disable-warning 132 127 # Usage: cflags-y += $(call cc-disable-warning,unused-but-set-variable) 133 128 cc-disable-warning = $(call try-run,\