Skip to content

Commit

Permalink
tools/elfutils: only build required components
Browse files Browse the repository at this point in the history
Building all of the components results in strip being installed in
staging_dir/host/bin. This strip binary will take precedence over
binutils strip that is installed in the toolchain directory.

This will not work on host systems that do not have libdw installed, as
we do not set HOST_LDFLAGS to override rpath to staging_dir/host/lib.
However, rather than overriding rpath, we should just avoid using
elfutils strip entirely.

Override the SUBDIRS variable in the Makefile to only build and install
the libraries we require for dwarves and frr.

Fixes the following build failure in toolchain/gdb:
strip: error while loading shared libraries: libdw.so.1: cannot open shared object file: No such file or directory

Fixes: ad79b92 ("elfutils: move host build to tools")
Reported-by: Dominick Grift <dominick.grift@defensec.nl>
Reported-by: Lucian Cristian <lucian.cristian@gmail.com>
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
  • Loading branch information
stintel committed May 18, 2022
1 parent 16e9ccd commit f64bd4b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tools/elfutils/Makefile
Expand Up @@ -29,4 +29,7 @@ HOST_CONFIGURE_ARGS += \
--without-lzma \
--without-zstd

HOST_MAKE_FLAGS += \
SUBDIRS="lib libelf libcpu backends libebl libdwelf libdwfl libdw"

$(eval $(call HostBuild))

0 comments on commit f64bd4b

Please sign in to comment.