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

2.0.0.23 problem linking to libsqlite3

3 views
Skip to first unread message

tjoen

unread,
Aug 22, 2009, 3:16:30 AM8/22/09
to
make[3]: Entering directory
`/home/tjoen/rpmbuild/BUILD/mozilla/objdir/storage/build'
...
c++ -fno-rtti -fno-exceptions -Wall -Wconversion -Wpointer-arith
-Wcast-align -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy
-Wno-non-virtual-dtor -Wno-long-long -pedantic -fshort-wchar
-pthread -pipe -DNDEBUG -DTRIMMED -O -fPIC -shared -Wl,-z,defs
-Wl,-h,libstoragecomps.so
-o libstoragecomps.so
mozStorageModule.o
-Wl,--whole-archive ../../dist/lib/libstorage_s.a -Wl,--no-whole-archive
-L../../dist/bin -L../../dist/lib -lsqlite3
-L../../dist/bin -lxpcom -lxpcom_core
-L../../dist/bin -L/lib -lplds4 -lplc4 -lnspr4 -lpthread -ldl
-L../../dist/bin -lmozjs
-Wl,--version-script -Wl,../../../build/unix/gnu-ld-scripts/components-version-script
-Wl,-Bsymbolic -ldl -lm

../../dist/lib/libstorage_s.a(mozStorageAsyncIO.o): In function `.L106':
mozStorageAsyncIO.cpp:(.text+0x8a4): undefined reference to `sqlite3ApiExit'
...
etc

System is Linux, everything from sources, very up to date.
gcc 4.4.0, so this patch needed:
diff -uNr mozilla.orig/toolkit/xre/nsAppRunner.cpp mozilla/toolkit/xre/nsAppRunner.cpp
--- mozilla.orig/toolkit/xre/nsAppRunner.cpp 2007-11-08 12:56:25.000000000 +0100
+++ mozilla/toolkit/xre/nsAppRunner.cpp 2009-06-26 21:22:32.000000000 +0200
@@ -1370,7 +1370,7 @@
if (NS_FAILED(rv))
return rv;

-#elif
+#else
#error Oops, you need platform-specific code here
#endif

.mozconfig
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/objdir
. \$topsrcdir/mail/config/mozconfig
ac_add_options --prefix=/usr
ac_add_options --with-system-nspr
ac_add_options --with-system-nss # second build I deleted this line
ac_add_options --with-system-jpeg
ac_add_options --with-system-zlib
ac_add_options --with-system-png
ac_add_options --enable-default-toolkit=gtk2
ac_add_options --enable-static-mail
ac_add_options --disable-freetype2
ac_add_options --enable-xft
ac_add_options --enable-crypto
ac_add_options --disable-installer
ac_add_options --disable-tests
ac_add_options --disable-debug
ac_add_options --enable-optimize
ac_add_options --enable-system-cairo
mk_add_options MOZ_CO_PROJECT=mail

That one worked for 2.0.0.22. Also with gcc 4.4.0

~/rpmbuild/BUILD/mozilla/objdir/dist/lib $ strings libsqlite3.so
....
sqlite3_complete16
sqlite3ApiExit
sqlite3RegisterDateTimeFunctions
....

objdir/dist/include/sqlite3/sqlite3file.h has
extern "C" {
so that should'nt be the problem

Can someone confirm this buildproblem?
Then the problem can be located, maybe it is a gcc bug.

Peter Weilbacher

unread,
Aug 22, 2009, 7:51:49 AM8/22/09
to
On 22/08/09 09:16, tjoen wrote:
> System is Linux, everything from sources, very up to date.
> gcc 4.4.0, so this patch needed:
> diff -uNr mozilla.orig/toolkit/xre/nsAppRunner.cpp mozilla/toolkit/xre/nsAppRunner.cpp
> --- mozilla.orig/toolkit/xre/nsAppRunner.cpp 2007-11-08 12:56:25.000000000 +0100
> +++ mozilla/toolkit/xre/nsAppRunner.cpp 2009-06-26 21:22:32.000000000 +0200
> @@ -1370,7 +1370,7 @@
> if (NS_FAILED(rv))
> return rv;
>
> -#elif
> +#else
> #error Oops, you need platform-specific code here
> #endif
[...snip...]

> Then the problem can be located, maybe it is a gcc bug.

No, #elifs without condition are bad. This is actually bug 478843 and
was fixed in many branches, but not yet 1.8.1. Perhaps you can request
approval1.8.1.24 on that patch. (I'm surprised if this is the only gcc
4.4 on the 1.8.1 branch...)

Cheers,
Peter.

tjoen

unread,
Aug 23, 2009, 4:51:03 AM8/23/09
to
tjoen wrote:
More info.

This is 2.0.0.23:


> make[3]: Entering directory
> `/home/tjoen/rpmbuild/BUILD/mozilla/objdir/storage/build'
> ...

[reedited]


c++ -fno-rtti -fno-exceptions -Wall -Wconversion -Wpointer-arith \
-Wcast-align -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy \
-Wno-non-virtual-dtor -Wno-long-long -pedantic -fshort-wchar \
-pthread -pipe -DNDEBUG -DTRIMMED -O -fPIC -shared \
-Wl,-z,defs -Wl,-h,libstoragecomps.so \
-o libstoragecomps.so \
mozStorageModule.o \
-Wl,--whole-archive ../../dist/lib/libstorage_s.a \
-Wl,--no-whole-archive -L../../dist/bin -L../../dist/lib -lsqlite3 \
-L../../dist/bin -lxpcom -lxpcom_core \
-L../../dist/bin -L/lib -lplds4 -lplc4 -lnspr4 -lpthread -ldl \
-L../../dist/bin -lmozjs \
-Wl,--version-script \
-Wl,../../../build/unix/gnu-ld-scripts/components-version-script \
-Wl,-Bsymbolic -ldl -lm
> ../../dist/lib/libstorage_s.a(mozStorageAsyncIO.o): In function `.L106':
> mozStorageAsyncIO.cpp:(.text+0x8a4): undefined reference to `sqlite3ApiExit'
> ...
> etc

2.0.0.22 links correctly:


c++ -fno-rtti -fno-exceptions -Wall -Wconversion -Wpointer-arith \
-Wcast-align -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy \
-Wno-non-virtual-dtor -Wno-long-long -pedantic -fshort-wchar \
-pthread -pipe -DNDEBUG -DTRIMMED -O -fPIC -shared \
-Wl,-z,defs -Wl,-h,libstoragecomps.so \
-o libstoragecomps.so
mozStorageModule.o \

-Wl,--whole-archive ../../dist/lib/libstorage_s.a \
../../dist/lib/libsqlite3_s.a \
-Wl,--no-whole-archive -L../../dist/bin -L../../dist/lib \


-L../../dist/bin -lxpcom -lxpcom_core \
-L../../dist/bin -L/lib -lplds4 -lplc4 -lnspr4 -lpthread -ldl \
-L../../dist/bin -lmozjs \
-Wl,--version-script \
-Wl,../../../build/unix/gnu-ld-scripts/components-version-script \
-Wl,-Bsymbolic -ldl -lm

The difference:
2.0.0.23:
-Wl,--whole-archive ../../dist/lib/libstorage_s.a \
-Wl,--no-whole-archive -L../../dist/bin -L../../dist/lib -lsqlite3 \
2.0.0.22:
-Wl,--whole-archive ../../dist/lib/libstorage_s.a \
../../dist/lib/libsqlite3_s.a \
-Wl,--no-whole-archive -L../../dist/bin -L../../dist/lib \

Why is that a problem? Someting wrong with libsqlite3.so?


c++ -fno-rtti -fno-exceptions -Wall -Wconversion -Wpointer-arith \
-Wcast-align -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy \
-Wno-non-virtual-dtor -Wno-long-long -pedantic -fshort-wchar \
-pthread -pipe -DNDEBUG -DTRIMMED -O -fPIC -shared \

-Wl,-z,defs -Wl,-h,libsqlite3.so \
-o libsqlite3.so \
alter.o analyze.o attach.o auth.o btree.o build.o callback.o \
complete.o date.o delete.o experimental.o expr.o func.o hash.o \
insert.o legacy.o main.o opcodes.o os.o os_unix.o os_win.o os_os2.o \
os_beos.o pager.o parse.o pragma.o prepare.o printf.o random.o \
select.o table.o tokenize.o trigger.o update.o utf.o util.o vacuum.o \
vdbe.o vdbeapi.o vdbeaux.o vdbefifo.o vdbemem.o where.o \
-ldl -lm

Ludovic Hirlimann

unread,
Aug 24, 2009, 3:12:27 AM8/24/09
to
On 8/23/09 10:51 AM, tjoen wrote:
> tjoen wrote:
> More info.
>
[snip]

> Why is that a problem? Someting wrong with libsqlite3.so?

From bug souvenirs (see bug 504523) sqlite changed from a dynamic
linking to a static one.

Ludo
--
Ludovic Hirlimann MozillaMessaging QA lead
http://www.spreadthunderbird.com/aff/79/2

tjoen

unread,
Aug 24, 2009, 4:14:22 AM8/24/09
to
Ludovic Hirlimann wrote:
> On 8/23/09 10:51 AM, tjoen wrote:
>> tjoen wrote:
>> Why is that a problem? Someting wrong with libsqlite3.so?
>
> From bug souvenirs (see bug 504523) sqlite changed from a dynamic
> linking to a static one.

https://bugzilla.mozilla.org/show_bug.cgi?id=504523
You are not authorized to access bug #504523. To see this bug, you
must first log in to an account with the appropriate permissions :-(

So somehow my 2.0.0.23 ./configure creates Makefiles for
dynamic linking. Is it only with me? No other results in Google
if I search for the error in my original posting.

I am considering upgrading to gcc 4.4.1 but does that solve
the build problem? Or is the bug in the linker?
My /usr/bin/ld is from binutils-2.19.1

toshiharu

unread,
Aug 24, 2009, 8:45:30 AM8/24/09
to
I got the same error with gcc-4.3.3 and binutils-2.19.51.0.9. But I
have no idea, sorry.

tjoen

unread,
Aug 24, 2009, 10:07:29 AM8/24/09
to
toshiharu wrote:
> I got the same error with gcc-4.3.3 and binutils-2.19.51.0.9.

It is a confirmation of the problem, so I am not the only one.
Knowing which tools are working would be helpful.

What I have tried too is deleting /lib/libsqlite3.so
(maybe the linker tried to link to that one). Problem persists.

I am compiling 2.0.0.22 again now to keep the output.
Next I will try the commands in that outputfile to see
if that works.

tjoen

unread,
Aug 24, 2009, 1:58:46 PM8/24/09
to
Dan Mosedale wrote:

> On 8/24/09 7:07 AM, tjoen wrote:
>> Knowing which tools are working would be helpful.
>>
> http://tinderbox.mozilla.org/showlog.cgi?log=Mozilla1.8/1251127920.1251128775.300.gz
> is a link to a partial build log from the machine that produces the
> nightly builds...

Interesting stuff! Thanks! Let's see:
> Compiler is -- gcc (gcc (GCC) 3.3.3

Bit too old for me, isn't that the one with libstdc++.so.5 ?

> ac_add_options --disable-shared
> ac_add_options --enable-static

Looks lijke those are the most important differences to the
default. It results to:

> libstoragecomps.a

I am missing --enable-static-mail needed by enigmail
(according to their documentation)
Is enigmail working with users of the official distro?

I am trying a patch now for the shared version

tjoen

unread,
Aug 25, 2009, 3:35:25 AM8/25/09
to
tjoen wrote:

> 2.0.0.23 Linux gcc-4.4.0 binutils-2.19.1

> .mozconfig
> mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/objdir
> . \$topsrcdir/mail/config/mozconfig
> ac_add_options --prefix=/usr
> ac_add_options --with-system-nspr
> ac_add_options --with-system-nss # second build I deleted this line
> ac_add_options --with-system-jpeg
> ac_add_options --with-system-zlib
> ac_add_options --with-system-png
> ac_add_options --enable-default-toolkit=gtk2
> ac_add_options --enable-static-mail
> ac_add_options --disable-freetype2
> ac_add_options --enable-xft
> ac_add_options --enable-crypto
> ac_add_options --disable-installer
> ac_add_options --disable-tests
> ac_add_options --disable-debug
> ac_add_options --enable-optimize
> ac_add_options --enable-system-cairo
> mk_add_options MOZ_CO_PROJECT=mail

> ...


> make[3]: Entering directory
> `/home/tjoen/rpmbuild/BUILD/mozilla/objdir/storage/build'
> ...

> c++ -fno-rtti -fno-exceptions -Wall -Wconversion -Wpointer-arith \
> -Wcast-align -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy \
> -Wno-non-virtual-dtor -Wno-long-long -pedantic -fshort-wchar \
> -pthread -pipe -DNDEBUG -DTRIMMED -O -fPIC -shared \
> -Wl,-z,defs -Wl,-h,libstoragecomps.so \
> -o libstoragecomps.so \
> mozStorageModule.o \
> -Wl,--whole-archive ../../dist/lib/libstorage_s.a \
> -Wl,--no-whole-archive -L../../dist/bin -L../../dist/lib -lsqlite3 \
> -L../../dist/bin -lxpcom -lxpcom_core \
> -L../../dist/bin -L/lib -lplds4 -lplc4 -lnspr4 -lpthread -ldl \
> -L../../dist/bin -lmozjs \
> -Wl,--version-script \
> -Wl,../../../build/unix/gnu-ld-scripts/components-version-script \
> -Wl,-Bsymbolic -ldl -lm

> ../../dist/lib/libstorage_s.a(mozStorageAsyncIO.o): In function `.L106':
> mozStorageAsyncIO.cpp:(.text+0x8a4): undefined reference to `sqlite3ApiExit'
> ...
> etc

Confirmed by toshiharu : (no .mozconfig given)


> I got the same error with gcc-4.3.3 and binutils-2.19.51.0.9.

diff -uNr mozilla.orig/db/sqlite3/src/Makefile.in mozilla/db/sqlite3/src/Makefile.in
--- mozilla.orig/db/sqlite3/src/Makefile.in 2009-08-10 19:59:12.000000000 +0200
+++ mozilla/db/sqlite3/src/Makefile.in 2009-08-24 21:53:50.000000000 +0200
@@ -46,7 +46,7 @@
MODULE = sqlite3
LIBRARY_NAME = sqlite3
MODULE_NAME = sqlite3
-FORCE_SHARED_LIB = 1
+FORCE_STATIC_LIB = 1
VISIBILITY_FLAGS =

ifeq (,$(filter-out WINNT WINCE, $(OS_ARCH)))

Dan Mosedale

unread,
Aug 26, 2009, 2:19:44 PM8/26/09
to dev-apps-t...@lists.mozilla.org
On 8/25/09 12:35 AM, tjoen wrote:
> [patch for 2.0.0.23 sqlite travails on Linux omitted
Would you be willing to file a bug in Bugzilla about this and submit it
as a patch? That would be very helpful, as it would put it on the path
to getting landed in the main tree. Feel free to cc dm...@mozilla.org
on the bug, if you wish.

Thanks!
Dan

tjoen

unread,
Aug 26, 2009, 2:42:14 PM8/26/09
to
Dan Mosedale wrote:
> On 8/25/09 12:35 AM, tjoen wrote:
>> [patch for 2.0.0.23 sqlite travails on Linux omitted
> Would you be willing to file a bug in Bugzilla about this and submit it
> as a patch?

I think I have no permission for that, no account there.
But sure there are developpers reading this newsgroup/list

Dan Mosedale

unread,
Aug 27, 2009, 12:41:44 PM8/27/09
to dev-apps-t...@lists.mozilla.org
On 8/26/09 11:42 AM, tjoen wrote:
> Dan Mosedale wrote:
>
>> On 8/25/09 12:35 AM, tjoen wrote:
>>
>>> [patch for 2.0.0.23 sqlite travails on Linux omitted
>>>
>> Would you be willing to file a bug in Bugzilla about this and submit it
>> as a patch?
>>
> I think I have no permission for that, no account there.
>
Fortunately, accounts are free and very easy to set up!

> But sure there are developpers reading this newsgroup/list
>
While that's true, years of past experience shows that bug reports and
fixes that get sent to this list tend to fall off the radar, because it
really is just a discussion list, not a bug/patch tracker. :-(

Dan

tjoen

unread,
Aug 27, 2009, 1:55:20 PM8/27/09
to
Dan Mosedale wrote:
> On 8/26/09 11:42 AM, tjoen wrote:
>> But sure there are developpers reading this newsgroup/list
>>
> While that's true, years of past experience shows that bug reports and
> fixes that get sent to this list tend to fall off the radar,

Same with Bugzilla reports. The missing
#include <cstdio>
is still there

Magnus Melin

unread,
Aug 29, 2009, 1:41:11 PM8/29/09
to
On 27.08.2009 20:55, tjoen wrote:
> Dan Mosedale wrote:
>> On 8/26/09 11:42 AM, tjoen wrote:
>>> But sure there are developpers reading this newsgroup/list
>>>
>> While that's true, years of past experience shows that bug reports and
>> fixes that get sent to this list tend to fall off the radar,
>
> Same with Bugzilla reports.

Not true. Almost all reports with patches attached do get appropriate attention.
Since it requires a bug report for the patch to be reviewed and checked in
anyway, it's just a waste of time doing anything about it here.

-Magnus


toshiharu

unread,
Aug 30, 2009, 4:18:49 AM8/30/09
to
On 8月24日, 午後9:45, toshiharu <toshiharu.nak...@gmail.com> wrote:
> I got the same error with gcc-4.3.3 and binutils-2.19.51.0.9.  But I
> have no idea, sorry.

Build success with above gcc and binutils.
I added ac_cv_visibility_pragma=no to mozconfig.

Thanks xhorak for this patch.
http://cvs.fedoraproject.org/viewvc/F-10/thunderbird/thunderbird-2.0-visibility.patch?revision=1.1&view=markup

tjoen

unread,
Aug 30, 2009, 4:44:17 AM8/30/09
to
Magnus Melin wrote:
> Since it requires a bug report for the patch to be reviewed
> and checked in anyway, it's just a waste of time doing anything about it
> here.

This one appears is Google, (not yet in Bing)
so everybody with the same problem can apply the patch.

But anybody with a bugzilla account can submit the patch,
that is the reason I made my OP so complete

0 new messages