From 1b6272894f2dfc25374add1dcfa37efc88384ff8 Mon Sep 17 00:00:00 2001 From: "Ricardo B. Marliere" Date: Thu, 12 Oct 2023 07:54:21 -0300 Subject: docs: kbuild: add INSTALL_DTBS_PATH The documentation for kbuild and makefiles is missing an explanation of a variable important for some architectures. Signed-off-by: Ricardo B. Marliere Signed-off-by: Masahiro Yamada --- Documentation/kbuild/kbuild.rst | 6 ++++++ Documentation/kbuild/makefiles.rst | 7 +++++++ 2 files changed, 13 insertions(+) (limited to 'Documentation/kbuild') diff --git a/Documentation/kbuild/kbuild.rst b/Documentation/kbuild/kbuild.rst index bd906407e307..9c8d1d046ea5 100644 --- a/Documentation/kbuild/kbuild.rst +++ b/Documentation/kbuild/kbuild.rst @@ -243,6 +243,12 @@ The output directory is often set using "O=..." on the commandline. The value can be overridden in which case the default value is ignored. +INSTALL_DTBS_PATH +----------------- +INSTALL_DTBS_PATH specifies where to install device tree blobs for +relocations required by build roots. This is not defined in the +makefile but the argument can be passed to make if needed. + KBUILD_ABS_SRCTREE -------------------------------------------------- Kbuild uses a relative path to point to the tree when possible. For instance, diff --git a/Documentation/kbuild/makefiles.rst b/Documentation/kbuild/makefiles.rst index e67eb261c9b0..d88d4f0f4f89 100644 --- a/Documentation/kbuild/makefiles.rst +++ b/Documentation/kbuild/makefiles.rst @@ -1623,6 +1623,13 @@ INSTALL_MOD_STRIP INSTALL_MOD_STRIP value will be used as the option(s) to the strip command. +INSTALL_DTBS_PATH + This variable specifies a prefix for relocations required by build + roots. It defines a place for installing the device tree blobs. Like + INSTALL_MOD_PATH, it isn't defined in the Makefile, but can be passed + by the user if desired. Otherwise it defaults to the kernel install + path. + Makefile language ================= -- cgit v1.2.3 From 5f56cb030e4bcf14be2233332d5cd83fff62a376 Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Wed, 1 Nov 2023 03:11:57 +0900 Subject: kbuild: support 'userldlibs' syntax This syntax is useful to specify libraries linked to all userspace programs in the Makefile. Signed-off-by: Masahiro Yamada --- Documentation/kbuild/makefiles.rst | 4 ++++ scripts/Makefile.userprogs | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'Documentation/kbuild') diff --git a/Documentation/kbuild/makefiles.rst b/Documentation/kbuild/makefiles.rst index d88d4f0f4f89..e9299971220a 100644 --- a/Documentation/kbuild/makefiles.rst +++ b/Documentation/kbuild/makefiles.rst @@ -937,6 +937,10 @@ Example:: # net/bpfilter/Makefile bpfilter_umh-userldflags += -static +To specify libraries linked to a userspace program, you can use +``-userldlibs``. The ``userldlibs`` syntax specifies libraries +linked to all userspace programs created in the current Makefile. + When linking bpfilter_umh, it will be passed the extra option -static. From command line, :ref:`USERCFLAGS and USERLDFLAGS ` will also be used. diff --git a/scripts/Makefile.userprogs b/scripts/Makefile.userprogs index fb415297337a..f3a7e1ef3753 100644 --- a/scripts/Makefile.userprogs +++ b/scripts/Makefile.userprogs @@ -19,19 +19,19 @@ user-cobjs := $(addprefix $(obj)/, $(user-cobjs)) user_ccflags = -Wp,-MMD,$(depfile) $(KBUILD_USERCFLAGS) $(userccflags) \ $($(target-stem)-userccflags) user_ldflags = $(KBUILD_USERLDFLAGS) $(userldflags) $($(target-stem)-userldflags) +user_ldlibs = $(userldlibs) $($(target-stem)-userldlibs) # Create an executable from a single .c file quiet_cmd_user_cc_c = CC [U] $@ cmd_user_cc_c = $(CC) $(user_ccflags) $(user_ldflags) -o $@ $< \ - $($(target-stem)-userldlibs) + $(user_ldlibs) $(user-csingle): $(obj)/%: $(src)/%.c FORCE $(call if_changed_dep,user_cc_c) # Link an executable based on list of .o files quiet_cmd_user_ld = LD [U] $@ cmd_user_ld = $(CC) $(user_ldflags) -o $@ \ - $(addprefix $(obj)/, $($(target-stem)-objs)) \ - $($(target-stem)-userldlibs) + $(addprefix $(obj)/, $($(target-stem)-objs)) $(user_ldlibs) $(user-cmulti): FORCE $(call if_changed,user_ld) $(call multi_depend, $(user-cmulti), , -objs) -- cgit v1.2.3