On 12/19/11 14:27, Nigel Taylor wrote:
> On 12/19/11 13:38, Stuart Henderson wrote:
>> The sparc64 tests need looking into in more detail, the previous
>> version has some problems too but it gets a lot further
>>
>> http://junkpile.org/sqlite-src-3070500.sparc64.log
>> http://junkpile.org/sqlite-src-3070900.sparc64.log
>>
>> -rw-r--r--  1 sthen  staff  4088097 Dec 19 13:36 
>> sqlite-src-3070500.sparc64.log
>> -rw-r--r--  1 sthen  staff   300349 Dec 19 13:37 
>> sqlite-src-3070900.sparc64.log
>>
>>
> Hi,
> 
> I don't have a sparc system to check, this might be of interest..
> 
> Fix a 8-byte alignment problem that causes a SIGBUS on Sparc.
> 
> http://www.sqlite.org/src/info/54cc119811
> 
> Nigel
> 
> 
Hi,

I have attached a revised diff including the upstream patch.
The regression tests have been rerun on amd64 and i386 results unchanged.

Nigel
Index: Makefile
===================================================================
RCS file: /home/cvs/ports/databases/sqlite3/Makefile,v
retrieving revision 1.59
diff -u -p -r1.59 Makefile
--- Makefile    18 Nov 2011 09:39:09 -0000      1.59
+++ Makefile    18 Dec 2011 12:58:12 -0000
@@ -3,14 +3,14 @@
 COMMENT-main=  embedded SQL implementation
 COMMENT-tcl=   TCL bindings for Sqlite3
 COMMENT-lemon= LEMON LALR(1) parser generator
-V=             3.7.5
-DISTNAME=      sqlite-src-3070500
+V=             3.7.9
+DISTNAME=      sqlite-src-3070900
 EXTRACT_SUFX = .zip
 PKGNAME-main=  sqlite3-${V}
 PKGNAME-tcl=   sqlite3-tcl-${V}
 PKGNAME-lemon= lemon-${V}
 CATEGORIES=    databases
-SHARED_LIBS += sqlite3              15.1      # .8.6
+SHARED_LIBS += sqlite3              15.2      # .8.6
 
 MASTER_SITES=  ${HOMEPAGE}
 
Index: distinfo
===================================================================
RCS file: /home/cvs/ports/databases/sqlite3/distinfo,v
retrieving revision 1.30
diff -u -p -r1.30 distinfo
--- distinfo    14 Mar 2011 14:39:51 -0000      1.30
+++ distinfo    18 Dec 2011 11:24:15 -0000
@@ -1,5 +1,5 @@
-MD5 (sqlite-src-3070500.zip) = 1h14SZfULNDZK6x5lAlMVg==
-RMD160 (sqlite-src-3070500.zip) = TV8gkXAOnBg+hhYTIDod22YhfA8=
-SHA1 (sqlite-src-3070500.zip) = lwYRDWNcNH4W3bjOobSSM4X+z6w=
-SHA256 (sqlite-src-3070500.zip) = G7g4wCtJRsUU4oz80cFbAHn4Ym9fvPzytI4qB1rMXFE=
-SIZE (sqlite-src-3070500.zip) = 3987471
+MD5 (sqlite-src-3070900.zip) = smRsWgwLW8a48LZ/wxi6sw==
+RMD160 (sqlite-src-3070900.zip) = gpFxRe1kPZwaIqPLu1ekFAtsZYw=
+SHA1 (sqlite-src-3070900.zip) = 0PdmHwbCRkKfdZc7YcfmIPXsQ80=
+SHA256 (sqlite-src-3070900.zip) = br/+FmJn+3gwVqQgDXUAKJzDZsoofJs0V9vUaibXBNA=
+SIZE (sqlite-src-3070900.zip) = 4639586
Index: patches/patch-Makefile_in
===================================================================
RCS file: /home/cvs/ports/databases/sqlite3/patches/patch-Makefile_in,v
retrieving revision 1.17
diff -u -p -r1.17 patch-Makefile_in
--- patches/patch-Makefile_in   14 Mar 2011 14:39:51 -0000      1.17
+++ patches/patch-Makefile_in   18 Dec 2011 11:48:27 -0000
@@ -1,6 +1,6 @@
 $OpenBSD: patch-Makefile_in,v 1.17 2011/03/14 14:39:51 landry Exp $
---- Makefile.in.orig   Thu Mar 10 17:55:45 2011
-+++ Makefile.in        Thu Mar 10 18:01:04 2011
+--- Makefile.in.orig   Tue Nov  1 12:31:18 2011
++++ Makefile.in        Sun Dec 18 11:47:35 2011
 @@ -186,7 +186,7 @@ LIBOBJS1 = sqlite3.lo
  
  # Determine the real value of LIBOBJ based on the 'configure' script
@@ -10,7 +10,7 @@ $OpenBSD: patch-Makefile_in,v 1.17 2011/
  
  
  # All of the source code files.
-@@ -282,6 +282,8 @@ SRC = \
+@@ -283,6 +283,8 @@ SRC = \
    $(TOP)/src/walker.c \
    $(TOP)/src/where.c
  
@@ -19,7 +19,7 @@ $OpenBSD: patch-Makefile_in,v 1.17 2011/
  # Source code for extensions
  #
  SRC += \
-@@ -757,6 +759,9 @@ tclsqlite3$(TEXE): tclsqlite-shell.lo libsqlite3.la
+@@ -772,6 +774,9 @@ tclsqlite3$(TEXE): tclsqlite-shell.lo libsqlite3.la
        $(LTLINK) -o $@ tclsqlite-shell.lo \
                 libsqlite3.la $(LIBTCL)
  
@@ -29,21 +29,23 @@ $OpenBSD: patch-Makefile_in,v 1.17 2011/
  # Rules to build opcodes.c and opcodes.h
  #
  opcodes.c:    opcodes.h $(TOP)/mkopcodec.awk
-@@ -777,7 +782,11 @@ parse.c:  $(TOP)/src/parse.y lemon$(BEXE) $(TOP)/addopc
+@@ -792,8 +797,12 @@ parse.c:  $(TOP)/src/parse.y lemon$(BEXE) $(TOP)/addopc
        $(NAWK) -f $(TOP)/addopcodes.awk parse.h.temp >parse.h
  
  sqlite3.h:    $(TOP)/src/sqlite.h.in $(TOP)/manifest.uuid $(TOP)/VERSION
--      tclsh $(TOP)/tool/mksqlite3h.tcl $(TOP) >sqlite3.h
+-      $(TCLSH_CMD) $(TOP)/tool/mksqlite3h.tcl $(TOP) >sqlite3.h
+-
 +      sed -e '/^#include <sqlite3\.h>$$/d' \
 +          -e 's/--VERS--/$(RELEASE)/' \
 +          -e 's/--VERSION-NUMBER--/$(VERSION_NUMBER)/' \
 +          $(TOP)/src/sqlite.h.in $(TOP)/ext/rtree/sqlite3rtree.h \
 +      > sqlite3.h
- 
++ 
  keywordhash.h:        $(TOP)/tool/mkkeywordhash.c
        $(BCC) -o mkkeywordhash$(BEXE) $(OPT_FEATURE_FLAGS) $(OPTS) 
$(TOP)/tool/mkkeywordhash.c
-@@ -850,7 +859,7 @@ TESTFIXTURE_FLAGS  = -DTCLSH=1 -DSQLITE_TEST=1 -DSQLIT
- TESTFIXTURE_FLAGS += -DSQLITE_SERVER=1 -DSQLITE_PRIVATE="" -DSQLITE_CORE 
+       ./mkkeywordhash$(BEXE) >keywordhash.h
+@@ -869,7 +878,7 @@ TESTFIXTURE_FLAGS += -DSQLITE_SERVER=1 -DSQLITE_PRIVAT
+ TESTFIXTURE_FLAGS += -DBUILD_sqlite
  
  TESTFIXTURE_SRC0 = $(TESTSRC2) libsqlite3.la
 -TESTFIXTURE_SRC1 = sqlite3.c
@@ -51,7 +53,7 @@ $OpenBSD: patch-Makefile_in,v 1.17 2011/
  TESTFIXTURE_SRC = $(TESTSRC) $(TOP)/src/tclsqlite.c 
$(TESTFIXTURE_SRC$(USE_AMALGAMATION))
  
  testfixture$(TEXE):   $(TESTFIXTURE_SRC)
-@@ -918,6 +927,8 @@ clean:     
+@@ -937,6 +946,8 @@ clean:     
  
  distclean:    clean
        rm -f config.log config.status libtool Makefile sqlite3.pc
Index: patches/patch-configure
===================================================================
RCS file: /home/cvs/ports/databases/sqlite3/patches/patch-configure,v
retrieving revision 1.11
diff -u -p -r1.11 patch-configure
--- patches/patch-configure     14 Mar 2011 14:39:51 -0000      1.11
+++ patches/patch-configure     18 Dec 2011 11:48:31 -0000
@@ -1,7 +1,7 @@
 $OpenBSD: patch-configure,v 1.11 2011/03/14 14:39:51 landry Exp $
---- configure.orig     Thu Jan 27 19:40:56 2011
-+++ configure  Thu Mar 10 17:55:23 2011
-@@ -12494,8 +12494,8 @@ for ac_lib in '' pthread; do
+--- configure.orig     Tue Nov  1 12:31:18 2011
++++ configure  Sun Dec 18 11:43:24 2011
+@@ -11231,8 +11231,8 @@ for ac_lib in '' dl; do
    if test -z "$ac_lib"; then
      ac_res="none required"
    else
@@ -10,5 +10,5 @@ $OpenBSD: patch-configure,v 1.11 2011/03
 +    ac_res=-$ac_lib
 +    LIBS="-$ac_lib  $ac_func_search_save_LIBS"
    fi
-   rm -f conftest.$ac_objext conftest$ac_exeext
- if { (ac_try="$ac_link"
+   if ac_fn_c_try_link "$LINENO"; then :
+   ac_cv_search_dlopen=$ac_res
Index: patches/patch-src_build_c
===================================================================
RCS file: patches/patch-src_build_c
diff -N patches/patch-src_build_c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_build_c   19 Dec 2011 15:10:59 -0000
@@ -0,0 +1,38 @@
+$OpenBSD$
+
+patch for sparc
+http://www.sqlite.org/src/info/54cc119811
+
+--- src/build.c.orig   Tue Nov  1 12:31:18 2011
++++ src/build.c        Mon Dec 19 15:09:48 2011
+@@ -2661,19 +2661,22 @@ Index *sqlite3CreateIndex(
+   nName = sqlite3Strlen30(zName);
+   nCol = pList->nExpr;
+   pIndex = sqlite3DbMallocZero(db, 
+-      sizeof(Index) +              /* Index structure  */
+-      sizeof(tRowcnt)*(nCol+1) +   /* Index.aiRowEst   */
+-      sizeof(int)*nCol +           /* Index.aiColumn   */
+-      sizeof(char *)*nCol +        /* Index.azColl     */
+-      sizeof(u8)*nCol +            /* Index.aSortOrder */
+-      nName + 1 +                  /* Index.zName      */
+-      nExtra                       /* Collation sequence names */
++      sizeof(Index) +                      /* Index structure  */
++      ROUND8(sizeof(tRowcnt)*(nCol+1)) +   /* Index.aiRowEst   */
++      sizeof(char *)*nCol +                /* Index.azColl     */
++      sizeof(int)*nCol +                   /* Index.aiColumn   */
++      sizeof(u8)*nCol +                    /* Index.aSortOrder */
++      nName + 1 +                          /* Index.zName      */
++      nExtra                               /* Collation sequence names */
+   );
+   if( db->mallocFailed ){
+     goto exit_create_index;
+   }
+   pIndex->aiRowEst = (tRowcnt*)(&pIndex[1]);
+-  pIndex->azColl = (char**)(&pIndex->aiRowEst[nCol+1]);
++  pIndex->azColl = (char**)
++     ((char*)pIndex->aiRowEst + ROUND8(sizeof(tRowcnt)*nCol+1));
++  assert( EIGHT_BYTE_ALIGNMENT(pIndex->aiRowEst) );
++  assert( EIGHT_BYTE_ALIGNMENT(pIndex->azColl) );
+   pIndex->aiColumn = (int *)(&pIndex->azColl[nCol]);
+   pIndex->aSortOrder = (u8 *)(&pIndex->aiColumn[nCol]);
+   pIndex->zName = (char *)(&pIndex->aSortOrder[nCol]);
Index: patches/patch-src_sqliteInt_h
===================================================================
RCS file: /home/cvs/ports/databases/sqlite3/patches/patch-src_sqliteInt_h,v
retrieving revision 1.8
diff -u -p -r1.8 patch-src_sqliteInt_h
--- patches/patch-src_sqliteInt_h       9 Jan 2011 19:11:34 -0000       1.8
+++ patches/patch-src_sqliteInt_h       18 Dec 2011 11:48:20 -0000
@@ -1,6 +1,6 @@
 $OpenBSD: patch-src_sqliteInt_h,v 1.8 2011/01/09 19:11:34 landry Exp $
---- src/sqliteInt.h.orig       Thu Oct  7 10:48:42 2010
-+++ src/sqliteInt.h    Sun Nov 21 18:27:02 2010
+--- src/sqliteInt.h.orig       Tue Nov  1 12:31:18 2011
++++ src/sqliteInt.h    Sun Dec 18 11:43:24 2011
 @@ -61,11 +61,6 @@
  #pragma warn -spa /* Suspicious pointer arithmetic */
  #endif
@@ -13,9 +13,9 @@ $OpenBSD: patch-src_sqliteInt_h,v 1.8 20
  /*
  ** Include standard header files as necessary
  */
-@@ -445,33 +440,26 @@ typedef INT8_TYPE i8;              /* 1-byte signed in
- */
- #define SQLITE_MAX_U32  ((((u64)1)<<32)-1)
+@@ -456,33 +451,26 @@ typedef INT8_TYPE i8;              /* 1-byte signed in
+  typedef u32 tRowcnt;    /* 32-bit is the default */
+ #endif
  
 -/*
 -** Macros to determine whether the machine is big or little endian,

Reply via email to