diff options
| -rw-r--r-- | Makefile | 43 |
1 files changed, 23 insertions, 20 deletions
| @@ -484,26 +484,6 @@ CLANG_GCC_TC := --gcc-toolchain=$(GCC_TOOLCHAIN) | |||
| 484 | endif | 484 | endif |
| 485 | KBUILD_CFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC) | 485 | KBUILD_CFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC) |
| 486 | KBUILD_AFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC) | 486 | KBUILD_AFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC) |
| 487 | KBUILD_CPPFLAGS += $(call cc-option,-Qunused-arguments,) | ||
| 488 | KBUILD_CFLAGS += $(call cc-disable-warning, unused-variable) | ||
| 489 | KBUILD_CFLAGS += $(call cc-disable-warning, format-invalid-specifier) | ||
| 490 | KBUILD_CFLAGS += $(call cc-disable-warning, gnu) | ||
| 491 | KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member) | ||
| 492 | # Quiet clang warning: comparison of unsigned expression < 0 is always false | ||
| 493 | KBUILD_CFLAGS += $(call cc-disable-warning, tautological-compare) | ||
| 494 | # CLANG uses a _MergedGlobals as optimization, but this breaks modpost, as the | ||
| 495 | # source of a reference will be _MergedGlobals and not on of the whitelisted names. | ||
| 496 | # See modpost pattern 2 | ||
| 497 | KBUILD_CFLAGS += $(call cc-option, -mno-global-merge,) | ||
| 498 | KBUILD_CFLAGS += $(call cc-option, -fcatch-undefined-behavior) | ||
| 499 | KBUILD_CFLAGS += $(call cc-option, -no-integrated-as) | ||
| 500 | KBUILD_AFLAGS += $(call cc-option, -no-integrated-as) | ||
| 501 | else | ||
| 502 | |||
| 503 | # These warnings generated too much noise in a regular build. | ||
| 504 | # Use make W=1 to enable them (see scripts/Makefile.extrawarn) | ||
| 505 | KBUILD_CFLAGS += $(call cc-disable-warning, unused-but-set-variable) | ||
| 506 | KBUILD_CFLAGS += $(call cc-disable-warning, unused-const-variable) | ||
| 507 | endif | 487 | endif |
| 508 | 488 | ||
| 509 | ifeq ($(config-targets),1) | 489 | ifeq ($(config-targets),1) |
| @@ -716,6 +696,29 @@ ifdef CONFIG_CC_STACKPROTECTOR | |||
| 716 | endif | 696 | endif |
| 717 | KBUILD_CFLAGS += $(stackp-flag) | 697 | KBUILD_CFLAGS += $(stackp-flag) |
| 718 | 698 | ||
| 699 | ifeq ($(cc-name),clang) | ||
| 700 | KBUILD_CPPFLAGS += $(call cc-option,-Qunused-arguments,) | ||
| 701 | KBUILD_CFLAGS += $(call cc-disable-warning, unused-variable) | ||
| 702 | KBUILD_CFLAGS += $(call cc-disable-warning, format-invalid-specifier) | ||
| 703 | KBUILD_CFLAGS += $(call cc-disable-warning, gnu) | ||
| 704 | KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member) | ||
| 705 | # Quiet clang warning: comparison of unsigned expression < 0 is always false | ||
| 706 | KBUILD_CFLAGS += $(call cc-disable-warning, tautological-compare) | ||
| 707 | # CLANG uses a _MergedGlobals as optimization, but this breaks modpost, as the | ||
| 708 | # source of a reference will be _MergedGlobals and not on of the whitelisted names. | ||
| 709 | # See modpost pattern 2 | ||
| 710 | KBUILD_CFLAGS += $(call cc-option, -mno-global-merge,) | ||
| 711 | KBUILD_CFLAGS += $(call cc-option, -fcatch-undefined-behavior) | ||
| 712 | KBUILD_CFLAGS += $(call cc-option, -no-integrated-as) | ||
| 713 | KBUILD_AFLAGS += $(call cc-option, -no-integrated-as) | ||
| 714 | else | ||
| 715 | |||
| 716 | # These warnings generated too much noise in a regular build. | ||
| 717 | # Use make W=1 to enable them (see scripts/Makefile.extrawarn) | ||
| 718 | KBUILD_CFLAGS += $(call cc-disable-warning, unused-but-set-variable) | ||
| 719 | KBUILD_CFLAGS += $(call cc-disable-warning, unused-const-variable) | ||
| 720 | endif | ||
| 721 | |||
| 719 | ifdef CONFIG_FRAME_POINTER | 722 | ifdef CONFIG_FRAME_POINTER |
| 720 | KBUILD_CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls | 723 | KBUILD_CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls |
| 721 | else | 724 | else |
