077c9d
commit f9b645b4b0a10c43753296ce3fa40053fa44606a
077c9d
Author: Mike Frysinger <vapier@gentoo.org>
077c9d
Date:   Wed Apr 24 13:32:22 2019 +0200
077c9d
077c9d
    memusagestat: use local glibc when linking [BZ #18465]
077c9d
    
077c9d
    The memusagestat is the only binary that has its own link line which
077c9d
    causes it to be linked against the existing installed C library.  It
077c9d
    has been this way since it was originally committed in 1999, but I
077c9d
    don't see any reason as to why.  Since we want all the programs we
077c9d
    build locally to be against the new copy of glibc, change the build
077c9d
    to be like all other programs.
077c9d
077c9d
diff --git a/malloc/Makefile b/malloc/Makefile
077c9d
index 388cf7e9ee3a2569..228a1279a5960d8c 100644
077c9d
--- a/malloc/Makefile
077c9d
+++ b/malloc/Makefile
077c9d
@@ -131,6 +131,7 @@ ifneq ($(cross-compiling),yes)
077c9d
 # If the gd library is available we build the `memusagestat' program.
077c9d
 ifneq ($(LIBGD),no)
077c9d
 others: $(objpfx)memusage
077c9d
+others += memusagestat
077c9d
 install-bin = memusagestat
077c9d
 install-bin-script += memusage
077c9d
 generated += memusagestat memusage
077c9d
@@ -154,8 +155,7 @@ cpp-srcs-left := $(memusagestat-modules)
077c9d
 lib := memusagestat
077c9d
 include $(patsubst %,$(..)libof-iterator.mk,$(cpp-srcs-left))
077c9d
 
077c9d
-$(objpfx)memusagestat: $(memusagestat-modules:%=$(objpfx)%.o)
077c9d
-	$(LINK.o) -o $@ $^ $(libgd-LDFLAGS) -lgd -lpng -lz -lm
077c9d
+LDLIBS-memusagestat = $(libgd-LDFLAGS) -lgd -lpng -lz -lm
077c9d
 
077c9d
 ifeq ($(run-built-tests),yes)
077c9d
 ifeq (yes,$(build-shared))