Skip to content

Commit ce99d0b

Browse files
committed
kbuild: clear LDFLAGS in the top Makefile
Currently LDFLAGS is not cleared, so same flags are accumulated in LDFLAGS when the top Makefile is recursively invoked. I found unneeded rebuild for ARCH=arm64 when CONFIG_TRIM_UNUSED_KSYMS is enabled. If include/generated/autoksyms.h is updated, the top Makefile is recursively invoked, then arch/arm64/Makefile adds one more '-maarch64linux'. Due to the command line change, modules are rebuilt needlessly. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Acked-by: Nicolas Pitre <nico@linaro.org>
1 parent bd0f98e commit ce99d0b

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎Makefile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,7 @@ KBUILD_CFLAGS_KERNEL :=
435435
KBUILD_AFLAGS_MODULE := -DMODULE
436436
KBUILD_CFLAGS_MODULE := -DMODULE
437437
KBUILD_LDFLAGS_MODULE := -T $(srctree)/scripts/module-common.lds
438+
LDFLAGS :=
438439
GCC_PLUGINS_CFLAGS :=
439440

440441
export ARCH SRCARCH CONFIG_SHELL HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC

0 commit comments

Comments
 (0)