No longer able to cross-compile to linux-i386 from linux-x86_64 lazarus / 32-Linux ---------------------------------------------------------------------- Gustavo 'Gus' Carreno · 2021-11-05 07:00 Hey Y'all, Looks like my Ubuntu 21.20 has recently updated something in the libc area an I'm now unable to cross compile to linux-i386 from linux-x86_64. I just ran lazbuild -B on a small project that has no external dependencies and this is the error that it spits out: 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 Free Pascal Compiler version 3.2.2-r49371 [2021/05/21] for i386Copyright (c) 1993-2021 by Florian Klaempfl and others(1002) Target OS: Linux for i386(3104) Compiling example.lpr(3104) Compiling ./forms/examples.forms.main.pas(3104) Compiling /home/gcarreno/Programming/lazAPIBay/src/tpb.query.pas(3104) Compiling /home/gcarreno/Programming/lazAPIBay/src/tpb.queryitem.pas(3104) Compiling /home/gcarreno/Programming/lazAPIBay/src/json/tpb.json.utils .pas/home/gcarreno/Programming/lazAPIBay/example/./forms/examples.form s.main.pas(81,26) Hint: (5024) Parameter "Sender" not used/home/gcarre no/Programming/lazAPIBay/example/./forms/examples.forms.main.pas(82,27 ) Hint: (5024) Parameter "Sender" not used/home/gcarreno/Programming/l azAPIBay/example/./forms/examples.forms.main.pas(83,37) Hint: (5024) Parameter "Sender" not used/home/gcarreno/Programming/lazAPIBay/exampl e/./forms/examples.forms.main.pas(83,54) Hint: (5024) Parameter "User" not used/home/gcarreno/Programming/lazAPIBay/example/./forms/examples. forms.main.pas(79,25) Hint: (5024) Parameter "Sender" not used/home/gc arreno/Programming/lazAPIBay/example/./forms/examples.forms.main.pas(7 7,34) Hint: (5024) Parameter "Sender" not used/home/gcarreno/Programmi ng/lazAPIBay/example/./forms/examples.forms.main.pas(78,32) Hint: (5024) Parameter "Sender" not used/home/gcarreno/Programming/lazAPIBay /example/./forms/examples.forms.main.pas(80,30) Hint: (5024) Parameter "Sender" not used(9022) Compiling resource /home/gcarreno/Programming/ lazAPIBay/bin/lib/i386-linux/example.or(9015) Linking /home/gcarreno/P rogramming/lazAPIBay/bin/linux/i386/example/usr/bin/ld: /home/gcarreno/FreePascal_stable/fpc/units/i386-linux/rtl/si_c21.o: in function `SI_C21_$$__FPC_LIBC21_START':si_c21.pp:(.text.n_si_c21_$$__f pc_libc21_start+0x27): undefined reference to `__libc_csu_fini'/usr/bin/ld: si_c21.pp:(.text.n_si_c21_$$__fpc_libc21_start+0x2c): undefined reference to `__libc_csu_init'/home/gcarreno/Programming/lazAPIBay/exa mple/example.lpr(47,1) Error: (9013) Error while linking/home/gcarreno/Programming/lazAPIBay/example/example.lpr(47,1) Fatal: (10026) There were 1 errors compiling module, stoppingFatal: (1018) Compilation abortedError: /home/gcarreno/FreePascal_stable/fpc/bin/x86_64-linux/ppcross386 returned an error exitcodeError: (lazarus) Compile Project, Mode: Release-linux-i386, CPU: i386, Target: /home/gcarreno/Programming/lazAPIBay/bin/linux/i386/example: stopped with exit code 1Error: (lazbuild) failed compiling of project /home/gcarreno/Programming/lazAPIBay/example/example.lpi As you can see, there's an issue with libc_csu_fini, libc_csu_init not being found. I've tried it with both stable and laz-main(former trunk) and have the same result. Can anyone make sense of this and maybe point me in a direction to solve it, or to report it? All the thanks in advance Cheers, Gus P.S.: To the moderator of the day, please feel free to move this thread. I'm completely unsure if this is the right place to drop it. Thanks!! ---------------------------------------------------------------------- Thaddy · 2021-11-05 07:40 It may be that the GNU compiler and linker is updated and the linker can not find the correct path. Can you check the path to the latest libc and ld? i.e. the .so.? I have run into a similar issue before on Debian. ---------------------------------------------------------------------- dbannon · 2021-11-05 11:05 I wonder if you need to ensure that you have the updated 32bit libc ?  Maybe the update process did not spot you have 32bit kit there ? And check where it is, you need to ensure your fpc.cfg looks there.  Its just possible that Ubunu has moved their 32bit libraries. If they can put Firefox in a snap, they might do anything !  I always have to manually edit fpc.cfg when setting up for 32bit cross compile, details on the wiki. Davo ---------------------------------------------------------------------- Gustavo 'Gus' Carreno · 2021-11-05 13:36 Hey Thaddy, Quote from: Thaddy on November 05, 2021, 08:40:52 amIt may be that the GNU compiler and linker is updated and the linker can not find the correct path. Can you check the path to the latest libc and ld? i.e. the .so.? I have run into a similar issue before on Debian. Thanks for the tip. I'll have a looksie with some i386 binaries I had cross compiled before and find out what ldd tells me about the libs. Cheers, Gus ---------------------------------------------------------------------- Gustavo 'Gus' Carreno · 2021-11-05 13:43 Hey Davo, Quote from: dbannon on November 05, 2021, 12:05:30 pmI wonder if you need to ensure that you have the updated 32bit libc ?  Maybe the update process did not spot you have 32bit kit there ? I'll make extra sure but I'm pretty sure my system is aware of the 32b stuff since I get a warning every time I try to update 2 repos that don't have it any more. One is the .NET 6 I recently installed. The other is Google Chrome, if I'm not mistaken. Quote from: dbannon on November 05, 2021, 12:05:30 pmAnd check where it is, you need to ensure your fpc.cfg looks there.  Its just possible that Ubunu has moved their 32bit libraries. If they can put Firefox in a snap, they might do anything !  I did have to install something and change my fpc.cfg due to the error for the crt not being found when linking. Somehow that went away for a while and now it's this new missing thing... Quote from: dbannon on November 05, 2021, 12:05:30 pmI always have to manually edit fpc.cfg when setting up for 32bit cross compile, details on the wiki. Thanks, Davo, for the tips, I'll go through them one by one, plus the ones from Thaddy and see what I can fix. Cheers, Gus