File netpbm-asan.patch of Package netpbm.11270

Index: netpbm-10.86.3/GNUmakefile
===================================================================
--- netpbm-10.86.3.orig/GNUmakefile	2019-05-14 09:16:35.984991072 +0200
+++ netpbm-10.86.3/GNUmakefile	2019-05-16 09:42:17.843531751 +0200
@@ -378,7 +378,7 @@ endif
 netpbm:%:%.o $(OBJECT_DEP) $(NETPBMLIB) $(URTLIBDEP) $(LIBOPT)
 # Note that LDFLAGS might contain -L options, so order is important.
 	$(LD) -o $@ $< $(OBJECT_LIST) \
-          $(LDFLAGS) $(shell $(LIBOPT) $(NETPBMLIB) $(MERGELIBS)) \
+          $(LDFLAGS) -lasan $(shell $(LIBOPT) $(NETPBMLIB) $(MERGELIBS)) \
 	  $(PNGLD) $(XML2LD) $(X11LD) $(MATHLIB) $(NETWORKLD) $(LADD)
 
 netpbm.o: mergetrylist
Index: netpbm-10.86.3/buildtools/Makefile
===================================================================
--- netpbm-10.86.3.orig/buildtools/Makefile	2019-05-14 09:16:32.160972760 +0200
+++ netpbm-10.86.3/buildtools/Makefile	2019-05-16 09:42:13.255509230 +0200
@@ -41,10 +41,10 @@ genfontc.o:%.o:%.c importinc
 	  $(NETPBM_INCLUDES) \
 	  $<
 genfontc:%:%.o $(NETPBMLIB)
-	$(LD_FOR_BUILD) -o $@ $(LDFLAGS_FOR_BUILD)  $< $(NETPBMLIB)
+	$(LD_FOR_BUILD) -o $@ $(LDFLAGS_FOR_BUILD)  $< $(NETPBMLIB) -lasan
 
 $(BUILDPROGS):%:%.o
-	$(LD_FOR_BUILD) -o $@ $(LDFLAGS_FOR_BUILD) $<
+	$(LD_FOR_BUILD) -o $@ $(LDFLAGS_FOR_BUILD) $< -lasan
 
 distclean clean: cleanlocal
 .PHONY: cleanlocal
Index: netpbm-10.86.3/common.mk
===================================================================
--- netpbm-10.86.3.orig/common.mk	2019-05-14 09:16:32.156972741 +0200
+++ netpbm-10.86.3/common.mk	2019-05-16 09:42:26.703575262 +0200
@@ -386,7 +386,7 @@ LDFLAGS_ALL = $(WINICON_OBJECT) \
 
 $(PORTBINARIES) $(MATHBINARIES): %: %.o \
   $(NETPBMLIB) $(LIBOPT) $(WINICON_OBJECT)
-	$(LD) -o $@$(EXE) $@.o $(ADDL_OBJECTS) $(LDFLAGS_ALL)
+	$(LD) -o $@$(EXE) $@.o $(ADDL_OBJECTS) -lasan $(LDFLAGS_ALL)
 
 
 # MERGE STUFF
Index: netpbm-10.86.3/lib/Makefile
===================================================================
--- netpbm-10.86.3.orig/lib/Makefile	2019-05-14 09:16:32.832975977 +0200
+++ netpbm-10.86.3/lib/Makefile	2019-05-16 09:42:22.159552950 +0200
@@ -115,7 +115,7 @@ $(SONAME): \
           -lc \
 	  -soname libnetpbm.$(NETPBMLIBSUFFIX) \
 	  -set_version $(shell perl -e '$(PERLPROG)') \
-	  $(LADD)
+	  -lasan $(LADD)
 endif
 
 ifeq ($(NETPBMLIBTYPE),unixshared)
@@ -131,7 +131,7 @@ $(SONAME): libnetpbm.$(NETPBMLIBSUFFIX).
 	$(SYMLINK) $< $@
 libnetpbm.$(NETPBMLIBSUFFIX).$(MAJ).$(MIN): $(LIBOBJECTS) $(LIBOBJECTS_X)
 	$(LD) $(LDSHLIB) -o $@ $(LIBOBJECTS) $(LIBOBJECTS_X) \
-          $(SHLIB_CLIB) -lm $(LADD)
+          $(SHLIB_CLIB) -lm -lasan $(LADD)
 endif
 
 ifeq ($(NETPBMLIBTYPE),dll)
@@ -144,7 +144,7 @@ endif
             -Wl,-soname,$(NETPBMSHLIBPREFIX)netpbm$(DLLVER).dll \
 	    -Wl,--output-def,$(NETPBMSHLIBPREFIX)netpbm$(DLLVER).def \
             -Wl,--out-implib,libnetpbm.dll.a -o $@ $(LDFLAGS) \
-            $(LIBOBJECTS) $(LIBOBJECTS_X) $(LDLIBS) $(LADD) 
+            $(LIBOBJECTS) $(LIBOBJECTS_X) $(LDLIBS) -lasan $(LADD) 
 endif
 
 ifeq ($(NETPBMLIBTYPE),dylib)
@@ -158,7 +158,7 @@ libnetpbm.$(MAJ).dylib: libnetpbm.$(MAJ)
 
 libnetpbm.$(MAJ).$(MIN).dylib: $(LIBOBJECTS) $(LIBOBJECTS_X) 
 	$(LD) $(LDSHLIB) -o $@ $(LIBOBJECTS) $(LIBOBJECTS_X) \
-           -lc $(LADD)
+           -lc -lasan $(LADD)
 endif
 
 #--------------------------------------------------------------------------