History

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.

Masahiro Yamada committed 8 years ago

Commit ce99d0b1 parent bd0f98e1 file · +1 −0Browse files

Unified · Split

Makefile+1−0
@@ -435,6 +435,7 @@ KBUILD_CFLAGS_KERNEL := · 434 unmodified lines
435KBUILD_AFLAGS_MODULE := -DMODULE435KBUILD_AFLAGS_MODULE := -DMODULE
436KBUILD_CFLAGS_MODULE := -DMODULE436KBUILD_CFLAGS_MODULE := -DMODULE
437KBUILD_LDFLAGS_MODULE := -T $(srctree)/scripts/module-common.lds437KBUILD_LDFLAGS_MODULE := -T $(srctree)/scripts/module-common.lds
438LDFLAGS :=
438GCC_PLUGINS_CFLAGS :=439GCC_PLUGINS_CFLAGS :=
439 440
440export ARCH SRCARCH CONFIG_SHELL HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC441export ARCH SRCARCH CONFIG_SHELL HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC