diff --git a/tools/elfutils/Makefile b/tools/elfutils/Makefile index b66d064e2bd..39e7f80b4ad 100644 --- a/tools/elfutils/Makefile +++ b/tools/elfutils/Makefile @@ -53,8 +53,14 @@ PKG_GNULIB_MODS = \ include $(INCLUDE_DIR)/host-build.mk +export $(PKG_GNULIB_BASE)=$(HOST_BUILD_DIR)/$(PKG_GNULIB_BASE)/$(PKG_GNULIB_BASE).la +export $(PKG_GNULIB_BASE)_tsearch=$(HOST_BUILD_DIR)/$(PKG_GNULIB_BASE)/$(PKG_GNULIB_BASE)_la-tsearch.lo + HOST_MAKE_FLAGS += \ AM_LDFLAGS='$$$$(STACK_USAGE_NO_ERROR)' \ + LIBS+='$$$$(if $$$$(findstring $(lastword $(PKG_SUBDIRS)),$$$$(subdir)), $$$$($(PKG_GNULIB_BASE)))' \ + LIBS+='$$$$(wildcard $$$$($(PKG_GNULIB_BASE)_tsearch))' \ + REPLACE_FCNTL=0 REPLACE_FREE=0 REPLACE_FSTAT=0 REPLACE_OPEN=0 \ bin_PROGRAMS='$(PKG_PROGRAMS)' EXEEXT= ifeq ($(HOST_OS),Darwin) diff --git a/tools/elfutils/patches/100-portability.patch b/tools/elfutils/patches/100-portability.patch index 980b117f219..09ee8daf1f3 100644 --- a/tools/elfutils/patches/100-portability.patch +++ b/tools/elfutils/patches/100-portability.patch @@ -198,7 +198,7 @@ pkginclude_HEADERS = elf-knowledge.h -libelf_a_SOURCES = elf_version.c elf_hash.c elf_error.c elf_fill.c \ -+libelf_la_LIBADD = ../libgnu/libgnu.la ../lib/libeu.la -lz $(zstd_LIBS) -lpthread ++libelf_la_LIBADD = ../lib/libeu.la -lz $(zstd_LIBS) -lpthread +libelf_la_SOURCES = elf_version.c elf_hash.c elf_error.c \ elf_begin.c elf_next.c elf_rand.c elf_end.c elf_kind.c \ gelf_getclass.c elf_getbase.c elf_getident.c \