[SOLVED] undefined reference to `fcntl@GLIBC_2.28' lazarus / 32-Linux ---------------------------------------------------------------------- alpine · 2024-08-15 15:49 I have several C libraries written by me and I'm using them in an Lazarus project as a dynamic *.so files. I haven't rebuild them for a long time until recently, when a small change was made. Now my Lazarus project build fails with the reason of: Code: Text  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i undefined reference to `fcntl@GLIBC_2.28' dumping the GLIBC syms of the troubled library: Code: Text  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i objdump libdatecsd.so -t | grep GLIBC00000000       F *UND*  00000000            read@@GLIBC_2.000000000       F *UND*  00000000              printf@@GLIBC_2.000000000       F *UND*  00000000              tcflush@@GLIBC_2.000000000       F *UND*  00000000              clock_gettime@@GLIBC_2.1700000000       F *UND*  00000000            cfsetospeed@@GLIBC_2.000000000       F *UND*  00000000              __stack_chk_fail@@GLIBC_2.400000000  w    F *UND*  00000000            __cxa_finalize@@GLIBC_2.1.300000000       F *UND*  00000000            tcsetattr@@GLIBC_2.000000000       F *UND*  00000000              puts@@GLIBC_2.000000000       F *UND*  00000000              open@@GLIBC_2.000000000       F *UND*  00000000              strlen@@GLIBC_2.000000000       F *UND*  00000000              write@@GLIBC_2.000000000       F *UND*  00000000              cfsetispeed@@GLIBC_2.000000000       F *UND*  00000000              atol@@GLIBC_2.000000000       F *UND*  00000000              __isoc99_sscanf@@GLIBC_2.700000000       F *UND*  00000000            fcntl@@GLIBC_2.2800000000       F *UND*  00000000              toupper@@GLIBC_2.000000000       F *UND*  00000000              strcasestr@@GLIBC_2.100000000       F *UND*  00000000              sprintf@@GLIBC_2.000000000       F *UND*  00000000              tcgetattr@@GLIBC_2.000000000       F *UND*  00000000              close@@GLIBC_2.0  Meanwhile I have upgraded my Ubuntu to 20.04. It was installed as 16.0, after that upgraded to 18.0 and now it is 20.04. Lazarus 2.2.4 (rev lazarus_2_2_4) FPC 3.2.2 x86_64-linux-gtk2 gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.2) GLIBC version 2.31 If it can make a difference - my target is 32-bit, i.e. with -m32 option for gcc and -P386 option for FPC. Somebody have a clue? ---------------------------------------------------------------------- alpine · 2024-08-16 18:34 Solved (sort of) by binding fcntl() to a base version node into the C source with Code: C  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i __asm__(".symver fcntl,fcntl@GLIBC_2.0"); According to: https://forum.lazarus.freepascal.org/index.php/topic,58888.msg486108.h tml#msg486108 and https://web.archive.org/web/20160107032111/http://ww w.trevorpounds.com/blog/?p=103 ---------------------------------------------------------------------- MarkMLl · 2024-08-16 20:01 Thanks for that, and... wow, /that/ thread :-( MarkMLl ---------------------------------------------------------------------- robert rozee · 2024-08-17 05:23 Quote from: MarkMLl on August 16, 2024, 10:01:08 pm[...] /that/ thread :-( "/that/" thread yielded one of the longest ever discussions on this area of the forum, generated a good understanding for many of us for what is happening, and yielded a set of solutions for the related problems that folks were encountering. all-in-all, i think it was a good outcome! i used to hold out hope that there would be an 'official' set of changes made to lazarus/FPC to create a non-ad-hoc solution, but i can't see it every happening in any of our lifetimes. cheers, rob   :-) ---------------------------------------------------------------------- Fred vS · 2024-08-17 12:40 Quote from: robert rozee on August 17, 2024, 07:23:28 amQuote from: MarkMLl on August 16, 2024, 10:01:08 pm[...] /that/ thread :-( "/that/" thread yielded one of the longest ever discussions on this area of the forum, generated a good understanding for many of us for what is happening, and yielded a set of solutions for the related problems that folks were encountering. all-in-all, i think it was a good outcome! i used to hold out hope that there would be an 'official' set of changes made to lazarus/FPC to create a non-ad-hoc solution, but i can't see it every happening in any of our lifetimes. cheers, rob   :-) Hello Rob! For those who don't want to wait too long, there is that solution. Fre;D ---------------------------------------------------------------------- DonAlfredo · 2024-08-17 13:44 Quoteall-in-all, i think it was a good outcome! i used to hold out hope that there would be an 'official' set of changes made to lazarus/FPC to create a non-ad-hoc solution, but i can't see it every happening in any of our lifetimes If i am well-informed, versioned linking will be added to FPC (trunk). Will take some time (core-developer is very busy). This is also the reason why I abandoned my own efforts (also being more of a hack than an implementation). ---------------------------------------------------------------------- robert rozee · 2024-08-17 14:39 hi Fred   :-) i'd forgotten about your fpc-ootb, to be honest i've not been doing much programming at all over the last few months. a quick question - am i right in saying fpc-ootb does not include the lazarus IDE and LCL? if not, is there any sort of 'lazarus-ootb', or a set of instructions on how to install stock-lazrus to work with it? in the past, i've always just downloaded the three .deb install packages from sourceforge: https://sourceforge.net/projects/lazarus/ and ended up with things residing in /usr/share and /usr/bin - the downside of this being that one needs sudo to make library changes and can't add new components to the IDE. Don - am really happy to hear that there has been some progress, any idea if this is something that is months, years, or longer away? cheers, rob   :-) ---------------------------------------------------------------------- Fred vS · 2024-08-17 16:14 Quote from: robert rozee on August 17, 2024, 04:39:19 pmhi Fred   :-) i'd forgotten about your fpc-ootb, to be honest i've not been doing much programming at all over the last few months. a quick question - am i right in saying fpc-ootb does not include the lazarus IDE and LCL? if not, is there any sort of 'lazarus-ootb', or a set of instructions on how to install stock-lazrus to work with it? in the past, i've always just downloaded the three .deb install packages from sourceforge: https://sourceforge.net/projects/lazarus/ and ended up with things residing in /usr/share and /usr/bin - the downside of this being that one needs sudo to make library changes and can't add new components to the IDE. Don - am really happy to hear that there has been some progress, any idea if this is something that is months, years, or longer away? cheers, rob   :-) Hello Rob!! fpc-ootb is a fork of Free Pascal compiler with all the features that I really need (and that fpc devs are welcome to add... ) For Lazarus IDE and LCL maybe there are some libc methods that need to sign too, I did not check LCL code. But I have compiled the Lazarus app LazPaint using fpc-ootb and it can be run on very old distros and all the libc methods are signed with old libc compatible table. Fre;D