Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Compiling SQLite Tcl bindings for 32-bit linux on 64-bit linux

408 views
Skip to first unread message

Gerry Snyder

unread,
Aug 26, 2013, 9:00:37 PM8/26/13
to
This afternoon I compiled the SQLite 3.8 Tcl bindings for windows and
64-bit linux, and thought I would try a 32-bit compile on the linux box
too. I already had the gcc multilib packages installed.

First I did:

./configure --host=i686-linux-gnu "CFLAGS=-m32" "CXXFLAGS=-m32"
"LDFLAGS=-m32"

(all on one line). That seemed to run okay, but

make

failed with:

gcc -shared -m32 -pipe -O2 -fomit-frame-pointer -Wall -fPIC -m32
-Wl,--export-dynamic -o libsqlite3.8.0.so tclsqlite3.o -lpthread
-L/home/gsnyder/ActiveTcl-8.6/lib -ltclstub8.6

/usr/bin/ld: skipping incompatible
/home/gsnyder/ActiveTcl-8.6/lib/libtclstub8.6.a when searching for
-ltclstub8.6

/usr/bin/ld: cannot find -ltclstub8.6

Is it just that I need a 32-bit Tcl present? Or did I get the configure
options wrong? Or any other guesses?

Thank you,

Gerry


Christian Gollwitzer

unread,
Aug 27, 2013, 1:10:49 AM8/27/13
to
Am 27.08.13 03:00, schrieb Gerry Snyder:
> This afternoon I compiled the SQLite 3.8 Tcl bindings for windows and
> 64-bit linux, and thought I would try a 32-bit compile on the linux box
> too. I already had the gcc multilib packages installed.
>
> First I did:
>
> ./configure --host=i686-linux-gnu "CFLAGS=-m32" "CXXFLAGS=-m32"
> "LDFLAGS=-m32"
>
> (all on one line). That seemed to run okay, but
>
> make
>
> failed with:
>
> gcc -shared -m32 -pipe -O2 -fomit-frame-pointer -Wall -fPIC -m32
> -Wl,--export-dynamic -o libsqlite3.8.0.so tclsqlite3.o -lpthread
> -L/home/gsnyder/ActiveTcl-8.6/lib -ltclstub8.6
>
> /usr/bin/ld: skipping incompatible
> /home/gsnyder/ActiveTcl-8.6/lib/libtclstub8.6.a when searching for
> -ltclstub8.6
>
> /usr/bin/ld: cannot find -ltclstub8.6
>
> Is it just that I need a 32-bit Tcl present?

Yes, the error means it is trying to link against a 64bit Tcl lib, which
cannot work, of course. You need to install Tcl frst and then set the
configure flags accordingly such that sqlite finds the 32bit-Tcl
(pesumably --with-tcl=/path/to/32bit/Tcl, check with --help)

BTW, when you have ActiveTcl, you can just pull in sqlite via teacup.
And compiling stuff can be automated via kbs.tcl

Christian

Harald Oehlmann

unread,
Aug 27, 2013, 2:25:51 AM8/27/13
to
Am Dienstag, 27. August 2013 03:00:37 UTC+2 schrieb Gerry Snyder:
> This afternoon I compiled the SQLite 3.8 Tcl bindings for windows and
>
> 64-bit linux, and thought I would try a 32-bit compile on the linux box
>
> too. I already had the gcc multilib packages installed.

Maybee another hint:

Please take care, that the 64 bit libraries go into /usr/lib64 and any 32bit or independent stuff in /usr/lib.

Here are hints for CentOS:
http://wiki.tcl.tk/3298

Gerry Snyder

unread,
Aug 27, 2013, 1:07:56 PM8/27/13
to
On 8/26/2013 10:10 PM, Christian Gollwitzer wrote:
> Am 27.08.13 03:00, schrieb Gerry Snyder:
>> >
> Yes, the error means it is trying to link against a 64bit Tcl lib, which
> cannot work, of course. You need to install Tcl frst and then set the
> configure flags accordingly such that sqlite finds the 32bit-Tcl
> (pesumably --with-tcl=/path/to/32bit/Tcl, check with --help)
>
> BTW, when you have ActiveTcl, you can just pull in sqlite via teacup.
> And compiling stuff can be automated via kbs.tcl
>
> Christian
>

Thank you Christian and Harald for your replies.

I had had the thought that if the stubs table was all that was needed, a
single Tcl installation might suffice. Now that it has been pointed out
to me, it is not surprising that stubs can work across versions, but not
across platforms (and especially across platforms with different
pointer/word sizes).

Thanks again,

Gerry
0 new messages