summaryrefslogtreecommitdiffstats
path: root/lib/libstand/Makefile
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2002-07-20 04:18:20 +0000
committerpeter <peter@FreeBSD.org>2002-07-20 04:18:20 +0000
commitc7181950f3493ca9216d41ff1f5bf0e783f55f2e (patch)
tree95f9d7512ae7144422a04c5de32a3fa7f9db0f88 /lib/libstand/Makefile
parent7409589c7afc48621815fb92ece4a2ad2fe9cd75 (diff)
downloadFreeBSD-src-c7181950f3493ca9216d41ff1f5bf0e783f55f2e.zip
FreeBSD-src-c7181950f3493ca9216d41ff1f5bf0e783f55f2e.tar.gz
Reimplement malloc/free debugging that includes the offending file:line
info. This turned out to be rather useful on ia64 for tracking down malloc/free problems. Detect duplicate free()'s - otherwise these show up as a guard1 failure and it looks like corruption instead of something simple like a second free() where there shouldn't be. Deal with libz using libc headers and not seeing the malloc/free stuff that we provide in libstand. Do similar nastiness to what is done for bzlib. Tested on: i386, ia64 (compile, run)
Diffstat (limited to 'lib/libstand/Makefile')
-rw-r--r--lib/libstand/Makefile24
1 files changed, 19 insertions, 5 deletions
diff --git a/lib/libstand/Makefile b/lib/libstand/Makefile
index 38c0312..e0e6a98 100644
--- a/lib/libstand/Makefile
+++ b/lib/libstand/Makefile
@@ -12,7 +12,8 @@ NOPIC= YES
INCS= stand.h
MAN= libstand.3
-CFLAGS+= -ffreestanding
+CFLAGS+= -ffreestanding -Wformat
+CFLAGS+= -I${.CURDIR}
.if ${MACHINE_ARCH} == "alpha"
CFLAGS+= -mno-fp-regs
@@ -25,7 +26,7 @@ CFLAGS+= -msoft-float
.endif
# standalone components and stuff we have modified locally
-SRCS+= __main.c assert.c bcd.c bswap.c environment.c getopt.c gets.c \
+SRCS+= zutil.h __main.c assert.c bcd.c bswap.c environment.c getopt.c gets.c \
globals.c pager.c printf.c strdup.c strerror.c strtol.c random.c \
sbrk.c twiddle.c zalloc.c zalloc_malloc.c
@@ -132,9 +133,22 @@ _${file}: ${file}
# decompression functionality from libz
.PATH: ${.CURDIR}/../libz
-CFLAGS+=-DHAVE_MEMCPY
-SRCS+= adler32.c crc32.c infblock.c infcodes.c inffast.c inflate.c \
- inftrees.c infutil.c zutil.c
+CFLAGS+=-DHAVE_MEMCPY -I${.CURDIR}/../libz
+SRCS+= adler32.c crc32.c _infblock.c _infcodes.c _inffast.c _inflate.c \
+ _inftrees.c _infutil.c _zutil.c _zutil.h
+
+# aargh
+.for file in zutil.h
+CLEANFILES+= _${file} _${file}.orig
+
+_${file}: ${file} ${file}.diff
+ patch -s -b .orig -o ${.TARGET} < ${.ALLSRC:M*.diff} ${.ALLSRC:M*.[ch]}
+.endfor
+
+.for file in infblock.c infcodes.c inffast.c inflate.c inftrees.c infutil.c zutil.c
+_${file}: ${file}
+ sed "s|zutil\.h|_zutil.h|" ${.ALLSRC} > ${.TARGET}
+.endfor
# io routines
SRCS+= closeall.c dev.c ioctl.c nullfs.c stat.c \
OpenPOWER on IntegriCloud