You are not logged in.
@ab - I'm trying to upgrade SQLite3 in my mORMot1 application from 3.31.0 to 3.44.2 (to the latest static version uploaded to the mORMot repository), but I get various linking errors related to pthread and dlopen (sorry for big fragment) under x86_64-linux (win64 is OK)
(9015) Linking bin/fpc-linux/ub
/usr/bin/ld: libs/Synopse/./static/x86_64-linux/sqlite3.o: in function `sqlite3_strlike':
sqlite3mc.c:(.text+0xc735): undefined reference to `_pthread_mutex_trylock'
/usr/bin/ld: libs/Synopse/./static/x86_64-linux/sqlite3.o: in function `sqlite3_free_filename':
sqlite3mc.c:(.text+0xe345): undefined reference to `_pthread_mutex_destroy'
/usr/bin/ld: libs/Synopse/./static/x86_64-linux/sqlite3.o: in function `sqlite3_create_filename':
sqlite3mc.c:(.text+0x20bbc): undefined reference to `_pthread_create'
/usr/bin/ld: libs/Synopse/./static/x86_64-linux/sqlite3.o: in function `sqlite3_uri_int64':
sqlite3mc.c:(.text+0x2bbc4): undefined reference to `_pthread_mutexattr_init'
/usr/bin/ld: sqlite3mc.c:(.text+0x2bbd1): undefined reference to `_pthread_mutexattr_settype'
/usr/bin/ld: sqlite3mc.c:(.text+0x2bbdc): undefined reference to `_pthread_mutex_init'
/usr/bin/ld: sqlite3mc.c:(.text+0x2bbe4): undefined reference to `_pthread_mutexattr_destroy'
/usr/bin/ld: sqlite3mc.c:(.text+0x2bc30): undefined reference to `_pthread_mutex_init'
/usr/bin/ld: sqlite3mc.c:(.text+0x2c7ce): undefined reference to `_pthread_join'
/usr/bin/ld: libs/Synopse/./static/x86_64-linux/sqlite3.o: in function `sqlite3_load_extension':
sqlite3mc.c:(.text+0x4246e): undefined reference to `_dlerror'
/usr/bin/ld: libs/Synopse/./static/x86_64-linux/sqlite3.o: in function `sqlite3_compileoption_used':
sqlite3mc.c:(.text+0xb804): undefined reference to `_dlclose'
/usr/bin/ld: sqlite3mc.c:(.text+0xb817): undefined reference to `_dlsym'
/usr/bin/ld: sqlite3mc.c:(.text+0xb829): undefined reference to `_dlopen'
/usr/bin/ld: libs/Synopse/./static/x86_64-linux/sqlite3.o: in function `sqlite3_strlike':
sqlite3mc.c:(.text+0xc721): undefined reference to `_pthread_mutex_unlock'
/usr/bin/ld: sqlite3mc.c:(.text+0xc751): undefined reference to `_pthread_mutex_lock'
UB.lpr(56,1) Error: (9013) Error while linking
I tried under Ubuntu 22.04 (GLIBC 2.35) and Ubuntu 20.04 (GLIBC 2.31) with the same results..
I assume that you compile Linux static under newer OSes (newer libc) and this is the reason?
Offline
I found this commit in sqlite3 build what replace all symbols pthread->_pthread + dl->_dl and issue #211
To solve my problem I do a backward replacement, and now linker is happy.
Linux script what do a replacing is here
Still do not understand why it compiles in mORMot2.
Offline
To solve a problem, described in #211 ( `GLIBC_2.34' not found ) I compile a production version of my product using docker with fpc what based on Ubuntu 20.04 (GLIBC 2.31)
Offline
Perhaps https://github.com/synopse/mORMot/commi … 237a1a138b
would fix the problem during our own static build.
When I run this script, now it compiles and links fine for both mORMot 1 and also mORMot 2.
I will release a new mORMot 1 + 2 static binaries soon.
Instead of a docker container, you can just use fpc-ootb binaries.
See https://github.com/synopse/mORMot2/blob … ild_fpc.sh
Online