Skip to content

Commit

Permalink
sdk: use bundle-libraries.sh to ship kernel objtool tools
Browse files Browse the repository at this point in the history
Ensure that the kernel objtool utilities are processed by the library
bundler in order to ensure that they're usable on foreign systems with
different libc versions.

Fixes: a9f6fce ("sdk: fix building external modules when CONFIG_STACK_VALIDATION=y")
Acked-by: Yousong Zhou <yszhou4tech@gmail.com>
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
  • Loading branch information
jow- committed Sep 3, 2019
1 parent fe43969 commit efaaadb
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions target/sdk/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ KERNEL_FILES_BASE := \
.config \
Makefile \
scripts \
tools/objtool \
include \
Module.symvers \
modules.builtin \
Expand All @@ -95,16 +96,9 @@ $(BIN_DIR)/$(SDK_NAME).tar.xz: clean
$(TAR) -cf - -C $(TOPDIR) $(KDIR_BASE)/tools/usb/usbip/ | \
$(TAR) -xf - -C $(SDK_BUILD_DIR)

# Copy objtool executables. They are required for building external
# modules if "Compile-time stack metadata validation" is enabled.
if grep -q '^CONFIG_STACK_VALIDATION=y' $(LINUX_DIR)/.config; then \
$(TAR) -cf - -C $(TOPDIR) \
`cd $(TOPDIR); find $(KDIR_BASE)/tools/objtool -type f -executable` | \
$(TAR) -xf - -C $(SDK_BUILD_DIR); \
fi

(cd $(SDK_BUILD_DIR); find $(STAGING_SUBDIR_HOST)/bin $(STAGING_SUBDIR_HOST)/usr/bin \
$(STAGING_SUBDIR_TOOLCHAIN)/bin $(STAGING_SUBDIR_TOOLCHAIN)/*/bin $(STAGING_SUBDIR_TOOLCHAIN)/libexec \
$(KDIR_BASE) \
-type f | $(XARGS) $(SCRIPT_DIR)/bundle-libraries.sh $(SDK_BUILD_DIR)/$(STAGING_SUBDIR_HOST))

@-( \
Expand Down

0 comments on commit efaaadb

Please sign in to comment.