Re: [sqlite] Porting SQLite 3.7.2 to vxWorks 6.7

2010-10-11 Thread Scott A Mintz
Thanks.  I took a guess that it was fixed in 3.7.3 and manually downloaded 
the source.  Of course hitting refresh in my browser brought up the 
correct page.  PEBKAC.

-Scott

sqlite-users-boun...@sqlite.org wrote on 10/11/2010 04:04:32 PM:

> See:
> 
> http://www.sqlite.org/src/info/d1ed743b6e
> 
> for changes for SQLITE_OMIT_WAL.
> 
> 3.7.3 should be available from the downloads page:
> 
> http://www.sqlite.org/download.html
> 
> as of October 8, 2010.  You might need to refresh your browser cache.
> 
> Direct link to the amalgamation is:
> 
> http://www.sqlite.org/sqlite-amalgamation-3_7_3.zip
> 
> HTH.
> -Shane
> 
> On Mon, Oct 11, 2010 at 12:11 PM, Scott A Mintz  rockwell.com> wrote:
> > I think there is a bug in 3.7.2 when you define SQLITE_OMIT_WAL. 
 There
> > are references to pagerPagecount() that cannot be resolved because 
that
> > function is defined inside of a #ifndef SQLITE_OMIT_WAL.
> >
> > I also keep seeing references to 3.7.3 in this list.  But the SQLite
> > download page only has links for 3.7.2.  Where can I download 3.7.3?
> >
> > -Scott
> >
> > sqlite-users-boun...@sqlite.org wrote on 10/09/2010 07:38:24 AM:
> >
> >> Hello Scott,
> >>
> >> I did some searching with these symbols, they should be in
> > 'libos.a'.
> >>
> >> rtpLib.o - rtpVerifyAndLock
> >>
> >> pgMgrLib.o - pgMgrPageFree, pgMgrPageAllocAt
> >>
> >> you should modify kernel components with your VIP project.
> >>
> >> Best Regards,
> >>
> >> Huang ZhiHua
> >>
> >> 2010/10/9 Scott A Mintz 
> >>
> >> > Thank you.  Those changes (modified slightly for 3.7.2) allowed me 
to
> >> > create a DKM project that compiles sqlite3.c to libSQLite3.a.
> >> >
> >> > However, when I link my main VIP project, I get the following
> > unresolved
> >> > errors:
> >> > dld: warning: Undefined symbol 'rtpVerifyAndLock' in file
> > 'partialImage.o'
> >> > dld: warning: Undefined symbol 'pgMgrPageFree' in file
> > 'partialImage.o'
> >> > dld: warning: Undefined symbol 'pgMgrPageAllocAt' in file
> > 'partialImage.o'
> >> >
> >> > Those are not directly used by SQLite.  But I have a feeling that 
one
> > or
> >> > more of the file I/O, semaphore, locking, or memory library system
> > calls
> >> > are...
> >> >
> >> > -Scott
> >> >
> >> > sqlite-users-boun...@sqlite.org wrote on 10/08/2010 07:38:45 AM:
> >> >
> >> > > Hello Scott,
> >> > >
> >> > > Below is my patch on the latest SQLite 3.7.3. Please notice 
that
> > I
> >> > only
> >> > > verify it with GCC 4.1.2 compiler in VxWorks 6.6/6.7/6.8(I have 
not
> >> > verify
> >> > > it with my real target machine yet).
> >> > >
> >> > > *** sqlite3.c.orig2010-10-08 10:42:22.0 +0800
> >> > > --- sqlite3.c2010-10-08 19:24:18.390625000 +0800
> >> > > ***
> >> > > *** 17,22 
> >> > > --- 17,26 
> >> > >   ** language. The code for the "sqlite3" command-line shell is 
also
> > in
> >> > a
> >> > >   ** separate file. This file contains only code for the core 
SQLite
> >> > > library.
> >> > >   */
> >> > > + #if defined(OS_VXWORKS)
> >> > > + #include 
> >> > > + #endif /* OS_VXWORKS */
> >> > > +
> >> > >   #define SQLITE_CORE 1
> >> > >   #define SQLITE_AMALGAMATION 1
> >> > >   #ifndef SQLITE_PRIVATE
> >> > > ***
> >> > > *** 22795,22801 
> >> > > --- 22799,22811 
> >> > >   #include 
> >> > >   #include 
> >> > >   #include 
> >> > > +
> >> > > + #if defined(OS_VXWORKS) && defined(_WRS_KERNEL)
> >> > > + #include 
> >> > > + #else
> >> > >   #include 
> >> > > + #endif /* OS_VXWORKS */
> >> > > +
> >> > >   #include 
> >> > >   #include 
> >> > >
> >> > > ***
> >> > > *** 24945,24951 
> >> > > --- 24955,24965 
> >> > >   /*
> >> > >** Close a file.
> >> > >*/
> >> > > + #if (OS_VXWORKS < 600)
> >> > >   static int semClose(sqlite3_file *id) {
> >> > > + #else
> >> > > + static int semClose_native(sqlite3_file *id) {
> >> > > + #endif
> >> > > if( id ){
> >> > >   unixFile *pFile = (unixFile*)id;
> >> > >   semUnlock(id, NO_LOCK);
> >> > > ***
> >> > > *** 25581,25587 
> >> > > --- 25595,25607 
> >> > >   }
> >> > >   return -1;
> >> > > }
> >> > > +
> >> > > + #if defined(OS_VXWORKS) && defined(_WRS_KERNEL)
> >> > > +   got = write(id->h, (char *)pBuf, cnt);
> >> > > + #else
> >> > > got = write(id->h, pBuf, cnt);
> >> > > + #endif /* OS_VXWORKS */
> >> > > +
> >> > >   #endif
> >> > > TIMER_END;
> >> > > if( got<0 ){
> >> > > ***
> >> > > *** 26762,26768 
> >> > > --- 26782,26792 
> >> > > semIoFinder,  /* Finder function name */
> >> > > semIoMethods, /* sqlite3_io_methods object name 
*/
> >> > > 1,/* shared memory is disabled */
> >> > > + #if (OS_VXWORKS < 600)
> >> > > semClose, /* xClose method */
> >> > > + #else
> >> > > +   semClose_native,  /* xClose method */
> >> > > + #endif
> >> > > semLock,  /* xLock method 

Re: [sqlite] Porting SQLite 3.7.2 to vxWorks 6.7

2010-10-11 Thread Shane Harrelson
See:

http://www.sqlite.org/src/info/d1ed743b6e

for changes for SQLITE_OMIT_WAL.

3.7.3 should be available from the downloads page:

http://www.sqlite.org/download.html

as of October 8, 2010.  You might need to refresh your browser cache.

Direct link to the amalgamation is:

http://www.sqlite.org/sqlite-amalgamation-3_7_3.zip

HTH.
-Shane

On Mon, Oct 11, 2010 at 12:11 PM, Scott A Mintz  wrote:
> I think there is a bug in 3.7.2 when you define SQLITE_OMIT_WAL.  There
> are references to pagerPagecount() that cannot be resolved because that
> function is defined inside of a #ifndef SQLITE_OMIT_WAL.
>
> I also keep seeing references to 3.7.3 in this list.  But the SQLite
> download page only has links for 3.7.2.  Where can I download 3.7.3?
>
> -Scott
>
> sqlite-users-boun...@sqlite.org wrote on 10/09/2010 07:38:24 AM:
>
>> Hello Scott,
>>
>>     I did some searching with these symbols, they should be in
> 'libos.a'.
>>
>> rtpLib.o - rtpVerifyAndLock
>>
>> pgMgrLib.o - pgMgrPageFree, pgMgrPageAllocAt
>>
>>     you should modify kernel components with your VIP project.
>>
>> Best Regards,
>>
>> Huang ZhiHua
>>
>> 2010/10/9 Scott A Mintz 
>>
>> > Thank you.  Those changes (modified slightly for 3.7.2) allowed me to
>> > create a DKM project that compiles sqlite3.c to libSQLite3.a.
>> >
>> > However, when I link my main VIP project, I get the following
> unresolved
>> > errors:
>> > dld: warning: Undefined symbol 'rtpVerifyAndLock' in file
> 'partialImage.o'
>> > dld: warning: Undefined symbol 'pgMgrPageFree' in file
> 'partialImage.o'
>> > dld: warning: Undefined symbol 'pgMgrPageAllocAt' in file
> 'partialImage.o'
>> >
>> > Those are not directly used by SQLite.  But I have a feeling that one
> or
>> > more of the file I/O, semaphore, locking, or memory library system
> calls
>> > are...
>> >
>> > -Scott
>> >
>> > sqlite-users-boun...@sqlite.org wrote on 10/08/2010 07:38:45 AM:
>> >
>> > > Hello Scott,
>> > >
>> > >     Below is my patch on the latest SQLite 3.7.3. Please notice that
> I
>> > only
>> > > verify it with GCC 4.1.2 compiler in VxWorks 6.6/6.7/6.8(I have not
>> > verify
>> > > it with my real target machine yet).
>> > >
>> > > *** sqlite3.c.orig    2010-10-08 10:42:22.0 +0800
>> > > --- sqlite3.c    2010-10-08 19:24:18.390625000 +0800
>> > > ***
>> > > *** 17,22 
>> > > --- 17,26 
>> > >   ** language. The code for the "sqlite3" command-line shell is also
> in
>> > a
>> > >   ** separate file. This file contains only code for the core SQLite
>> > > library.
>> > >   */
>> > > + #if defined(OS_VXWORKS)
>> > > + #include 
>> > > + #endif /* OS_VXWORKS */
>> > > +
>> > >   #define SQLITE_CORE 1
>> > >   #define SQLITE_AMALGAMATION 1
>> > >   #ifndef SQLITE_PRIVATE
>> > > ***
>> > > *** 22795,22801 
>> > > --- 22799,22811 
>> > >   #include 
>> > >   #include 
>> > >   #include 
>> > > +
>> > > + #if defined(OS_VXWORKS) && defined(_WRS_KERNEL)
>> > > + #include 
>> > > + #else
>> > >   #include 
>> > > + #endif /* OS_VXWORKS */
>> > > +
>> > >   #include 
>> > >   #include 
>> > >
>> > > ***
>> > > *** 24945,24951 
>> > > --- 24955,24965 
>> > >   /*
>> > >    ** Close a file.
>> > >    */
>> > > + #if (OS_VXWORKS < 600)
>> > >   static int semClose(sqlite3_file *id) {
>> > > + #else
>> > > + static int semClose_native(sqlite3_file *id) {
>> > > + #endif
>> > >     if( id ){
>> > >       unixFile *pFile = (unixFile*)id;
>> > >       semUnlock(id, NO_LOCK);
>> > > ***
>> > > *** 25581,25587 
>> > > --- 25595,25607 
>> > >       }
>> > >       return -1;
>> > >     }
>> > > +
>> > > + #if defined(OS_VXWORKS) && defined(_WRS_KERNEL)
>> > > +   got = write(id->h, (char *)pBuf, cnt);
>> > > + #else
>> > >     got = write(id->h, pBuf, cnt);
>> > > + #endif /* OS_VXWORKS */
>> > > +
>> > >   #endif
>> > >     TIMER_END;
>> > >     if( got<0 ){
>> > > ***
>> > > *** 26762,26768 
>> > > --- 26782,26792 
>> > >     semIoFinder,              /* Finder function name */
>> > >     semIoMethods,             /* sqlite3_io_methods object name */
>> > >     1,                        /* shared memory is disabled */
>> > > + #if (OS_VXWORKS < 600)
>> > >     semClose,                 /* xClose method */
>> > > + #else
>> > > +   semClose_native,          /* xClose method */
>> > > + #endif
>> > >     semLock,                  /* xLock method */
>> > >     semUnlock,                /* xUnlock method */
>> > >     semCheckReservedLock      /* xCheckReservedLock method */
>> > > ***
>> > > *** 27517,27523 
>> > >     noLock = eType!=SQLITE_OPEN_MAIN_DB;
>> > >
>> > >
>> > > ! #if defined(__APPLE__) || SQLITE_ENABLE_LOCKING_STYLE
>> > >     struct statfs fsInfo;
>> > >     if( fstatfs(fd, &fsInfo) == -1 ){
>> > >       ((unixFile*)pFile)->lastErrno = errno;
>> > > --- 27541,27547 
>> > >     noLock = eType!=SQLITE_OPEN_MAIN_DB;
>> > >
>> > >
>> > > ! #if (defined(__APPLE__) || SQLITE_ENABLE_LO

Re: [sqlite] Porting SQLite 3.7.2 to vxWorks 6.7

2010-10-11 Thread Scott A Mintz
I think there is a bug in 3.7.2 when you define SQLITE_OMIT_WAL.  There 
are references to pagerPagecount() that cannot be resolved because that 
function is defined inside of a #ifndef SQLITE_OMIT_WAL.

I also keep seeing references to 3.7.3 in this list.  But the SQLite 
download page only has links for 3.7.2.  Where can I download 3.7.3?

-Scott

sqlite-users-boun...@sqlite.org wrote on 10/09/2010 07:38:24 AM:

> Hello Scott,
> 
> I did some searching with these symbols, they should be in 
'libos.a'.
> 
> rtpLib.o - rtpVerifyAndLock
> 
> pgMgrLib.o - pgMgrPageFree, pgMgrPageAllocAt
> 
> you should modify kernel components with your VIP project.
> 
> Best Regards,
> 
> Huang ZhiHua
> 
> 2010/10/9 Scott A Mintz 
> 
> > Thank you.  Those changes (modified slightly for 3.7.2) allowed me to
> > create a DKM project that compiles sqlite3.c to libSQLite3.a.
> >
> > However, when I link my main VIP project, I get the following 
unresolved
> > errors:
> > dld: warning: Undefined symbol 'rtpVerifyAndLock' in file 
'partialImage.o'
> > dld: warning: Undefined symbol 'pgMgrPageFree' in file 
'partialImage.o'
> > dld: warning: Undefined symbol 'pgMgrPageAllocAt' in file 
'partialImage.o'
> >
> > Those are not directly used by SQLite.  But I have a feeling that one 
or
> > more of the file I/O, semaphore, locking, or memory library system 
calls
> > are...
> >
> > -Scott
> >
> > sqlite-users-boun...@sqlite.org wrote on 10/08/2010 07:38:45 AM:
> >
> > > Hello Scott,
> > >
> > > Below is my patch on the latest SQLite 3.7.3. Please notice that 
I
> > only
> > > verify it with GCC 4.1.2 compiler in VxWorks 6.6/6.7/6.8(I have not
> > verify
> > > it with my real target machine yet).
> > >
> > > *** sqlite3.c.orig2010-10-08 10:42:22.0 +0800
> > > --- sqlite3.c2010-10-08 19:24:18.390625000 +0800
> > > ***
> > > *** 17,22 
> > > --- 17,26 
> > >   ** language. The code for the "sqlite3" command-line shell is also 
in
> > a
> > >   ** separate file. This file contains only code for the core SQLite
> > > library.
> > >   */
> > > + #if defined(OS_VXWORKS)
> > > + #include 
> > > + #endif /* OS_VXWORKS */
> > > +
> > >   #define SQLITE_CORE 1
> > >   #define SQLITE_AMALGAMATION 1
> > >   #ifndef SQLITE_PRIVATE
> > > ***
> > > *** 22795,22801 
> > > --- 22799,22811 
> > >   #include 
> > >   #include 
> > >   #include 
> > > +
> > > + #if defined(OS_VXWORKS) && defined(_WRS_KERNEL)
> > > + #include 
> > > + #else
> > >   #include 
> > > + #endif /* OS_VXWORKS */
> > > +
> > >   #include 
> > >   #include 
> > >
> > > ***
> > > *** 24945,24951 
> > > --- 24955,24965 
> > >   /*
> > >** Close a file.
> > >*/
> > > + #if (OS_VXWORKS < 600)
> > >   static int semClose(sqlite3_file *id) {
> > > + #else
> > > + static int semClose_native(sqlite3_file *id) {
> > > + #endif
> > > if( id ){
> > >   unixFile *pFile = (unixFile*)id;
> > >   semUnlock(id, NO_LOCK);
> > > ***
> > > *** 25581,25587 
> > > --- 25595,25607 
> > >   }
> > >   return -1;
> > > }
> > > +
> > > + #if defined(OS_VXWORKS) && defined(_WRS_KERNEL)
> > > +   got = write(id->h, (char *)pBuf, cnt);
> > > + #else
> > > got = write(id->h, pBuf, cnt);
> > > + #endif /* OS_VXWORKS */
> > > +
> > >   #endif
> > > TIMER_END;
> > > if( got<0 ){
> > > ***
> > > *** 26762,26768 
> > > --- 26782,26792 
> > > semIoFinder,  /* Finder function name */
> > > semIoMethods, /* sqlite3_io_methods object name */
> > > 1,/* shared memory is disabled */
> > > + #if (OS_VXWORKS < 600)
> > > semClose, /* xClose method */
> > > + #else
> > > +   semClose_native,  /* xClose method */
> > > + #endif
> > > semLock,  /* xLock method */
> > > semUnlock,/* xUnlock method */
> > > semCheckReservedLock  /* xCheckReservedLock method */
> > > ***
> > > *** 27517,27523 
> > > noLock = eType!=SQLITE_OPEN_MAIN_DB;
> > >
> > >
> > > ! #if defined(__APPLE__) || SQLITE_ENABLE_LOCKING_STYLE
> > > struct statfs fsInfo;
> > > if( fstatfs(fd, &fsInfo) == -1 ){
> > >   ((unixFile*)pFile)->lastErrno = errno;
> > > --- 27541,27547 
> > > noLock = eType!=SQLITE_OPEN_MAIN_DB;
> > >
> > >
> > > ! #if (defined(__APPLE__) || SQLITE_ENABLE_LOCKING_STYLE) &&
> > > !defined(OS_VXWORKS)
> > > struct statfs fsInfo;
> > > if( fstatfs(fd, &fsInfo) == -1 ){
> > >   ((unixFile*)pFile)->lastErrno = errno;
> > > ***
> > > *** 27530,27536 
> > > }
> > >   #endif
> > >
> > > ! #if SQLITE_ENABLE_LOCKING_STYLE
> > >   #if SQLITE_PREFER_PROXY_LOCKING
> > > isAutoProxy = 1;
> > >   #endif
> > > --- 27554,27560 
> > > }
> > >   #endif
> > >
> > > ! #if SQLITE_ENABLE_LOCKING_STYLE && !OS_VXWORKS
> > >   #if SQLITE_PREFER_PROXY_LOCKING
> > > isAutoProxy

Re: [sqlite] Porting SQLite 3.7.2 to vxWorks 6.7

2010-10-11 Thread Scott A Mintz
I am a little reluctant to modify our kernel configuration.  Primarily out 
of ignorance because I know very little about vxWorks. 

Do you happen to know if these functions are used by the new WAL logic? 
I'm assuming by the names that they could be related to memory mapped 
files.  What switches would I set to disable WAL and use the old 
mechanism?

-Scott

sqlite-users-boun...@sqlite.org wrote on 10/09/2010 07:38:24 AM:

> Hello Scott,
> 
> I did some searching with these symbols, they should be in 
'libos.a'.
> 
> rtpLib.o - rtpVerifyAndLock
> 
> pgMgrLib.o - pgMgrPageFree, pgMgrPageAllocAt
> 
> you should modify kernel components with your VIP project.
> 
> Best Regards,
> 
> Huang ZhiHua
> 
> 2010/10/9 Scott A Mintz 
> 
> > Thank you.  Those changes (modified slightly for 3.7.2) allowed me to
> > create a DKM project that compiles sqlite3.c to libSQLite3.a.
> >
> > However, when I link my main VIP project, I get the following 
unresolved
> > errors:
> > dld: warning: Undefined symbol 'rtpVerifyAndLock' in file 
'partialImage.o'
> > dld: warning: Undefined symbol 'pgMgrPageFree' in file 
'partialImage.o'
> > dld: warning: Undefined symbol 'pgMgrPageAllocAt' in file 
'partialImage.o'
> >
> > Those are not directly used by SQLite.  But I have a feeling that one 
or
> > more of the file I/O, semaphore, locking, or memory library system 
calls
> > are...
> >
> > -Scott
> >
> > sqlite-users-boun...@sqlite.org wrote on 10/08/2010 07:38:45 AM:
> >
> > > Hello Scott,
> > >
> > > Below is my patch on the latest SQLite 3.7.3. Please notice that 
I
> > only
> > > verify it with GCC 4.1.2 compiler in VxWorks 6.6/6.7/6.8(I have not
> > verify
> > > it with my real target machine yet).
> > >
> > > *** sqlite3.c.orig2010-10-08 10:42:22.0 +0800
> > > --- sqlite3.c2010-10-08 19:24:18.390625000 +0800
> > > ***
> > > *** 17,22 
> > > --- 17,26 
> > >   ** language. The code for the "sqlite3" command-line shell is also 
in
> > a
> > >   ** separate file. This file contains only code for the core SQLite
> > > library.
> > >   */
> > > + #if defined(OS_VXWORKS)
> > > + #include 
> > > + #endif /* OS_VXWORKS */
> > > +
> > >   #define SQLITE_CORE 1
> > >   #define SQLITE_AMALGAMATION 1
> > >   #ifndef SQLITE_PRIVATE
> > > ***
> > > *** 22795,22801 
> > > --- 22799,22811 
> > >   #include 
> > >   #include 
> > >   #include 
> > > +
> > > + #if defined(OS_VXWORKS) && defined(_WRS_KERNEL)
> > > + #include 
> > > + #else
> > >   #include 
> > > + #endif /* OS_VXWORKS */
> > > +
> > >   #include 
> > >   #include 
> > >
> > > ***
> > > *** 24945,24951 
> > > --- 24955,24965 
> > >   /*
> > >** Close a file.
> > >*/
> > > + #if (OS_VXWORKS < 600)
> > >   static int semClose(sqlite3_file *id) {
> > > + #else
> > > + static int semClose_native(sqlite3_file *id) {
> > > + #endif
> > > if( id ){
> > >   unixFile *pFile = (unixFile*)id;
> > >   semUnlock(id, NO_LOCK);
> > > ***
> > > *** 25581,25587 
> > > --- 25595,25607 
> > >   }
> > >   return -1;
> > > }
> > > +
> > > + #if defined(OS_VXWORKS) && defined(_WRS_KERNEL)
> > > +   got = write(id->h, (char *)pBuf, cnt);
> > > + #else
> > > got = write(id->h, pBuf, cnt);
> > > + #endif /* OS_VXWORKS */
> > > +
> > >   #endif
> > > TIMER_END;
> > > if( got<0 ){
> > > ***
> > > *** 26762,26768 
> > > --- 26782,26792 
> > > semIoFinder,  /* Finder function name */
> > > semIoMethods, /* sqlite3_io_methods object name */
> > > 1,/* shared memory is disabled */
> > > + #if (OS_VXWORKS < 600)
> > > semClose, /* xClose method */
> > > + #else
> > > +   semClose_native,  /* xClose method */
> > > + #endif
> > > semLock,  /* xLock method */
> > > semUnlock,/* xUnlock method */
> > > semCheckReservedLock  /* xCheckReservedLock method */
> > > ***
> > > *** 27517,27523 
> > > noLock = eType!=SQLITE_OPEN_MAIN_DB;
> > >
> > >
> > > ! #if defined(__APPLE__) || SQLITE_ENABLE_LOCKING_STYLE
> > > struct statfs fsInfo;
> > > if( fstatfs(fd, &fsInfo) == -1 ){
> > >   ((unixFile*)pFile)->lastErrno = errno;
> > > --- 27541,27547 
> > > noLock = eType!=SQLITE_OPEN_MAIN_DB;
> > >
> > >
> > > ! #if (defined(__APPLE__) || SQLITE_ENABLE_LOCKING_STYLE) &&
> > > !defined(OS_VXWORKS)
> > > struct statfs fsInfo;
> > > if( fstatfs(fd, &fsInfo) == -1 ){
> > >   ((unixFile*)pFile)->lastErrno = errno;
> > > ***
> > > *** 27530,27536 
> > > }
> > >   #endif
> > >
> > > ! #if SQLITE_ENABLE_LOCKING_STYLE
> > >   #if SQLITE_PREFER_PROXY_LOCKING
> > > isAutoProxy = 1;
> > >   #endif
> > > --- 27554,27560 
> > > }
> > >   #endif
> > >
> > > ! #if SQLITE_ENABLE_LOCKING_STYLE && !OS_VXWORKS
> > >   #if SQLITE_PREFER_PROXY_LOCKING
> > > 

Re: [sqlite] Porting SQLite 3.7.2 to vxWorks 6.7

2010-10-09 Thread ZhiHua Huang
Hello Scott,

I did some searching with these symbols, they should be in 'libos.a'.

rtpLib.o - rtpVerifyAndLock

pgMgrLib.o - pgMgrPageFree, pgMgrPageAllocAt

you should modify kernel components with your VIP project.

Best Regards,

Huang ZhiHua

2010/10/9 Scott A Mintz 

> Thank you.  Those changes (modified slightly for 3.7.2) allowed me to
> create a DKM project that compiles sqlite3.c to libSQLite3.a.
>
> However, when I link my main VIP project, I get the following unresolved
> errors:
> dld: warning: Undefined symbol 'rtpVerifyAndLock' in file 'partialImage.o'
> dld: warning: Undefined symbol 'pgMgrPageFree' in file 'partialImage.o'
> dld: warning: Undefined symbol 'pgMgrPageAllocAt' in file 'partialImage.o'
>
> Those are not directly used by SQLite.  But I have a feeling that one or
> more of the file I/O, semaphore, locking, or memory library system calls
> are...
>
> -Scott
>
> sqlite-users-boun...@sqlite.org wrote on 10/08/2010 07:38:45 AM:
>
> > Hello Scott,
> >
> > Below is my patch on the latest SQLite 3.7.3. Please notice that I
> only
> > verify it with GCC 4.1.2 compiler in VxWorks 6.6/6.7/6.8(I have not
> verify
> > it with my real target machine yet).
> >
> > *** sqlite3.c.orig2010-10-08 10:42:22.0 +0800
> > --- sqlite3.c2010-10-08 19:24:18.390625000 +0800
> > ***
> > *** 17,22 
> > --- 17,26 
> >   ** language. The code for the "sqlite3" command-line shell is also in
> a
> >   ** separate file. This file contains only code for the core SQLite
> > library.
> >   */
> > + #if defined(OS_VXWORKS)
> > + #include 
> > + #endif /* OS_VXWORKS */
> > +
> >   #define SQLITE_CORE 1
> >   #define SQLITE_AMALGAMATION 1
> >   #ifndef SQLITE_PRIVATE
> > ***
> > *** 22795,22801 
> > --- 22799,22811 
> >   #include 
> >   #include 
> >   #include 
> > +
> > + #if defined(OS_VXWORKS) && defined(_WRS_KERNEL)
> > + #include 
> > + #else
> >   #include 
> > + #endif /* OS_VXWORKS */
> > +
> >   #include 
> >   #include 
> >
> > ***
> > *** 24945,24951 
> > --- 24955,24965 
> >   /*
> >** Close a file.
> >*/
> > + #if (OS_VXWORKS < 600)
> >   static int semClose(sqlite3_file *id) {
> > + #else
> > + static int semClose_native(sqlite3_file *id) {
> > + #endif
> > if( id ){
> >   unixFile *pFile = (unixFile*)id;
> >   semUnlock(id, NO_LOCK);
> > ***
> > *** 25581,25587 
> > --- 25595,25607 
> >   }
> >   return -1;
> > }
> > +
> > + #if defined(OS_VXWORKS) && defined(_WRS_KERNEL)
> > +   got = write(id->h, (char *)pBuf, cnt);
> > + #else
> > got = write(id->h, pBuf, cnt);
> > + #endif /* OS_VXWORKS */
> > +
> >   #endif
> > TIMER_END;
> > if( got<0 ){
> > ***
> > *** 26762,26768 
> > --- 26782,26792 
> > semIoFinder,  /* Finder function name */
> > semIoMethods, /* sqlite3_io_methods object name */
> > 1,/* shared memory is disabled */
> > + #if (OS_VXWORKS < 600)
> > semClose, /* xClose method */
> > + #else
> > +   semClose_native,  /* xClose method */
> > + #endif
> > semLock,  /* xLock method */
> > semUnlock,/* xUnlock method */
> > semCheckReservedLock  /* xCheckReservedLock method */
> > ***
> > *** 27517,27523 
> > noLock = eType!=SQLITE_OPEN_MAIN_DB;
> >
> >
> > ! #if defined(__APPLE__) || SQLITE_ENABLE_LOCKING_STYLE
> > struct statfs fsInfo;
> > if( fstatfs(fd, &fsInfo) == -1 ){
> >   ((unixFile*)pFile)->lastErrno = errno;
> > --- 27541,27547 
> > noLock = eType!=SQLITE_OPEN_MAIN_DB;
> >
> >
> > ! #if (defined(__APPLE__) || SQLITE_ENABLE_LOCKING_STYLE) &&
> > !defined(OS_VXWORKS)
> > struct statfs fsInfo;
> > if( fstatfs(fd, &fsInfo) == -1 ){
> >   ((unixFile*)pFile)->lastErrno = errno;
> > ***
> > *** 27530,27536 
> > }
> >   #endif
> >
> > ! #if SQLITE_ENABLE_LOCKING_STYLE
> >   #if SQLITE_PREFER_PROXY_LOCKING
> > isAutoProxy = 1;
> >   #endif
> > --- 27554,27560 
> > }
> >   #endif
> >
> > ! #if SQLITE_ENABLE_LOCKING_STYLE && !OS_VXWORKS
> >   #if SQLITE_PREFER_PROXY_LOCKING
> > isAutoProxy = 1;
> >   #endif
> > ***
> > *** 27793,27799 
> > ** tests repeatable.
> > */
> > memset(zBuf, 0, nBuf);
> > ! #if !defined(SQLITE_TEST)
> > {
> >   int pid, fd;
> >   fd = open("/dev/urandom", O_RDONLY);
> > --- 27817,27823 
> > ** tests repeatable.
> > */
> > memset(zBuf, 0, nBuf);
> > ! #if !defined(SQLITE_TEST) && !defined(OS_VXWORKS)
> > {
> >   int pid, fd;
> >   fd = open("/dev/urandom", O_RDONLY);
> >
> > I'v used definitions as below:
> >
> > EXTRA_DEFINE+=-DOS_VXWORKS_660=660
> > EXTRA_DEFINE+=-DOS_VXWORKS_670=670
> > EXTRA_DEFINE+=-DOS_VXWORKS_680=680
> > EXTRA_DEFINE+=-DOS_VXWORKS=OS_VXWORKS_670
> > EXTRA_

Re: [sqlite] Porting SQLite 3.7.2 to vxWorks 6.7

2010-10-08 Thread Scott A Mintz
Thank you.  Those changes (modified slightly for 3.7.2) allowed me to 
create a DKM project that compiles sqlite3.c to libSQLite3.a.

However, when I link my main VIP project, I get the following unresolved 
errors:
dld: warning: Undefined symbol 'rtpVerifyAndLock' in file 'partialImage.o'
dld: warning: Undefined symbol 'pgMgrPageFree' in file 'partialImage.o'
dld: warning: Undefined symbol 'pgMgrPageAllocAt' in file 'partialImage.o'

Those are not directly used by SQLite.  But I have a feeling that one or 
more of the file I/O, semaphore, locking, or memory library system calls 
are...

-Scott

sqlite-users-boun...@sqlite.org wrote on 10/08/2010 07:38:45 AM:

> Hello Scott,
> 
> Below is my patch on the latest SQLite 3.7.3. Please notice that I 
only
> verify it with GCC 4.1.2 compiler in VxWorks 6.6/6.7/6.8(I have not 
verify
> it with my real target machine yet).
> 
> *** sqlite3.c.orig2010-10-08 10:42:22.0 +0800
> --- sqlite3.c2010-10-08 19:24:18.390625000 +0800
> ***
> *** 17,22 
> --- 17,26 
>   ** language. The code for the "sqlite3" command-line shell is also in 
a
>   ** separate file. This file contains only code for the core SQLite
> library.
>   */
> + #if defined(OS_VXWORKS)
> + #include 
> + #endif /* OS_VXWORKS */
> +
>   #define SQLITE_CORE 1
>   #define SQLITE_AMALGAMATION 1
>   #ifndef SQLITE_PRIVATE
> ***
> *** 22795,22801 
> --- 22799,22811 
>   #include 
>   #include 
>   #include 
> +
> + #if defined(OS_VXWORKS) && defined(_WRS_KERNEL)
> + #include 
> + #else
>   #include 
> + #endif /* OS_VXWORKS */
> +
>   #include 
>   #include 
> 
> ***
> *** 24945,24951 
> --- 24955,24965 
>   /*
>** Close a file.
>*/
> + #if (OS_VXWORKS < 600)
>   static int semClose(sqlite3_file *id) {
> + #else
> + static int semClose_native(sqlite3_file *id) {
> + #endif
> if( id ){
>   unixFile *pFile = (unixFile*)id;
>   semUnlock(id, NO_LOCK);
> ***
> *** 25581,25587 
> --- 25595,25607 
>   }
>   return -1;
> }
> +
> + #if defined(OS_VXWORKS) && defined(_WRS_KERNEL)
> +   got = write(id->h, (char *)pBuf, cnt);
> + #else
> got = write(id->h, pBuf, cnt);
> + #endif /* OS_VXWORKS */
> +
>   #endif
> TIMER_END;
> if( got<0 ){
> ***
> *** 26762,26768 
> --- 26782,26792 
> semIoFinder,  /* Finder function name */
> semIoMethods, /* sqlite3_io_methods object name */
> 1,/* shared memory is disabled */
> + #if (OS_VXWORKS < 600)
> semClose, /* xClose method */
> + #else
> +   semClose_native,  /* xClose method */
> + #endif
> semLock,  /* xLock method */
> semUnlock,/* xUnlock method */
> semCheckReservedLock  /* xCheckReservedLock method */
> ***
> *** 27517,27523 
> noLock = eType!=SQLITE_OPEN_MAIN_DB;
> 
> 
> ! #if defined(__APPLE__) || SQLITE_ENABLE_LOCKING_STYLE
> struct statfs fsInfo;
> if( fstatfs(fd, &fsInfo) == -1 ){
>   ((unixFile*)pFile)->lastErrno = errno;
> --- 27541,27547 
> noLock = eType!=SQLITE_OPEN_MAIN_DB;
> 
> 
> ! #if (defined(__APPLE__) || SQLITE_ENABLE_LOCKING_STYLE) &&
> !defined(OS_VXWORKS)
> struct statfs fsInfo;
> if( fstatfs(fd, &fsInfo) == -1 ){
>   ((unixFile*)pFile)->lastErrno = errno;
> ***
> *** 27530,27536 
> }
>   #endif
> 
> ! #if SQLITE_ENABLE_LOCKING_STYLE
>   #if SQLITE_PREFER_PROXY_LOCKING
> isAutoProxy = 1;
>   #endif
> --- 27554,27560 
> }
>   #endif
> 
> ! #if SQLITE_ENABLE_LOCKING_STYLE && !OS_VXWORKS
>   #if SQLITE_PREFER_PROXY_LOCKING
> isAutoProxy = 1;
>   #endif
> ***
> *** 27793,27799 
> ** tests repeatable.
> */
> memset(zBuf, 0, nBuf);
> ! #if !defined(SQLITE_TEST)
> {
>   int pid, fd;
>   fd = open("/dev/urandom", O_RDONLY);
> --- 27817,27823 
> ** tests repeatable.
> */
> memset(zBuf, 0, nBuf);
> ! #if !defined(SQLITE_TEST) && !defined(OS_VXWORKS)
> {
>   int pid, fd;
>   fd = open("/dev/urandom", O_RDONLY);
> 
> I'v used definitions as below:
> 
> EXTRA_DEFINE+=-DOS_VXWORKS_660=660
> EXTRA_DEFINE+=-DOS_VXWORKS_670=670
> EXTRA_DEFINE+=-DOS_VXWORKS_680=680
> EXTRA_DEFINE+=-DOS_VXWORKS=OS_VXWORKS_670
> EXTRA_DEFINE+=-DSQLITE_HOMEGROWN_RECURSIVE_MUTEX
> EXTRA_DEFINE+=-DSQLITE_ENABLE_LOCKING_STYLE=1
> EXTRA_DEFINE+=-DSQLITE_OMIT_LOAD_EXTENSION
> 
> 
> Best Regards,
> 
> Huang Zhihua
> 
> 2010/10/8 Scott A Mintz 
> 
> > I searched through all the mail archives to see if I could find 
someone
> > that has ported SQLite to vxWorks in kernel mode.  Apparently, there 
are a
> > few folks attempting it.  And fewer succeeding at it.
> >
> > I found an article published by ZhiHua Huang where he describes the 
mods
> > he made to port SQLite 3.6.23.1 to vxWorks 6.5
> >

Re: [sqlite] Porting SQLite 3.7.2 to vxWorks 6.7

2010-10-08 Thread ZhiHua Huang
Hello Scott,

Below is my patch on the latest SQLite 3.7.3. Please notice that I only
verify it with GCC 4.1.2 compiler in VxWorks 6.6/6.7/6.8(I have not verify
it with my real target machine yet).

*** sqlite3.c.orig2010-10-08 10:42:22.0 +0800
--- sqlite3.c2010-10-08 19:24:18.390625000 +0800
***
*** 17,22 
--- 17,26 
  ** language. The code for the "sqlite3" command-line shell is also in a
  ** separate file. This file contains only code for the core SQLite
library.
  */
+ #if defined(OS_VXWORKS)
+ #include 
+ #endif /* OS_VXWORKS */
+
  #define SQLITE_CORE 1
  #define SQLITE_AMALGAMATION 1
  #ifndef SQLITE_PRIVATE
***
*** 22795,22801 
--- 22799,22811 
  #include 
  #include 
  #include 
+
+ #if defined(OS_VXWORKS) && defined(_WRS_KERNEL)
+ #include 
+ #else
  #include 
+ #endif /* OS_VXWORKS */
+
  #include 
  #include 

***
*** 24945,24951 
--- 24955,24965 
  /*
   ** Close a file.
   */
+ #if (OS_VXWORKS < 600)
  static int semClose(sqlite3_file *id) {
+ #else
+ static int semClose_native(sqlite3_file *id) {
+ #endif
if( id ){
  unixFile *pFile = (unixFile*)id;
  semUnlock(id, NO_LOCK);
***
*** 25581,25587 
--- 25595,25607 
  }
  return -1;
}
+
+ #if defined(OS_VXWORKS) && defined(_WRS_KERNEL)
+   got = write(id->h, (char *)pBuf, cnt);
+ #else
got = write(id->h, pBuf, cnt);
+ #endif /* OS_VXWORKS */
+
  #endif
TIMER_END;
if( got<0 ){
***
*** 26762,26768 
--- 26782,26792 
semIoFinder,  /* Finder function name */
semIoMethods, /* sqlite3_io_methods object name */
1,/* shared memory is disabled */
+ #if (OS_VXWORKS < 600)
semClose, /* xClose method */
+ #else
+   semClose_native,  /* xClose method */
+ #endif
semLock,  /* xLock method */
semUnlock,/* xUnlock method */
semCheckReservedLock  /* xCheckReservedLock method */
***
*** 27517,27523 
noLock = eType!=SQLITE_OPEN_MAIN_DB;


! #if defined(__APPLE__) || SQLITE_ENABLE_LOCKING_STYLE
struct statfs fsInfo;
if( fstatfs(fd, &fsInfo) == -1 ){
  ((unixFile*)pFile)->lastErrno = errno;
--- 27541,27547 
noLock = eType!=SQLITE_OPEN_MAIN_DB;


! #if (defined(__APPLE__) || SQLITE_ENABLE_LOCKING_STYLE) &&
!defined(OS_VXWORKS)
struct statfs fsInfo;
if( fstatfs(fd, &fsInfo) == -1 ){
  ((unixFile*)pFile)->lastErrno = errno;
***
*** 27530,27536 
}
  #endif

! #if SQLITE_ENABLE_LOCKING_STYLE
  #if SQLITE_PREFER_PROXY_LOCKING
isAutoProxy = 1;
  #endif
--- 27554,27560 
}
  #endif

! #if SQLITE_ENABLE_LOCKING_STYLE && !OS_VXWORKS
  #if SQLITE_PREFER_PROXY_LOCKING
isAutoProxy = 1;
  #endif
***
*** 27793,27799 
** tests repeatable.
*/
memset(zBuf, 0, nBuf);
! #if !defined(SQLITE_TEST)
{
  int pid, fd;
  fd = open("/dev/urandom", O_RDONLY);
--- 27817,27823 
** tests repeatable.
*/
memset(zBuf, 0, nBuf);
! #if !defined(SQLITE_TEST) && !defined(OS_VXWORKS)
{
  int pid, fd;
  fd = open("/dev/urandom", O_RDONLY);

I'v used definitions as below:

EXTRA_DEFINE+=-DOS_VXWORKS_660=660
EXTRA_DEFINE+=-DOS_VXWORKS_670=670
EXTRA_DEFINE+=-DOS_VXWORKS_680=680
EXTRA_DEFINE+=-DOS_VXWORKS=OS_VXWORKS_670
EXTRA_DEFINE+=-DSQLITE_HOMEGROWN_RECURSIVE_MUTEX
EXTRA_DEFINE+=-DSQLITE_ENABLE_LOCKING_STYLE=1
EXTRA_DEFINE+=-DSQLITE_OMIT_LOAD_EXTENSION


Best Regards,

Huang Zhihua

2010/10/8 Scott A Mintz 

> I searched through all the mail archives to see if I could find someone
> that has ported SQLite to vxWorks in kernel mode.  Apparently, there are a
> few folks attempting it.  And fewer succeeding at it.
>
> I found an article published by ZhiHua Huang where he describes the mods
> he made to port SQLite 3.6.23.1 to vxWorks 6.5
> http://www.mail-archive.com/sqlite-users@sqlite.org/msg51531.html
>
> Using that as a starting point, I modified my files but I get the
> following errors:
> "C:/CCViews/Mintz_NetlinxUCS_L7x/NetLinxUCS/SQLite3_LIB/sqlite3.c", line
> 27262: error (dcc:1633): parse error  near 'struct'
> "C:/CCViews/Mintz_NetlinxUCS_L7x/NetLinxUCS/SQLite3_LIB/sqlite3.c", line
> 27262: error (dcc:1206): syntax error
> "C:/CCViews/Mintz_NetlinxUCS_L7x/NetLinxUCS/SQLite3_LIB/sqlite3.c", line
> 27262: fatal error (dcc:1340): can't recover from earlier errors
>
> This is the code it's complaining about.  The "struct statfs fsInfo;" line
> is line 27262.
>
> #ifdef FD_CLOEXEC
>  fcntl(fd, F_SETFD, fcntl(fd, F_GETFD, 0) | FD_CLOEXEC);
> #endif
>
>  noLock = eType!=SQLITE_OPEN_MAIN_DB;
>
>
> #if defined(__APPLE__) || SQLITE_ENABLE_LOCKING_STYLE
>  struct statfs fsInfo;
>  if( fstatfs(fd, &fsInfo) == -1 ){
>((unixFile*)pFile)->lastErrno = errno;
>if( dirfd>=0 ) close(dirfd); /* silently leak if fa

[sqlite] Porting SQLite 3.7.2 to vxWorks 6.7

2010-10-07 Thread Scott A Mintz
I searched through all the mail archives to see if I could find someone 
that has ported SQLite to vxWorks in kernel mode.  Apparently, there are a 
few folks attempting it.  And fewer succeeding at it.

I found an article published by ZhiHua Huang where he describes the mods 
he made to port SQLite 3.6.23.1 to vxWorks 6.5 
http://www.mail-archive.com/sqlite-users@sqlite.org/msg51531.html 

Using that as a starting point, I modified my files but I get the 
following errors:
"C:/CCViews/Mintz_NetlinxUCS_L7x/NetLinxUCS/SQLite3_LIB/sqlite3.c", line 
27262: error (dcc:1633): parse error  near 'struct'
"C:/CCViews/Mintz_NetlinxUCS_L7x/NetLinxUCS/SQLite3_LIB/sqlite3.c", line 
27262: error (dcc:1206): syntax error
"C:/CCViews/Mintz_NetlinxUCS_L7x/NetLinxUCS/SQLite3_LIB/sqlite3.c", line 
27262: fatal error (dcc:1340): can't recover from earlier errors

This is the code it's complaining about.  The "struct statfs fsInfo;" line 
is line 27262.

#ifdef FD_CLOEXEC
  fcntl(fd, F_SETFD, fcntl(fd, F_GETFD, 0) | FD_CLOEXEC);
#endif

  noLock = eType!=SQLITE_OPEN_MAIN_DB;

 
#if defined(__APPLE__) || SQLITE_ENABLE_LOCKING_STYLE
  struct statfs fsInfo;
  if( fstatfs(fd, &fsInfo) == -1 ){
((unixFile*)pFile)->lastErrno = errno;
if( dirfd>=0 ) close(dirfd); /* silently leak if fail, in error */
close(fd); /* silently leak if fail, in error */
return SQLITE_IOERR_ACCESS;
  }
  if (0 == strncmp("msdos", fsInfo.f_fstypename, 5)) {
((unixFile*)pFile)->fsFlags |= SQLITE_FSFLAGS_IS_MSDOS;
  }
#endif

Any ideas?

-Scott
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users