You are not logged in.
Pages: 1
TestSQL3.lpi build fails with the following link error:
(9015) Linking /home/damian/mORMot/SQLite3/fpc/bin/x86_64-linux/TestSQL3
/usr/bin/ld: /home/damian/mORMot/./static/x86_64-linux/sqlite3.o:(.data+0x22b0): undefined reference to `fcntl64'
FPC 3.2.0 / Lazarus 2.0.9, OpenSUSE Leap 15.1
Any ideas?
Offline
Please update your .o files.
I've got them from the (synced) git repo. Do I have to get them from somewhere else?
Offline
No, github from today is fine.
My main system is Debian/Ubuntu and I don't have such problem.
Your issue is when linking the libc.
Here are my static folder:
https://gist.github.com/synopse/90ada32 … 5b1e76b720
Offline
My static folder follows. File sizes are the same I think:
damian@ifestos:~/mORMot/static/x86_64-linux> ls -al
σύνολο 4824
drwxr-xr-x 2 damian users 269 Ιούν 13 12:24 .
drwxr-xr-x 15 damian users 284 Ιούν 13 12:24 ..
-rw-r--r-- 1 damian users 15328 Ιούν 13 12:24 crc32c64.o
-rw-r--r-- 1 damian users 98416 Ιούν 13 12:24 ecclin64O2.o
-rw-r--r-- 1 damian users 5272 Ιούν 13 12:24 entropy_common.o
-rw-r--r-- 1 damian users 16840 Ιούν 13 12:24 fse_compress.o
-rw-r--r-- 1 damian users 7736 Ιούν 13 12:24 fse_decompress.o
-rw-r--r-- 1 damian users 13072 Ιούν 13 12:24 huf_compress.o
-rw-r--r-- 1 damian users 37968 Ιούν 13 12:24 huf_decompress.o
-rw-r--r-- 1 damian users 3003478 Ιούν 13 12:24 libgcc.a
-rw-r--r-- 1 damian users 139656 Ιούν 13 12:24 lizard_compress.o
-rw-r--r-- 1 damian users 44880 Ιούν 13 12:24 lizard_decompress.o
-rw-r--r-- 1 damian users 16016 Ιούν 13 12:24 sha512-x64sse4.o
-rw-r--r-- 1 damian users 1512960 Ιούν 13 12:24 sqlite3.o
I repeated the problem in another Linux distro (Linux Lite, which is Ubuntu based). I can't figure out what's happening...
Offline
In my Linux Lite old netbook is 2.23. In my OpenSUSE desktop is 2.26.
Last edited by damiand (2020-06-15 17:54:56)
Offline
I know this old libc issue - binaries compiled on Ubuntu 18.04 not compatible with libc 2.23. For compatibility with libc 2.23 (it comes with CentOS 7 and many production still use CeonOS 7) I build libraries/program using Ubuntu 16.04
Such binaries compatible with most OS (verified with CentOS 7/8, Oracle Linux, Ubuntu up to 20.04)
Last edited by mpv (2020-06-15 18:19:32)
Offline
I'm currently working on systemd socket activation support for SynCrtSock, so dig a little into systemd and wonder how easy is to run a (for example) Ubuntu 16 with all build tools on any systemd compartible host OS. Hope it helps
#create a OCI container file system in /var/lib/machines/ubuntu_16_dev
sudo debootstrap --variant=buildd xenial /var/lib/machines/ubuntu_16_dev http://archive.ubuntu.com/ubuntu/
#set root password
sudo systemd-nspawn -D /var/lib/machines/ubuntu_16_dev
passwd
#type new password for root and when Ctrl+[ 3 times to exit
#run an Ubuntu 16
sudo systemd-nspawn -D /var/lib/machines/ubuntu_16_dev
All data is persisted, sources can be copied into container fs just from main OS results copied back and so on. As more I dig into Linux as more I wonder
It took me 6 minutes to install Ubuntu16 on Ubuntu 18.04.
Last edited by mpv (2020-06-15 18:40:19)
Offline
Thanks mpv. So, should I expect the libraries to be rebuilt with Ubuntu 16.04 and update the repository, or do I have to rebuild them myself? In the latter case, how can I do this?
Offline
Thanks a lot, ab! Sorry for the fuss.
Offline
We now use the fpcupdeluxe GCC Windows cross-compilers for the Linux target, even on Linux - using Wine.
It is easier to tune than trying to tweak the built-in GCC compiler.
I was not able to fix Ubuntu 20.04 GCC compiler linking expectations, and a separate compiler was a nightmare - whereas the FPCUpdeluxe Windows cross-compilers are just stand-alone and portable.
We even have a version with very old libc to be able to run Linux exectables on systems from dozen of years age...
We also added preliminary support of FreeBSD and OpenBSD compilation, with the FPCUpDeluxe cross-compilers - running on Linux natively this time, not using Wine.
Thanks Alfred for the help!
Please check the latest static files and https://synopse.info/fossil/info/7da305dde0fc552c
Feedback is welcome.
Offline
I've just built the TestSQL3.lpi project in my old Linux Lite netbook with 2.23 libc. Thanks a lot ab and whoever else helped to solve this problem!
Offline
Hi Ab,
Just added relocatable binutils and gcc for Linux x64 meant to run on Linux x64 itself.
These utils might help you in building the static sqlite3 on Linux itself, without dependencies on glibc.
Offline
Fpcupdeluxe is not needed for the standalone tools. Just download and unpack somewhere. And adjust the sqlite3 build-script to point towards the right locations.
Offline
And Linux i386 utilities for Linux x64 added. Perhaps this works also.
https://github.com/LongDirtyAnimAlf/fpc … uxi386.zip
Offline
Do you think this gcc 9.3 would be really faster than gcc 6.3 as used in Windows cross-compiling?
For the SQlite3 code base, which doesn't require any complex code auto-vectorization, I didn't see any noticeable performance difference.
Offline
I do not expect much speed improvements at -O2.
I only expect improved hardware and os compatibility.
Offline
Some (better) improvements might be expected from the advices that are shown here:
https://www.sqlite.org/compile.html
Offline
Those conditionals were already checked and included in our sqlite3mc.c wrapper.
Check https://github.com/synopse/mORMot/blob/ … qlite3mc.c
Offline
Happy coding and speeding ... :-) ... thanks !
Offline
Pages: 1