Skip to content

Commit 861d9dd

Browse files
committed
Merge tag 'kbuild-fixes-v4.17-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
Pull more Kbuild fixes from Masahiro Yamada: - enable '-fno-tree-loop-im' only when supported - add '-fno-PIE' option before the asm-goto test * tag 'kbuild-fixes-v4.17-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: Makefile: disable PIE before testing asm goto kbuild: gcov: enable -fno-tree-loop-im if supported
2 parents 7fbb615 + 8438ee7 commit 861d9dd

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Makefile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,9 @@ RETPOLINE_CFLAGS_CLANG := -mretpoline-external-thunk
500500
RETPOLINE_CFLAGS := $(call cc-option,$(RETPOLINE_CFLAGS_GCC),$(call cc-option,$(RETPOLINE_CFLAGS_CLANG)))
501501
export RETPOLINE_CFLAGS
502502

503+
KBUILD_CFLAGS += $(call cc-option,-fno-PIE)
504+
KBUILD_AFLAGS += $(call cc-option,-fno-PIE)
505+
503506
# check for 'asm goto'
504507
ifeq ($(call shell-cached,$(CONFIG_SHELL) $(srctree)/scripts/gcc-goto.sh $(CC) $(KBUILD_CFLAGS)), y)
505508
CC_HAVE_ASM_GOTO := 1
@@ -621,9 +624,9 @@ endif # $(dot-config)
621624
# Defaults to vmlinux, but the arch makefile usually adds further targets
622625
all: vmlinux
623626

624-
KBUILD_CFLAGS += $(call cc-option,-fno-PIE)
625-
KBUILD_AFLAGS += $(call cc-option,-fno-PIE)
626-
CFLAGS_GCOV := -fprofile-arcs -ftest-coverage -fno-tree-loop-im $(call cc-disable-warning,maybe-uninitialized,)
627+
CFLAGS_GCOV := -fprofile-arcs -ftest-coverage \
628+
$(call cc-option,-fno-tree-loop-im) \
629+
$(call cc-disable-warning,maybe-uninitialized,)
627630
export CFLAGS_GCOV CFLAGS_KCOV
628631

629632
# The arch Makefile can set ARCH_{CPP,A,C}FLAGS to override the default

0 commit comments

Comments
 (0)