···937937 # net/bpfilter/Makefile938938 bpfilter_umh-userldflags += -static939939940940+To specify libraries linked to a userspace program, you can use941941+``<executable>-userldlibs``. The ``userldlibs`` syntax specifies libraries942942+linked to all userspace programs created in the current Makefile.943943+940944When linking bpfilter_umh, it will be passed the extra option -static.941945942946From command line, :ref:`USERCFLAGS and USERLDFLAGS <userkbuildflags>` will also be used.
+3-3
scripts/Makefile.userprogs
···1919user_ccflags = -Wp,-MMD,$(depfile) $(KBUILD_USERCFLAGS) $(userccflags) \2020 $($(target-stem)-userccflags)2121user_ldflags = $(KBUILD_USERLDFLAGS) $(userldflags) $($(target-stem)-userldflags)2222+user_ldlibs = $(userldlibs) $($(target-stem)-userldlibs)22232324# Create an executable from a single .c file2425quiet_cmd_user_cc_c = CC [U] $@2526 cmd_user_cc_c = $(CC) $(user_ccflags) $(user_ldflags) -o $@ $< \2626- $($(target-stem)-userldlibs)2727+ $(user_ldlibs)2728$(user-csingle): $(obj)/%: $(src)/%.c FORCE2829 $(call if_changed_dep,user_cc_c)29303031# Link an executable based on list of .o files3132quiet_cmd_user_ld = LD [U] $@3233 cmd_user_ld = $(CC) $(user_ldflags) -o $@ \3333- $(addprefix $(obj)/, $($(target-stem)-objs)) \3434- $($(target-stem)-userldlibs)3434+ $(addprefix $(obj)/, $($(target-stem)-objs)) $(user_ldlibs)3535$(user-cmulti): FORCE3636 $(call if_changed,user_ld)3737$(call multi_depend, $(user-cmulti), , -objs)