Bugs item #3601758, was opened at 2013-01-22 06:06
Message generated for change (Comment added) made by mhoenicka
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=512945&aid=3601758&group_id=65979

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: rjanowsk (rjanowsk)
>Assigned to: Markus Hoenicka (mhoenicka)
Summary: error when cross-compiling dbd_sqlite3.c

Initial Comment:
Hello I am having an error when cross-compiling libdbi-drivers with sqlite3. I 
am cross-compiling libdbi-drivers for ARM platform in the following environment:
Compilation is done with: arm-linux-uclibc-gcc version 4.1.2. 
Build platform is: Ubuntu 12.04


When doing make I encounter the following error:

dbd_sqlite3.c:70: warning: excess elements in scalar initializer
dbd_sqlite3.c:70: warning: (near initialization for 'reserved_words')
dbd_sqlite3.c:70: warning: excess elements in scalar initializer
dbd_sqlite3.c:70: warning: (near initialization for 'reserved_words')
dbd_sqlite3.c:70: warning: excess elements in scalar initializer
dbd_sqlite3.c:70: warning: (near initialization for 'reserved_words')
dbd_sqlite3.c:70: warning: excess elements in scalar initializer
dbd_sqlite3.c:70: warning: (near initialization for 'reserved_words')
dbd_sqlite3.c:70: warning: excess elements in scalar initializer
dbd_sqlite3.c:70: warning: (near initialization for 'reserved_words')
dbd_sqlite3.c:70: warning: excess elements in scalar initializer
dbd_sqlite3.c:70: warning: (near initialization for 'reserved_words')
dbd_sqlite3.c:73: error: storage class specified for parameter 
'sqlite3_encoding_UTF8'
dbd_sqlite3.c:73: error: parameter 'sqlite3_encoding_UTF8' is initialized
dbd_sqlite3.c:74: error: storage class specified for parameter 
'sqlite3_encoding_UTF16'
dbd_sqlite3.c:74: error: parameter 'sqlite3_encoding_UTF16' is initialized
dbd_sqlite3.c:80: error: expected ')' before '*' token
dbd_sqlite3.c:82: error: expected ')' before '*' token
dbd_sqlite3.c:83: error: expected declaration specifiers or '...' before 
'dbi_conn_t'
dbd_sqlite3.c:85: error: storage class specified for parameter 
'sqlite3_escape_string'
dbd_sqlite3.c:92: error: expected ';', ',' or ')' before '*' token
dbd_sqlite3.c:99: error: expected ')' before '*' token
dbd_sqlite3.c:111: error: expected ')' before '*' token
dbd_sqlite3.c:116: error: expected ')' before '*' token
dbd_sqlite3.c:235: error: expected ')' before '*' token
dbd_sqlite3.c:249: error: expected ')' before '*' token
dbd_sqlite3.c:266: error: expected ')' before '*' token
dbd_sqlite3.c:273: error: expected ')' before '*' token
dbd_sqlite3.c:278: error: expected ')' before '*' token
dbd_sqlite3.c:283: error: expected ')' before '*' token
dbd_sqlite3.c:299: error: expected '=', ',', ';', 'asm' or '__attribute__' 
before '{' token
dbd_sqlite3.c:304: error: expected '=', ',', ';', 'asm' or '__attribute__' 
before '{' token
dbd_sqlite3.c:309: error: expected ')' before '*' token
dbd_sqlite3.c:330: error: expected declaration specifiers before 'dbi_result_t'
dbd_sqlite3.c:427: error: expected declaration specifiers before 'dbi_result_t'
dbd_sqlite3.c:486: error: expected ')' before '*' token
dbd_sqlite3.c:497: error: expected ')' before '*' token
dbd_sqlite3.c:501: error: expected ')' before '*' token
dbd_sqlite3.c:523: error: expected declaration specifiers before 'dbi_result_t'
dbd_sqlite3.c:580: error: expected declaration specifiers before 'dbi_result_t'
dbd_sqlite3.c:585: error: expected declaration specifiers or '...' before 
'dbi_conn_t'
dbd_sqlite3.c:585: error: expected '=', ',', ';', 'asm' or '__attribute__' 
before '{' token
dbd_sqlite3.c:832: error: expected '=', ',', ';', 'asm' or '__attribute__' 
before '{' token
dbd_sqlite3.c:860: error: expected ')' before '*' token
dbd_sqlite3.c:883: error: expected ')' before '*' token
dbd_sqlite3.c:893: error: expected ')' before '*' token
dbd_sqlite3.c:897: error: expected ')' before '*' token
dbd_sqlite3.c:902: error: expected ')' before '*' token
dbd_sqlite3.c:914: error: expected '=', ',', ';', 'asm' or '__attribute__' 
before '{' token
dbd_sqlite3.c:991: error: expected ')' before '*' token
dbd_sqlite3.c:1075: error: expected '=', ',', ';', 'asm' or '__attribute__' 
before '{' token
dbd_sqlite3.c:1157: error: expected '=', ',', ';', 'asm' or '__attribute__' 
before '{' token
dbd_sqlite3.c:1182: error: old-style parameter declarations in prototyped 
function definition
dbd_sqlite3.c:1182: error: expected '{' at end of input
make[3]: *** [dbd_sqlite3.lo] Błąd 1
...

Configure options that I use are the following:
./configure --build=i686-pc-linux-gnu --host=arm-linux --target=arm-linux 
--prefix=/home/compiled/out-libdbi-drivers --with-sqlite3 
--with-sqlite3-dir=/home/user/ARMLinux2 
CC=/home/user/ARMLinux2/bin/arm-linux-gcc

Configure output is the following:
checking whether to enable maintainer-specific portions of Makefiles... no
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking for arm-linux-strip... no
checking for strip... strip
configure: WARNING: In the future, Autoconf will not detect cross-tools
whose name does not start with the host triplet.  If you think this
configuration is useful to you, please write to autoc...@gnu.org.
checking build system type... i686-pc-linux-gnu
checking host system type... arm-unknown-linux-gnu
checking for arm-linux-gcc... /home/user/ARMLinux2/bin/arm-linux-gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... yes
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether /home/user/ARMLinux2/bin/arm-linux-gcc accepts -g... yes
checking for /home/user/ARMLinux2/bin/arm-linux-gcc option to accept ISO C89... 
none needed
checking for style of include used by make... GNU
checking dependency style of /home/user/ARMLinux2/bin/arm-linux-gcc... gcc3
checking how to run the C preprocessor... 
/home/user/ARMLinux2/bin/arm-linux-gcc -E
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ld used by /home/user/ARMLinux2/bin/arm-linux-gcc... 
/home/user/ARMLinux2/arm-linux-uclibc/bin/ld
checking if the linker (/home/user/ARMLinux2/arm-linux-uclibc/bin/ld) is GNU 
ld... yes
checking for a BSD-compatible install... /usr/bin/install -c
checking for /home/user/ARMLinux2/arm-linux-uclibc/bin/ld option to reload 
object files... -r
checking for BSD-compatible nm... nm
checking whether ln -s works... yes
checking how to recognise dependent libraries... pass_all
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 dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking for arm-linux-g++... no
checking for arm-linux-c++... no
checking for arm-linux-gpp... no
checking for arm-linux-aCC... no
checking for arm-linux-CC... no
checking for arm-linux-cxx... no
checking for arm-linux-cc++... no
checking for arm-linux-cl.exe... no
checking for arm-linux-FCC... no
checking for arm-linux-KCC... no
checking for arm-linux-RCC... no
checking for arm-linux-xlC_r... no
checking for arm-linux-xlC... no
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking how to run the C++ preprocessor... g++ -E
checking for arm-linux-g77... no
checking for arm-linux-xlf... no
checking for arm-linux-f77... no
checking for arm-linux-frt... no
checking for arm-linux-pgf77... no
checking for arm-linux-cf77... no
checking for arm-linux-fort77... no
checking for arm-linux-fl32... no
checking for arm-linux-af77... no
checking for arm-linux-xlf90... no
checking for arm-linux-f90... no
checking for arm-linux-pgf90... no
checking for arm-linux-pghpf... no
checking for arm-linux-epcf90... no
checking for arm-linux-gfortran... no
checking for arm-linux-g95... no
checking for arm-linux-xlf95... no
checking for arm-linux-f95... no
checking for arm-linux-fort... no
checking for arm-linux-ifort... no
checking for arm-linux-ifc... no
checking for arm-linux-efc... no
checking for arm-linux-pgf95... no
checking for arm-linux-lf95... no
checking for arm-linux-ftn... no
checking for g77... no
checking for xlf... no
checking for f77... no
checking for frt... no
checking for pgf77... no
checking for cf77... no
checking for fort77... no
checking for fl32... no
checking for af77... no
checking for xlf90... no
checking for f90... no
checking for pgf90... no
checking for pghpf... no
checking for epcf90... no
checking for gfortran... no
checking for g95... no
checking for xlf95... no
checking for f95... no
checking for fort... no
checking for ifort... no
checking for ifc... no
checking for efc... no
checking for pgf95... no
checking for lf95... no
checking for ftn... no
checking whether we are using the GNU Fortran 77 compiler... no
checking whether  accepts -g... no
checking the maximum length of command line arguments... 32768
checking command to parse nm output from /home/user/ARMLinux2/bin/arm-linux-gcc 
object... ok
checking for objdir... .libs
checking for arm-linux-ar... no
checking for ar... ar
checking for arm-linux-ranlib... no
checking for ranlib... ranlib
checking for arm-linux-strip... strip
checking if /home/user/ARMLinux2/bin/arm-linux-gcc static flag  works... yes
checking if /home/user/ARMLinux2/bin/arm-linux-gcc supports -fno-rtti 
-fno-exceptions... no
checking for /home/user/ARMLinux2/bin/arm-linux-gcc option to produce PIC... 
-fPIC
checking if /home/user/ARMLinux2/bin/arm-linux-gcc PIC flag -fPIC works... yes
checking if /home/user/ARMLinux2/bin/arm-linux-gcc supports -c -o file.o... yes
checking whether the /home/user/ARMLinux2/bin/arm-linux-gcc linker 
(/home/user/ARMLinux2/arm-linux-uclibc/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
configure: creating libtool
appending configuration tag "CXX" to libtool
checking for ld used by g++... /home/user/ARMLinux2/arm-linux-uclibc/bin/ld
checking if the linker (/home/user/ARMLinux2/arm-linux-uclibc/bin/ld) is GNU 
ld... yes
checking whether the g++ linker (/home/user/ARMLinux2/arm-linux-uclibc/bin/ld) 
supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC
checking if g++ PIC flag -fPIC works... yes
checking if g++ supports -c -o file.o... yes
checking whether the g++ linker (/home/user/ARMLinux2/arm-linux-uclibc/bin/ld) 
supports shared libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
appending configuration tag "F77" to libtool
checking for libdbi framework... yes: headers in /usr/include
checking for MySQL support... no
checking for PostgreSQL support... no
checking for SQLite support... no
checking for SQLite3 support... yes: libs in /home/user/ARMLinux2/lib, headers 
in /home/user/ARMLinux2/include
checking for MiniSQL (mSQL) support... no
checking for Oracle support... no
checking for Firebird/Interbase support... no
checking for Freetds support... no
checking for Ingres support... no
checking for strtoll... yes
checking for atoll... yes
checking for vasprintf... yes
checking for asprintf... yes
checking for libdbi library... yes: libs in /usr/lib
checking for string.h... (cached) yes
checking for strings.h... (cached) yes
configure: creating ./config.status
config.status: creating libdbi.spec
config.status: creating Makefile
config.status: WARNING:  Makefile.in seems to ignore the --datarootdir setting
config.status: creating doc/Makefile
config.status: WARNING:  doc/Makefile.in seems to ignore the --datarootdir 
setting
config.status: creating doc/include/Makefile
config.status: WARNING:  doc/include/Makefile.in seems to ignore the 
--datarootdir setting
config.status: creating drivers/Makefile
config.status: WARNING:  drivers/Makefile.in seems to ignore the --datarootdir 
setting
config.status: creating drivers/mysql/Makefile
config.status: WARNING:  drivers/mysql/Makefile.in seems to ignore the 
--datarootdir setting
config.status: creating drivers/pgsql/Makefile
config.status: WARNING:  drivers/pgsql/Makefile.in seems to ignore the 
--datarootdir setting
config.status: creating drivers/sqlite/Makefile
config.status: WARNING:  drivers/sqlite/Makefile.in seems to ignore the 
--datarootdir setting
config.status: creating drivers/sqlite3/Makefile
config.status: WARNING:  drivers/sqlite3/Makefile.in seems to ignore the 
--datarootdir setting
config.status: creating drivers/msql/Makefile
config.status: WARNING:  drivers/msql/Makefile.in seems to ignore the 
--datarootdir setting
config.status: creating drivers/oracle/Makefile
config.status: WARNING:  drivers/oracle/Makefile.in seems to ignore the 
--datarootdir setting
config.status: creating drivers/firebird/Makefile
config.status: WARNING:  drivers/firebird/Makefile.in seems to ignore the 
--datarootdir setting
config.status: creating drivers/freetds/Makefile
config.status: WARNING:  drivers/freetds/Makefile.in seems to ignore the 
--datarootdir setting
config.status: creating drivers/ingres/Makefile
config.status: WARNING:  drivers/ingres/Makefile.in seems to ignore the 
--datarootdir setting
config.status: creating tests/Makefile
config.status: WARNING:  tests/Makefile.in seems to ignore the --datarootdir 
setting
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands

Compilation for Ubuntu target runs ok. Cross-compilation for ARM fails. 
I have run out of ideas how to solve this problem. Can you help reslving this 
issue?

Thank you

----------------------------------------------------------------------

>Comment By: Markus Hoenicka (mhoenicka)
Date: 2013-01-22 15:35

Message:
I can't be of much help here as I don't know much about gcc on ARM. As
you've seen yourself, the code compiles just fine on x86 and used to
compile fine on PowerPC, therefore I don't think it grossly ignores C
standards. I've investigated the first error (line 70) to get a clue. The
syntax is perfectly fine according to several sources, as we do not modify
the static strings, we just strcmp against them. If gcc on arms complains
about this, the supported syntax may be a subset of what we are used to, or
it requires further hints. Does it help to specify the size of the array of
strings ecplicitly? Like this:

static const char *reserved_words[233] = SQLITE3_RESERVED_WORDS;

If that does help, we'd have to fix the errors one by one which could be a
bit tedious.

regards,
Markus

----------------------------------------------------------------------

Comment By: rjanowsk (rjanowsk)
Date: 2013-01-22 06:07

Message:
It concerns libdbi-drivers version 0.8.3-1

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=512945&aid=3601758&group_id=65979

------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnnow-d2d
_______________________________________________
Libdbi-drivers-devel mailing list
Libdbi-drivers-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libdbi-drivers-devel

Reply via email to