Subject: xsrc/24783: Build in src/x11 makes mkfontscale and fc-cache dump core
To: None <gnats-bugs@gnats.netbsd.org>
From: None <kristerw@netbsd.org>
List: netbsd-bugs
Date: 03/15/2004 00:31:13
>Number:         24783
>Category:       xsrc
>Synopsis:       Build in src/x11 makes mkfontscale and fc-cache dump core
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    xsrc-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Mar 15 00:32:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     Krister Walfridsson
>Release:        NetBSD 1.6.2
>Organization:
	
>Environment:
	
	
NetBSD pc2 1.6.2 NetBSD 1.6.2 (GENERIC) #0: Tue Feb 10 21:53:10 UTC 2004     autobuild@tgm.netbsd.org:/autobuild/netbsd-1-6-PATCH002/i386/OBJ/autobuild/netbsd-1-6-PATCH002/src/sys/arch/i386/compile/GENERIC i386
Architecture: i386
Machine: i386
>Description:
Building X11 using "build.sh -x" on NetBSD/i386 1.6.2 fails due to
mkfontscale dumping core (and if you hack around this, you
fail at a later point from fc-cache dumping core).

The error goes away if you compile ftgzip.c without optimization.
I have not analyzed what goes wrong (because ftgzip.c is a nasty
file that includes a modified version of the libz source code...)
But it is possible to compile this file so that it uses the normal
libz instead, in which case the result seems to work without
problems.

Note that mkfontscale already links with libz, so this built-in
libz code is unnecessary bloat anyway.

>How-To-Repeat:
./build.sh -u -U -x -m i386 release
>Fix:
Index: mkfontscale/Makefile
===================================================================
RCS file: /cvsroot/src/x11/tools/mkfontscale/Makefile,v
retrieving revision 1.1
diff -u -r1.1 Makefile
--- mkfontscale/Makefile        6 Mar 2004 02:55:20 -0000       1.1
+++ mkfontscale/Makefile        15 Mar 2004 00:20:39 -0000
@@ -56,6 +56,8 @@
 
 SRCS=  ${SRCS.mkfontscale} ${SRCS.freetype} ${SRCS.fontenc}
 
+HOST_CPPFLAGS+=        -DFT_CONFIG_OPTION_SYSTEM_ZLIB
+
 LDADD= -lz
 DPADD= ${LIBZ}
 
Index: fc-cache/Makefile
===================================================================
RCS file: /cvsroot/src/x11/tools/fc-cache/Makefile,v
retrieving revision 1.5
diff -u -r1.5 Makefile
--- fc-cache/Makefile   6 Mar 2004 02:55:20 -0000       1.5
+++ fc-cache/Makefile   15 Mar 2004 00:20:40 -0000
@@ -57,5 +57,10 @@
 # resource fork font support which needs the carbon libraries.
 HOST_CPPFLAGS+=        -DDARWIN_NO_CARBON
 
+HOST_CPPFLAGS+=        -DFT_CONFIG_OPTION_SYSTEM_ZLIB
+
+LDADD= -lz
+DPADD= ${LIBZ}
+
 .include <bsd.x11.mk>
 .include <bsd.hostprog.mk>

>Release-Note:
>Audit-Trail:
>Unformatted: