linux-kbuild.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] kbuild: get lib-y objects back to static library
@ 2023-08-23 12:08 Masahiro Yamada
  2023-08-23 20:20 ` Nathan Chancellor
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Masahiro Yamada @ 2023-08-23 12:08 UTC (permalink / raw)
  To: linux-kbuild
  Cc: linux-kernel, Masahiro Yamada, Nathan Chancellor,
	Nick Desaulniers, Nicolas Schier

Revert the following two commits:

 - 7273ad2b08f8 ("kbuild: link lib-y objects to vmlinux forcibly when CONFIG_MODULES=y")
 - 7f2084fa55e6 ("[kbuild] handle exports in lib-y objects reliably")

Now, lib-y is back to static library again, and the link order is
consistent w/wo CONFIG_MODULES.

Since commit ddb5cdbafaaa ("kbuild: generate KSYMTAB entries by
modpost"), .vmlinux.export.c contains references to exported symbols.
If a symbol in a lib-y object is exported, that object is always linked
even without any explicit user in vmlinux.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 Makefile | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/Makefile b/Makefile
index 87a9eef3fb4b..71e9c65d9eae 100644
--- a/Makefile
+++ b/Makefile
@@ -1113,12 +1113,7 @@ export ARCH_DRIVERS	:= $(drivers-y) $(drivers-m)
 # Externally visible symbols (used by link-vmlinux.sh)
 
 KBUILD_VMLINUX_OBJS := ./built-in.a
-ifdef CONFIG_MODULES
-KBUILD_VMLINUX_OBJS += $(patsubst %/, %/lib.a, $(filter %/, $(libs-y)))
-KBUILD_VMLINUX_LIBS := $(filter-out %/, $(libs-y))
-else
 KBUILD_VMLINUX_LIBS := $(patsubst %/,%/lib.a, $(libs-y))
-endif
 
 export KBUILD_VMLINUX_LIBS
 export KBUILD_LDS          := arch/$(SRCARCH)/kernel/vmlinux.lds
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-08-26  2:38 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-23 12:08 [PATCH] kbuild: get lib-y objects back to static library Masahiro Yamada
2023-08-23 20:20 ` Nathan Chancellor
2023-08-24 18:59   ` Nathan Chancellor
2023-08-25 16:58     ` Nick Desaulniers
2023-08-26  0:06       ` Masahiro Yamada
2023-08-26  0:55         ` Nick Desaulniers
2023-08-24  1:44 ` Masahiro Yamada
2023-08-26  2:37 ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).