Sleepycatのホームページにあるdb.1.85用のパッチのうち
2. Problem: DB 1.85 core dumps on certain data sets when using the B+tree access method.以上3つのパッチを適用しておくことは、今更言うまでもないことであるが、更にSolaris8でコンパイルエラーになる問題と、最適化を施すために、以下の修正を行う。 ◎Solaris8でint(8|16|32)_t が二重定義エラーでコンパイルエラーになる部分の修正
4. Problem: DB 1.85 core dumps on certain data sets when using the B+tree access method. (Patch #2 MUST be applied before this patch.)
5. Problem: The metadata page for DB 1.85 B+tree databases is not correctly maintained in some circumstances.
Apply the following patch to the db-1.85/include/db.h file◎gccでmakeできない問題と最適化を施したMakefile*** include/db.h.orig Wed Jun 22 04:59:28 1994 --- include/db.h Mon Jul 29 09:23:09 2002 *************** *** 51,61 **** #ifndef __BIT_TYPES_DEFINED__ #define __BIT_TYPES_DEFINED__ ! typedef __signed char int8_t; typedef unsigned char u_int8_t; ! typedef short int16_t; typedef unsigned short u_int16_t; ! typedef int int32_t; typedef unsigned int u_int32_t; #ifdef WE_DONT_NEED_QUADS typedef long long int64_t; --- 51,61 ---- #ifndef __BIT_TYPES_DEFINED__ #define __BIT_TYPES_DEFINED__ ! /* typedef __signed char int8_t; */ typedef unsigned char u_int8_t; ! /* typedef short int16_t; */ typedef unsigned short u_int16_t; ! /* typedef int int32_t; */ typedef unsigned int u_int32_t; #ifdef WE_DONT_NEED_QUADS typedef long long int64_t;
Apply the following patch to the db-1.85/PORT/sunos.5.2/Makefile(IA版)
memmove.c、mktemp.o、snprintf.o のコンパイル時になぜコンパイルオプションが違うのかまでは調べていない。いままで以下の修正をして100回以上もコンパイルしているので、大丈夫だと思いますけど。
※SPARC版の場合にどこを修正すればいいのか、自明だと思いますけど。*** PORT/sunos.5.2/Makefile.orig Thu Jul 14 10:43:36 1994 --- PORT/sunos.5.2/Makefile Mon Jul 29 09:19:08 2002 *************** *** 22,28 **** clean: rm -f ${LIBDB} ${OBJ1} ${OBJ2} ${OBJ3} ${OBJ4} ${OBJ5} ${MISC} ! OORG= -O CL= ${CC} -c -D__DBINTERFACE_PRIVATE ${OORG} -I. -Iinclude hash.o: ../../hash/hash.c --- 22,29 ---- clean: rm -f ${LIBDB} ${OBJ1} ${OBJ2} ${OBJ3} ${OBJ4} ${OBJ5} ${MISC} ! CC= gcc ! OORG= -O2 -mcpu=i586 -fomit-frame-pointer -pipe -s CL= ${CC} -c -D__DBINTERFACE_PRIVATE ${OORG} -I. -Iinclude hash.o: ../../hash/hash.c *************** *** 95,102 **** ${CL} -I../../recno ../../recno/rec_utils.c memmove.o: ! ${CC} -DMEMMOVE -c -O -I. -Iinclude clib/memmove.c mktemp.o: ! ${CC} -c -O -I. -Iinclude clib/mktemp.c snprintf.o: ! ${CC} -c -O -I. -Iinclude clib/snprintf.c --- 96,103 ---- ${CL} -I../../recno ../../recno/rec_utils.c memmove.o: ! ${CC} -DMEMMOVE -c ${OORG} -I. -Iinclude clib/memmove.c mktemp.o: ! ${CC} -c ${OORG} -I. -Iinclude clib/mktemp.c snprintf.o: ! ${CC} -c ${OORG} -I. -Iinclude clib/snprintf.c
$ gzip -dc db.1.85.tar.gz | tar -xf - $ cd db.1.85 $ /usr/bin/gpatch -p0 < patch.1.2 patching file btree/bt_split.c $ /usr/bin/gpatch -p0 < patch.1.3 patching file btree/bt_split.c $ /usr/bin/gpatch -p0 < patch.1.4 patching file btree/bt_page.c $ /usr/bin/gpatch -p0 < patch.solaris8 patching file include/db.h $ /usr/bin/gpatch -p0 < patch.sunos.5.2 patching file PORT/sunos.5.2/Makefile $ cd PORT/sunos.5.2 $ gmake $ su # /usr/ucb/install -g other -m 644 -o root libdb.a /usr/local/lib/libdb1.a # cd include # /usr/ucb/install -g other -m 644 -o root cdefs.h /usr/local/include # /usr/ucb/install -g other -m 644 -o root compat.h /usr/local/include # /usr/ucb/install -g other -m 644 -o root db.h /usr/local/include/db1.h # /usr/ucb/install -g other -m 644 -o root mpool.h /usr/local/include # /usr/ucb/install -g other -m 644 -o root ndbm.h /usr/local/include # /usr/ucb/install -g other -m 644 -o root queue.h /usr/local/include # exit
$ gmake distclean $ /usr/bin/gpatch -p0 < patch.build_so patching file PORT/sunos.5.2/Makefile $ gmake $ mkdir objs $ cd objs $ ar xv ../libdb.a x - hsearch.o x - ndbm.o x - bt_debug.o x - db.o x - rec_open.o x - bt_open.o x - bt_conv.o x - bt_get.o x - bt_put.o x - bt_delete.o x - bt_seq.o x - bt_search.o x - bt_utils.o x - rec_close.o x - bt_close.o x - rec_get.o x - rec_put.o x - bt_split.o x - rec_delete.o x - rec_seq.o x - rec_search.o x - rec_utils.o x - bt_overflow.o x - bt_page.o x - mpool.o x - snprintf.o x - hash_page.o x - hash.o x - hash_bigkey.o x - hash_buf.o x - hash_func.o x - hash_log2.o $ gcc -shared -s -o libdb1.so ./*.o $ su # /usr/ucb/install -g other -m 644 -o root ./libdb1.so /usr/local/lib # exit $