[PATCH] X-TT module was broken on CVS
>> Subject: xfree86-4 crash: cannot load module xtt
>> From: Takashi Ogihara <ogitak@syd.odn.ne.jp>
>> To: <submit@bugs.debian.org> Message-ID: <B6489CA3.24D%ogitak@syd.odn.ne.jp> Mime-version: 1.0
>>
>> Package: xserver-xfree86
>> Version: 4.0.1-8
>>
>> when I started X with module "xtt", xserver crashes.
>>
>> following are console messages:
>>
>> Symbol TT_Realloc from module /usr/X11R6/lib/modules/fonts/libxtt.a is
>> unresolved!
>> Symbol TT_Register_Extention from module
>> /usr/X11R6/lib/modules/fonts/libxtt.a is unresolved!
>> Symbol Extention_Get from module /usr/X11R6/lib/modules/fonts/libxtt.a is
>> unresolved!
This is an upstream bug.
X-TrueType refereed ft_config.h in xc/lib/font/FreeType.
ft_config.h is used for FreeType library (not freetype engine of
libfont) setting.
Both X-TT and freefype engine used same setting previously, but
when freetype was updated to 1.1.8, freetype engine would not use some
functions included in FreeType library, so changed to undefine
TT_CONFIG_OPTION_EXTEND_ENGINE in ft_config.h.
But these functions are still needed for X-TT, so when compile
X-TrueType engine, we need to define TT_CONFIG_OPTION_EXTEND_ENGINE.
I've tried to add -DTT_CONFIG_OPTION_EXTEND_ENGINE in
xc/lib/font/X_TrueType/Imakefile and
xc/lib/font/X_TrueType/modules/Imakefile simply. But this solution
did not work. Because when `#include "ft_config.h"' this file
includes "#undef TT_CONFIG_OPTION_EXTEND_ENGINE" line, so
TT_CONFIG_OPTION_EXTEND_ENGINE would be undefined in a source.
This is a patch to fix this problem.
1) Add newfile xc/lib/font/X-TrueType/ft_config.h for X-TrueType
specific setting of FreeType library.
2) not to refer freetype engine's directory (xc/lib/font/FreeType).
diff -x Makefile -crN xc.orig/lib/font/X-TrueType/Imakefile xc/lib/font/X-TrueType/Imakefile
*** xc.orig/lib/font/X-TrueType/Imakefile Tue Nov 28 04:18:35 2000
--- xc/lib/font/X-TrueType/Imakefile Tue Nov 28 04:02:10 2000
***************
*** 11,17 ****
INCLUDES = -I. -I$(FONTINCSRC) -I../include -I../fontcache \
-I$(XTOP)/include -I$(SERVERSRC)/include \
-I$(FTSOURCEDIR)/lib -I$(FTSOURCEDIR)/lib/extend \
! -I$(FTSOURCEDIR)/lib/arch/unix -I$(FONTLIBSRC)/FreeType
DEFINES = -DTT_MAKE_OPTION_SINGLE_OBJECT=1 $(FONTMODULEDEF) \
$(XTT_DEBUG_FLAGS) $(XTT_CCONV_MOUDLE_DEFINES) \
--- 11,17 ----
INCLUDES = -I. -I$(FONTINCSRC) -I../include -I../fontcache \
-I$(XTOP)/include -I$(SERVERSRC)/include \
-I$(FTSOURCEDIR)/lib -I$(FTSOURCEDIR)/lib/extend \
! -I$(FTSOURCEDIR)/lib/arch/unix
DEFINES = -DTT_MAKE_OPTION_SINGLE_OBJECT=1 $(FONTMODULEDEF) \
$(XTT_DEBUG_FLAGS) $(XTT_CCONV_MOUDLE_DEFINES) \
diff -x Makefile -crN xc.orig/lib/font/X-TrueType/ft_conf.h xc/lib/font/X-TrueType/ft_conf.h
*** xc.orig/lib/font/X-TrueType/ft_conf.h Thu Jan 1 09:00:00 1970
--- xc/lib/font/X-TrueType/ft_conf.h Tue Nov 28 04:20:48 2000
***************
*** 0 ****
--- 1,185 ----
+ /* ft_conf.h. Xserver-specific version for X-TrueType. */
+
+ /* $XFree86: xc/lib/font/X-TreeType/ft_conf.h,v 1.0 2000/11/28 16:54:42 dawes Exp $ */
+
+ /* we need the following because there are some typedefs in this file */
+ #ifndef FT_CONF_H
+ #define FT_CONF_H
+
+ #include <X11/Xmd.h>
+ #include "servermd.h"
+ #include "fontmisc.h"
+ #include <X11/Xfuncproto.h>
+
+ #ifndef FONTMODULE
+
+ #include <X11/Xos.h>
+ #include <string.h>
+ #include <stdio.h>
+ #ifdef _XOPEN_SOURCE
+ #include <math.h>
+ #else
+ #define _XOPEN_SOURCE /* to get prototype for hypot on some systems */
+ #include <math.h>
+ #undef _XOPEN_SOURCE
+ #endif
+ /* Define if you have the <stdlib.h> header file. */
+ #ifndef X_NOT_STDC_ENV
+ #define HAVE_STDLIB_H 1
+ #endif
+
+ #else
+
+ #include "xf86_ansic.h"
+
+ #endif /* FONTMODULE */
+
+ /* Define to empty if the keyword does not work. */
+ #define const _Xconst /* defined in Xfuncproto.h */
+
+ /* Define if you have a working `mmap' system call. */
+ /* Defined in Makefile */
+ /* #undef HAVE_MMAP */
+
+ /* Define if your processor stores words with the most significant
+ byte first (like Motorola and SPARC, unlike Intel and VAX). */
+ /* defined in servermd.h */
+ #if(IMAGE_BYTE_ORDER==MSBFirst)
+ #define WORDS_BIGENDIAN 1
+ #else
+ #define WORDS_BIGENDIAN 0
+ #endif
+
+
+ /* Define if the X Window System is missing or not being used. */
+ /* Not relevant. */
+ /* #undef X_DISPLAY_MISSING */
+
+ /* Define if you have the getpagesize function. */
+ #ifdef HAVE_MMAP
+ #define HAVE_GETPAGESIZE 1
+ #endif
+
+ /* Define if you have the memcpy function. */
+ #define HAVE_MEMCPY 1 /* provided by Xos.h */
+
+ /* Define if you have the memmove function. */
+ #define HAVE_MEMMOVE 1 /* provided by Xos.h */
+
+ /* Define if you have the <fcntl.h> header file. */
+ #undef HAVE_FCNTL_H /* included by Xos.h if relevant*/
+
+ /* Define if you have the <unistd.h> header file. */
+ #undef HAVE_UNISTD_H /* included by Xos.h if relevant */
+
+ /* Define if you have the <locale.h> header file. */
+ /* Not relevant */
+ /* #undef HAVE_LOCALE_H */
+
+ /* Define if you have the <libintl.h> header file. */
+ /* Not relevant */
+ /* #undef HAVE_LIBINTL_H */
+
+ /* Define if you have the libintl library. */
+ /* Not relevant */
+ /* #undef HAVE_LIBINTL */
+
+ /**********************************************************************/
+ /* */
+ /* The following configuration macros can be tweaked manually by */
+ /* a developer to turn on or off certain features or options in the */
+ /* TrueType engine. This may be useful to tune it for specific */
+ /* purposes.. */
+ /* */
+ /**********************************************************************/
+
+ /*************************************************************************/
+ /* Define this if the underlying operating system uses a different */
+ /* character width than 8bit for file names. You must then also supply */
+ /* a typedef declaration for defining 'TT_Text'. Default is off. */
+
+ /* #undef HAVE_TT_TEXT */
+
+
+ /*************************************************************************/
+ /* Define this if you want to generate code to support engine extensions */
+ /* Default is on, but if you're satisfied by the basic services provided */
+ /* by the engine and need no extensions, undefine this configuration */
+ /* macro to save a few more bytes. */
+
+ #define TT_CONFIG_OPTION_EXTEND_ENGINE
+
+
+ /*************************************************************************/
+ /* Define this if you want to generate code to support gray-scaling, */
+ /* a.k.a. font-smoothing or anti-aliasing. Default is on, but you can */
+ /* disable it if you don't need it. */
+
+ #undef TT_CONFIG_OPTION_GRAY_SCALING
+
+ /*************************************************************************/
+ /* Define this if you want to use a big 'switch' statement within the */
+ /* bytecode interpreter. Because some non-optimizing compilers are not */
+ /* able to produce jump tables from such statements, undefining this */
+ /* configuration macro will generate the appropriate C jump table in */
+ /* ttinterp.c. If you use an optimizing compiler, you should leave it */
+ /* defined for better performance and code compactness.. */
+
+ #define TT_CONFIG_OPTION_INTERPRETER_SWITCH
+
+
+ /*************************************************************************/
+ /* Define TT_CONFIG_THREAD_SAFE if you want to build a thread-safe */
+ /* version of the library. */
+
+ /* #undef TT_CONFIG_OPTION_THREAD_SAFE */
+
+ /**********************************************************************/
+ /* */
+ /* The following macros are used to define the debug level, as well */
+ /* as individual tracing levels for each component. There are */
+ /* currently three modes of operation : */
+ /* */
+ /* - trace mode (define DEBUG_LEVEL_TRACE) */
+ /* */
+ /* The engine prints all error messages, as well as tracing */
+ /* ones, filtered by each component's level */
+ /* */
+ /* - debug mode (define DEBUG_LEVEL_ERROR) */
+ /* */
+ /* Disable tracing, but keeps error output and assertion */
+ /* checks. */
+ /* */
+ /* - release mode (don't define anything) */
+ /* */
+ /* Don't include error-checking or tracing code in the */
+ /* engine's code. Ideal for releases. */
+ /* */
+ /* NOTE : */
+ /* */
+ /* Each component's tracing level is defined in its own source. */
+ /* */
+ /**********************************************************************/
+
+ /* Define if you want to use the tracing debug mode */
+ /* #undef DEBUG_LEVEL_TRACE */
+
+ /* Define if you want to use the error debug mode - ignored if */
+ /* DEBUG_LEVEL_TRACE is defined */
+ /* #undef DEBUG_LEVEL_ERROR */
+
+ /**************************************************************************/
+ /* Definition of various integer sizes. These types are used by ttcalc */
+ /* and ttinterp (for the 64-bit integers) only.. */
+
+ /* Use X-specific configuration methods */
+
+ typedef INT32 TT_Int32;
+ typedef CARD32 TT_Word32;
+
+ #if defined(WORD64) || defined(_XSERVER64)
+ #define LONG64
+ #define INT64 long
+ #endif /* WORD64 */
+
+ #endif /* FT_CONF_H */
diff -x Makefile -crN xc.orig/lib/font/X-TrueType/module/Imakefile xc/lib/font/X-TrueType/module/Imakefile
*** xc.orig/lib/font/X-TrueType/module/Imakefile Tue Nov 28 04:18:35 2000
--- xc/lib/font/X-TrueType/module/Imakefile Tue Nov 28 04:01:40 2000
***************
*** 14,20 ****
INCLUDES = -I.. -I$(FONTINCSRC) -I../../include -I../../fontcache \
-I$(TOP)/include -I$(SERVERSRC)/include \
-I$(FTSOURCEDIR)/lib -I$(FTSOURCEDIR)/lib/extend \
! -I$(FTSOURCEDIR)/lib/arch/unix -I$(FONTLIBSRC)/FreeType
#if XTrueTypeDebugXTT
XTT_DEBUG_FLAGS = -DDUMP
--- 14,20 ----
INCLUDES = -I.. -I$(FONTINCSRC) -I../../include -I../../fontcache \
-I$(TOP)/include -I$(SERVERSRC)/include \
-I$(FTSOURCEDIR)/lib -I$(FTSOURCEDIR)/lib/extend \
! -I$(FTSOURCEDIR)/lib/arch/unix
#if XTrueTypeDebugXTT
XTT_DEBUG_FLAGS = -DDUMP
--
ISHIKAWA Mutsumi
<ishikawa@linux.or.jp>, <ishikawa@debian.org>, <ishikawa@redhat.com>
Reply to: