Forum > Linux

[SOLVED] undefined reference to `fcntl@GLIBC_2.28'

(1/2) > >>

alpine:
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  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---undefined reference to `fcntl@GLIBC_2.28'
dumping the GLIBC syms of the troubled library:

--- Code: Text  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---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:
Solved (sort of) by binding fcntl() to a base version node into the C source with
--- Code: C  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---__asm__(".symver fcntl,fcntl@GLIBC_2.0");
According to:
https://forum.lazarus.freepascal.org/index.php/topic,58888.msg486108.html#msg486108 and https://web.archive.org/web/20160107032111/http://www.trevorpounds.com/blog/?p=103

MarkMLl:
Thanks for that, and... wow, /that/ thread :-(

MarkMLl

robert rozee:

--- Quote from: MarkMLl on August 16, 2024, 10:01:08 pm ---[...] /that/ thread :-(
--- End quote ---

"/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:

--- Quote from: robert rozee on August 17, 2024, 07:23:28 am ---
--- Quote from: MarkMLl on August 16, 2024, 10:01:08 pm ---[...] /that/ thread :-(
--- End quote ---

"/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   :-)

--- End quote ---

Hello Rob!

For those who don't want to wait too long, there is that solution.

Fre;D

Navigation

[0] Message Index

[#] Next page

Go to full version