On 06/21/2018 04:53 PM, Bob Friesenhahn wrote:
On Thu, 21 Jun 2018, Richard Hipp wrote:
.
sqlite3.c:
"sqlite3.c", line 20826: warning: implicit function declaration:
localtime_r (E_NO_IMPLICIT_DECL_ALLOWED)

According to my manpage for localtime_r(), the only header file
required is <time.h>, which you can clearly see is found on line
20342, above the declaration that offends your compiler.  Perhaps you
can suggest what is going wrong, because I have no clue.

It is most likely that sqlite is getting a preprocessor declaration for the requested ABI wrong.  The Linux manual page for localtime_r() says that its declaration depends on

_POSIX_C_SOURCE >= 1 || _XOPEN_SOURCE || _BSD_SOURCE || _SVID_SOURCE || _POSIX_SOURCE

but Solaris is proven to be Unix-compliant so the rules could be somewhat different.

I think you are on to something here. I keep detailed notes and logs on
every piece of software that I look at. The last time that I had built
sqlite and rolled it into production sites would be from the "autoconf"
pack sqlite-autoconf-3200100.[1] I still find it bizarre that sqlite has
multiple different tarballs and zip files with and without various bits
but that is a whole other discussion. Mostly I just want to be able to
compile from source and then verify with tests that the result is a good
result. There are pages of docs on this sort of topic on the sqlite site
but nothing clearly ( https://www.sqlite.org/testing.html ) says where
the tests are and exactly what to do in order to have them run for a
reasonable person. I have emails on this exact topic going back years
and Richard Hipp has been patient enough to tell me to not use the
tarball called "autoconf" because the tests are stripped out.  So that
explains why I use the full zip file.

So I am going to revert back to using the c99 compiler from the Oracle
Studio 12.6 compiler tools and also set POSIXLY_CORRECT=1 in the build
environment.  That is really harsh but from experience the sqlite code
is so squeaky clean that there shouldn't be a problem.

Also :

CC=/opt/developerstudio12.6/bin/c99

CFLAGS=-m64 -xarch=sparc -errwarn=%none -erroff=%none -errtags=yes
 -errfmt=error -errshort=full -xstrconst -xildoff -xmemalign=8s
 -xnolibmil -Xc -xcode=pic32 -xregs=no%appl -xlibmieee -mc -g -xs
 -ftrap=%none -Qy -xbuiltin=%none -xdebugformat=dwarf -xunroll=1

I won't go into a long discussion on why those flags makes good and
reasonable sense for a dev environment where I will want to debug or
single step my way through code. Suffice it to say that the results
have been tested to the n-th degree over a decade and I get very
very stable and very very conservative results.

n0$ ./configure --enable-shared --enable-static --enable-readline \
> --enable-threadsafe
checking build system type... sparc-sun-solaris2.10
checking host system type... sparc-sun-solaris2.10
checking for gcc... /opt/developerstudio12.6/bin/c99
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... no
checking whether /opt/developerstudio12.6/bin/c99 accepts -g... yes
checking for /opt/developerstudio12.6/bin/c99 option to accept ISO C89... none needed
checking for a sed that does not truncate output... /usr/local/bin/sed
checking for grep that handles long lines and -e... /usr/local/bin/grep
checking for egrep... /usr/local/bin/grep -E
checking for fgrep... /usr/local/bin/grep -F
checking for non-GNU ld... /usr/ccs/bin/sparcv9/ld
checking if the linker (/usr/ccs/bin/sparcv9/ld) is GNU ld... no
checking for BSD- or MS-compatible name lister (nm)... /usr/xpg4/bin/nm -p
checking the name lister (/usr/xpg4/bin/nm -p) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 786240
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking for /usr/ccs/bin/sparcv9/ld option to reload object files... -r
checking for objdump... no
checking how to recognize dependent libraries... pass_all
checking for ar... /usr/ccs/bin/ar
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/xpg4/bin/nm -p output from /opt/developerstudio12.6/bin/c99 object... ok checking how to run the C preprocessor... /opt/developerstudio12.6/bin/c99 -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking for /opt/developerstudio12.6/bin/c99 option to produce PIC... -KPIC -DPIC checking if /opt/developerstudio12.6/bin/c99 PIC flag -KPIC -DPIC works... yes checking if /opt/developerstudio12.6/bin/c99 static flag -Bstatic works... yes
checking if /opt/developerstudio12.6/bin/c99 supports -c -o file.o... yes
checking if /opt/developerstudio12.6/bin/c99 supports -c -o file.o... (cached) yes checking whether the /opt/developerstudio12.6/bin/c99 linker (/usr/ccs/bin/sparcv9/ld -64) supports shared libraries... yes
checking dynamic linker characteristics... solaris2.10 ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... no
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for a BSD-compatible install... ./install-sh -c
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking for int8_t... yes
checking for int16_t... yes
checking for int32_t... yes
checking for int64_t... yes
checking for intptr_t... yes
checking for uint8_t... yes
checking for uint16_t... yes
checking for uint32_t... yes
checking for uint64_t... yes
checking for uintptr_t... yes
checking for sys/types.h... (cached) yes
checking for stdlib.h... (cached) yes
checking for stdint.h... (cached) yes
checking for inttypes.h... (cached) yes
checking malloc.h usability... yes
checking malloc.h presence... yes
checking for malloc.h... yes
checking for fdatasync... yes
checking for gmtime_r... yes
checking for isnan... yes
checking for localtime_r... yes
checking for localtime_s... no
checking for malloc_usable_size... no
checking for strchrnul... no
checking for usleep... yes
checking for utime... yes
checking for pread... yes
checking for pread64... no
checking for pwrite... yes
checking for pwrite64... no
checking for tclsh8.7... no
checking for tclsh8.6... tclsh8.6
configure: Version set to 3.24
configure: Release set to 3.24.0
configure: Version number set to 3024000
checking whether to support threadsafe operation... yes
checking for library containing pthread_create... none required
checking for library containing pthread_mutexattr_init... none required
checking whether to support shared library linked as release mode or not... no
checking whether to use an in-ram database for temporary tables... no
checking if executables have the .exe suffix... unknown
checking for Tcl configuration... found /usr/local/lib/tclConfig.sh
checking for existence of /usr/local/lib/tclConfig.sh... loading
checking for library containing readline... no
checking for library containing tgetent... -lncurses
checking for readline in -lreadline... yes
checking readline.h usability... no
checking readline.h presence... no
checking for readline.h... no
checking for /usr/include/readline.h... no
checking for /usr/include/readline/readline.h... no
checking for /usr/local/include/readline.h... no
checking for /usr/local/include/readline/readline.h... yes
checking for library containing fdatasync... none required
checking zlib.h usability... yes
checking zlib.h presence... yes
checking for zlib.h... yes
checking for library containing deflate... -lz
checking for library containing dlopen... none required
checking whether to support MEMSYS5... no
checking whether to support MEMSYS3... no
configure: creating ./config.status
config.status: creating Makefile
config.status: creating sqlite3.pc
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing libtool commands
n0$

Looks wonderful.

Running "gmake" I see a few oddball warnings again :

"sqlite3.c", line 20826: warning: implicit function declaration: localtime_r (E_NO_IMPLICIT_DECL_ALLOWED) "sqlite3.c", line 52491: warning: statement not reached (E_STATEMENT_NOT_REACHED)

"shell.c", line 11188: warning: implicit function declaration: strdup (E_NO_IMPLICIT_DECL_ALLOWED) "shell.c", line 11188: warning: improper pointer/integer combination: op "=" (E_BAD_PTR_INT_COMBINATION)
sqlite3.c:
"sqlite3.c", line 20826: warning: implicit function declaration: localtime_r (E_NO_IMPLICIT_DECL_ALLOWED) "sqlite3.c", line 52491: warning: statement not reached (E_STATEMENT_NOT_REACHED)

I get what I expect :

n0$ ls -lapb .libs/
total 7915
drwxr-xr-x   2 dclarke  devl          14 Jun 21 20:07 ./
drwxr-xr-x  16 dclarke  devl          74 Jun 21 20:07 ../
-rw-r--r--   1 dclarke  devl     3038616 Jun 21 20:06 libsqlite3.a
lrwxrwxrwx 1 dclarke devl 16 Jun 21 20:06 libsqlite3.la -> ../libsqlite3.la
-rw-r--r--   1 dclarke  devl         961 Jun 21 20:06 libsqlite3.lai
lrwxrwxrwx 1 dclarke devl 19 Jun 21 20:06 libsqlite3.so -> libsqlite3.so.0.8.6* lrwxrwxrwx 1 dclarke devl 19 Jun 21 20:06 libsqlite3.so.0 -> libsqlite3.so.0.8.6*
-rwxr-xr-x   1 dclarke  devl     2079512 Jun 21 20:06 libsqlite3.so.0.8.6
-rw-r--r--   1 dclarke  devl      212160 Jun 21 20:07 libtclsqlite3.a
lrwxrwxrwx 1 dclarke devl 19 Jun 21 20:07 libtclsqlite3.la -> ../libtclsqlite3.la
-rw-r--r--   1 dclarke  devl        1029 Jun 21 20:07 libtclsqlite3.lai
-rwxr-xr-x   1 dclarke  devl      217824 Jun 21 20:07 libtclsqlite3.so
-rw-r--r--   1 dclarke  devl     3028256 Jun 21 20:06 sqlite3.o
-rw-r--r--   1 dclarke  devl      211640 Jun 21 20:07 tclsqlite.o

So then a quick edit of the Makefile to add "-lrt" in there :

n0$ diff Makefile.backup Makefile
70c70
< TLIBS = -lz  $(LIBS)
---
> TLIBS = -lz -lrt $(LIBS)
n0$

ta da !   beautiful results :

.
.
.
SQLite 2018-06-04 19:24:41 c7ee0833225bfd8c5ec2f9bf62b97c4e04d03bd9566366d5221ac8fb199a87ca
0 errors out of 144287 tests on node000 SunOS 64-bit big-endian
All memory allocations freed - no leaks
Maximum memory usage: 9275952 bytes
Current memory usage: 0 bytes
Number of malloc()  : -1 calls

So now I will reproduce this across a few other systems and just be
happy.

Dennis Clarke

[1] actually rolled into production on various risc platforms and
     multiple flavors of linux and unix types.
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to