Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

objtool: Install libsubcmd in build

Including from tools/lib can create inadvertent dependencies. Install
libsubcmd in the objtool build and then include the headers from
there.

Signed-off-by: Ian Rogers <irogers@google.com>
Link: https://lore.kernel.org/r/20230126190606.40739-2-irogers@google.com
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>

authored by

Ian Rogers and committed by
Josh Poimboeuf
bdb8bf7d 03d7a105

+24 -10
+1
tools/objtool/.gitignore
··· 2 2 arch/x86/lib/inat-tables.c 3 3 /objtool 4 4 fixdep 5 + libsubcmd/
-2
tools/objtool/Build
··· 16 16 objtool-y += str_error_r.o 17 17 objtool-y += librbtree.o 18 18 19 - CFLAGS += -I$(srctree)/tools/lib 20 - 21 19 $(OUTPUT)libstring.o: ../lib/string.c FORCE 22 20 $(call rule_mkdir) 23 21 $(call if_changed_dep,cc_o_c)
+23 -8
tools/objtool/Makefile
··· 12 12 srctree := $(patsubst %/,%,$(dir $(srctree))) 13 13 endif 14 14 15 - SUBCMD_SRCDIR = $(srctree)/tools/lib/subcmd/ 16 - LIBSUBCMD_OUTPUT = $(or $(OUTPUT),$(CURDIR)/) 17 - LIBSUBCMD = $(LIBSUBCMD_OUTPUT)libsubcmd.a 15 + LIBSUBCMD_DIR = $(srctree)/tools/lib/subcmd/ 16 + ifneq ($(OUTPUT),) 17 + LIBSUBCMD_OUTPUT = $(abspath $(OUTPUT))/libsubcmd 18 + else 19 + LIBSUBCMD_OUTPUT = $(CURDIR)/libsubcmd 20 + endif 21 + LIBSUBCMD = $(LIBSUBCMD_OUTPUT)/libsubcmd.a 18 22 19 23 OBJTOOL := $(OUTPUT)objtool 20 24 OBJTOOL_IN := $(OBJTOOL)-in.o ··· 32 28 -I$(srctree)/tools/arch/$(HOSTARCH)/include/uapi \ 33 29 -I$(srctree)/tools/arch/$(SRCARCH)/include \ 34 30 -I$(srctree)/tools/objtool/include \ 35 - -I$(srctree)/tools/objtool/arch/$(SRCARCH)/include 31 + -I$(srctree)/tools/objtool/arch/$(SRCARCH)/include \ 32 + -I$(LIBSUBCMD_OUTPUT)/include 36 33 WARNINGS := $(EXTRA_WARNINGS) -Wno-switch-default -Wno-switch-enum -Wno-packed -Wno-nested-externs 37 34 CFLAGS := -Werror $(WARNINGS) $(KBUILD_HOSTCFLAGS) -g $(INCLUDES) $(LIBELF_FLAGS) 38 35 LDFLAGS += $(LIBELF_LIBS) $(LIBSUBCMD) $(KBUILD_HOSTLDFLAGS) ··· 43 38 CFLAGS += $(if $(elfshdr),,-DLIBELF_USE_DEPRECATED) 44 39 45 40 AWK = awk 41 + MKDIR = mkdir 46 42 47 43 BUILD_ORC := n 48 44 ··· 63 57 $(QUIET_LINK)$(CC) $(OBJTOOL_IN) $(LDFLAGS) -o $@ 64 58 65 59 66 - $(LIBSUBCMD): fixdep FORCE 67 - $(Q)$(MAKE) -C $(SUBCMD_SRCDIR) OUTPUT=$(LIBSUBCMD_OUTPUT) 60 + $(LIBSUBCMD_OUTPUT): 61 + @$(MKDIR) -p $@ 68 62 69 - clean: 63 + $(LIBSUBCMD): fixdep $(LIBSUBCMD_OUTPUT) FORCE 64 + @$(MAKE) -C $(LIBSUBCMD_DIR) O=$(LIBSUBCMD_OUTPUT) \ 65 + DESTDIR=$(LIBSUBCMD_OUTPUT) prefix= subdir= \ 66 + $@ install_headers 67 + 68 + $(LIBSUBCMD)-clean: 69 + $(call QUIET_CLEAN, libsubcmd) 70 + $(Q)$(RM) -r -- $(LIBSUBCMD_OUTPUT) 71 + 72 + clean: $(LIBSUBCMD)-clean 70 73 $(call QUIET_CLEAN, objtool) $(RM) $(OBJTOOL) 71 74 $(Q)find $(OUTPUT) -name '*.o' -delete -o -name '\.*.cmd' -delete -o -name '\.*.d' -delete 72 - $(Q)$(RM) $(OUTPUT)arch/x86/lib/inat-tables.c $(OUTPUT)fixdep $(LIBSUBCMD) 75 + $(Q)$(RM) $(OUTPUT)arch/x86/lib/inat-tables.c $(OUTPUT)fixdep 73 76 74 77 FORCE: 75 78