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