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.
Unified · Split
| @@ -486,22 +486,6 @@ more details, with real examples. · 485 unmodified lines | |||
| 486 | respectively. | 486 | respectively. |
| 487 | Note: cc-option-yn uses KBUILD_CFLAGS for $(CC) options | 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 | cc-disable-warning | 489 | cc-disable-warning |
| 506 | cc-disable-warning checks if gcc supports a given warning and returns | 490 | cc-disable-warning checks if gcc supports a given warning and returns |
| 507 | the commandline switch to disable it. This special function is needed, | 491 | the commandline switch to disable it. This special function is needed, |
| @@ -9,7 +9,6 @@ else · 8 unmodified lines | |||
| 9 | tune = $(call cc-option,-mcpu=$(1),$(2)) | 9 | tune = $(call cc-option,-mcpu=$(1),$(2)) |
| 10 | endif | 10 | endif |
| 11 | 11 | ||
| 12 | align := $(cc-option-align) | ||
| 13 | cflags-$(CONFIG_M486) += -march=i486 | 12 | cflags-$(CONFIG_M486) += -march=i486 |
| 14 | cflags-$(CONFIG_M586) += -march=i586 | 13 | cflags-$(CONFIG_M586) += -march=i586 |
| 15 | cflags-$(CONFIG_M586TSC) += -march=i586 | 14 | cflags-$(CONFIG_M586TSC) += -march=i586 |
| @@ -24,11 +23,11 @@ cflags-$(CONFIG_MK6) += -march=k6 · 8 unmodified lines | |||
| 24 | # They make zero difference whatsosever to performance at this time. | 23 | # They make zero difference whatsosever to performance at this time. |
| 25 | cflags-$(CONFIG_MK7) += -march=athlon | 24 | cflags-$(CONFIG_MK7) += -march=athlon |
| 26 | cflags-$(CONFIG_MK8) += $(call cc-option,-march=k8,-march=athlon) | 25 | cflags-$(CONFIG_MK8) += $(call cc-option,-march=k8,-march=athlon) |
| 27 | cflags-$(CONFIG_MCRUSOE) += -march=i686 $(align)-functions=0 $(align)-jumps=0 $(align)-loops=0 | 26 | cflags-$(CONFIG_MCRUSOE) += -march=i686 -falign-functions=0 -falign-jumps=0 -falign-loops=0 |
| 28 | cflags-$(CONFIG_MEFFICEON) += -march=i686 $(call tune,pentium3) $(align)-functions=0 $(align)-jumps=0 $(align)-loops=0 | 27 | cflags-$(CONFIG_MEFFICEON) += -march=i686 $(call tune,pentium3) -falign-functions=0 -falign-jumps=0 -falign-loops=0 |
| 29 | cflags-$(CONFIG_MWINCHIPC6) += $(call cc-option,-march=winchip-c6,-march=i586) | 28 | cflags-$(CONFIG_MWINCHIPC6) += $(call cc-option,-march=winchip-c6,-march=i586) |
| 30 | cflags-$(CONFIG_MWINCHIP3D) += $(call cc-option,-march=winchip2,-march=i586) | 29 | cflags-$(CONFIG_MWINCHIP3D) += $(call cc-option,-march=winchip2,-march=i586) |
| 31 | cflags-$(CONFIG_MCYRIXIII) += $(call cc-option,-march=c3,-march=i486) $(align)-functions=0 $(align)-jumps=0 $(align)-loops=0 | 30 | cflags-$(CONFIG_MCYRIXIII) += $(call cc-option,-march=c3,-march=i486) -falign-functions=0 -falign-jumps=0 -falign-loops=0 |
| 32 | cflags-$(CONFIG_MVIAC3_2) += $(call cc-option,-march=c3-2,-march=i686) | 31 | cflags-$(CONFIG_MVIAC3_2) += $(call cc-option,-march=c3-2,-march=i686) |
| 33 | cflags-$(CONFIG_MVIAC7) += -march=i686 | 32 | cflags-$(CONFIG_MVIAC7) += -march=i686 |
| 34 | cflags-$(CONFIG_MCORE2) += -march=i686 $(call tune,core2) | 33 | cflags-$(CONFIG_MCORE2) += -march=i686 $(call tune,core2) |
| @@ -123,11 +123,6 @@ cc-option = $(call try-run,\ · 122 unmodified lines | |||
| 123 | cc-option-yn = $(call try-run,\ | 123 | cc-option-yn = $(call try-run,\ |
| 124 | $(CC) -Werror $(KBUILD_CPPFLAGS) $(CC_OPTION_CFLAGS) $(1) -c -x c /dev/null -o "$$TMP",y,n) | 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 | # cc-disable-warning | 126 | # cc-disable-warning |
| 132 | # Usage: cflags-y += $(call cc-disable-warning,unused-but-set-variable) | 127 | # Usage: cflags-y += $(call cc-disable-warning,unused-but-set-variable) |
| 133 | cc-disable-warning = $(call try-run,\ | 128 | cc-disable-warning = $(call try-run,\ |