Problems with libraries for cross x86_64-linux to aarch64-freebsd lazarus / 32-Linux ---------------------------------------------------------------------- regs · 2025-07-15 09:41 Cross is made with fpcupdeluxe. But it's installing very old libraries and there are some libraries are missing. There are newer FreeBSD 14 libraries for x86_64, and they are linking, but no for aarch64. https://github.com/LongDirtyAnimAlf/fpcupdeluxe/releases/download/cros slibs_all/FreeBSD_AMD64_FreeBSD_14.zip So I made a comprehensive set of libraries: https://drive.google.com/file/d/1VwHRspOw6qwzBAFqiA3fd_OmyPwFhjYA/view ?usp=sharing But.. they still won't link with a errors: Error: /opt/fpcupdeluxe/cross/bin/aarch64-freebsd/aarch64-freebsd13-ld.bfd: /opt/fpcupdeluxe/fpc/units/aarch64-freebsd/rtl/system.o: undefined reference to symbol 'atan@@FBSD_1.0' Error: /opt/fpcupdeluxe/cross/bin/aarch64-freebsd/aarch64-freebsd13-ld.bfd: /opt/fpcupdeluxe/cross/lib/aarch64-freebsd//libm.so.5: error adding symbols: DSO missing from command line What possibly could be missing? ---------------------------------------------------------------------- Thaddy · 2025-07-15 09:50 That aarch64-freebsd is NOT yet an officially supported platform? Supported are Linux, Android and iOS, not FreeBSD. Although fpcupdeluxe makes an effort, I still think it is not official. Note I am able to build a cross-compiler with fpcupdeluxe from both Windows64-x86_64 and linux64-x86_64 to aarch64-freebsd. The starting compilers are 3.3.1. I can't test and will not test them though: I have not freebsd installed on aarch64 anywhere and am not prepared to use one of my raspberry pi's for it, nor a vm. The cross-compilers just compile. I can add a binary for helloworld, though, for you to test if you want. That said: with the cross compiler you can also build fpc itself for your platform. ---------------------------------------------------------------------- DonAlfredo · 2025-07-15 10:36 Fpcupdeluxe has a tool to extract all needed libraries from your system. https://github.com/LongDirtyAnimAlf/fpcupdeluxe/tree/master/fpcuptools /libraryscanner Compile and run (takes some time) on your system and you should end up with all libraries needed to cross-compile towards your system. ---------------------------------------------------------------------- Thaddy · 2025-07-15 11:43 Yes, that works for the cross-compiler at least. ---------------------------------------------------------------------- DonAlfredo · 2025-07-15 11:57 Good. But always check the contents of the libc.so file. Must contain relative path when it is a stub. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i GROUP ( libc.so.7 libc_nonshared.a libssp_nonshared.a ) ---------------------------------------------------------------------- regs · 2025-07-15 18:23 Quote from: Thaddy on July 15, 2025, 11:50:34 amI can't test and will not test them though: I have not freebsd installed on aarch64 anywhere and am not prepared to use one of my raspberry pi's for it, nor a vm. The cross-compilers just compile. I can add a binary for helloworld, though, for you to test if you want. That said: with the cross compiler you can also build fpc itself for your platform. An empty app does compile and link, but library pack is missing a lot of libraries and it's old. FreebSD 10 packages are no longer available on pkg.freebsd.org. Quote from: DonAlfredo on July 15, 2025, 12:36:56 pmFpcupdeluxe has a tool to extract all needed libraries from your system. https://github.com/LongDirtyAnimAlf/fpcupdeluxe/tree/master/fpcuptools /libraryscanner Compile and run (takes some time) on your system and you should end up with all libraries needed to cross-compile towards your system. Well, unfortunately I don't have a space for free system on my VM drive. I just collected all the same files from that are in crosslibs_all FreeBSD AMD64 set, which is working, from pkg.freebsd.org (and a help of freebsd.pkgs.org). And even more - all libraries that are in packages of those libraries. It's not complaining on missing files, but something else. Could be ld issue? Cross tools i guess are installed from here https://github.com/LongDirtyAnimAlf/fpcupdeluxe/releases/download/linu x_amd64_crossbins_all/FreeBSD_AArch64_FreeBSD13_V240.zip Quote from: DonAlfredo on July 15, 2025, 01:57:13 pmGood. But always check the contents of the libc.so file. Must contain relative path when it is a stub. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i GROUP ( libc.so.7 libc_nonshared.a libssp_nonshared.a )I did fix libc.so, so as libncursesw.so and libc++.so and all symlinks. ---------------------------------------------------------------------- myisjwj · 2025-07-16 11:41 lazaurs自建库文件系统 https://www.cnblogs.com/jwjss/p/17920165.html ---------------------------------------------------------------------- DonAlfredo · 2025-07-16 13:03 Two things you need to do: 1: You are missing libinotify; so add it to your libs. 2: Your libc.so must contain QuoteGROUP ( libc.so.7 libc_nonshared.a libm.a) ---------------------------------------------------------------------- regs · 2025-07-17 21:43 Spent whole day yesterday trying to get FreeBSD 14.3 running with qemu-system-aarch64 to no avail. Video driver seem to be broken, so Xorg is not possible under aarch64 Qemu. Quote from: DonAlfredo on July 16, 2025, 03:03:27 pmTwo things you need to do: 1: You are missing libinotify; so add it to your libs. 2: Your libc.so must contain QuoteGROUP ( libc.so.7 libc_nonshared.a libm.a)Adding libm.a to libc.so and libinotify actually worked. Links now. Here is full compilation of libraries aarch64-freebsd.txz https://drive.google.com/file/d/10outbK05_ERAzb86ZvOWQhKqJlwxL0Hc/view ?usp=sharing ---------------------------------------------------------------------- regs · 2025-07-19 00:31 Also aarch64-linux.txz. Taken from Ubuntu 25.04. But those are not compatible with ld coming with fpCupDeluxe. Requires up to date ld. Some symlinks could be missing in some conditions, but i was able to compile and link my apps with gtk2, gtk3, qt5 and qt6 from x86_64. https://drive.google.com/file/d/1Vx49zOh_i_pCkAgM4KgG8yGyYTq9RHyF/view ?usp=sharing ---------------------------------------------------------------------- Thaddy · 2025-07-19 04:01 FreeBSD also changed to wayland? then for Xorg to work you must set a compatibility mode and I don't know what that is for FreeBSD, Similar exists in RaspberryPi OS, which is Debian derived. ---------------------------------------------------------------------- DonAlfredo · 2025-07-19 07:40 @regs It would be good if you extract the libs with my previous mentioned library scanner. It will copy only the needed libs, making the size of the all the libs smaller. ---------------------------------------------------------------------- Thaddy · 2025-07-19 11:08 Quote from: myisjwj on July 16, 2025, 01:41:38 pmlazaurs自建库文件系统 https://www.cnblogs.com/jwjss/p/17920165.html Yes, it can be successfully compiled as a cross-compiler. I did that and mentioned that. That doesn't mean it works, although all is compiled including all the standard libraries. From the freeBSD website: 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 Because Wayland does not provide the X server, and expects compositors to provide that support, X11 window managers that do not yet support Wayland will require that Xwayland is not started with the -rootless parameter. The -rootless parameter, when removed, will restore X11 window manager support.So there's something similar to what I mentioned before for Debian derivatives. https://docs.freebsd.org/en/books/handbook/wayland/ For good measure, this really isn't a Lazarus issue, but a platform issue. ---------------------------------------------------------------------- regs · 2025-07-19 11:54 Quote from: DonAlfredo on July 19, 2025, 09:40:44 am@regs It would be good if you extract the libs with my previous mentioned library scanner. It will copy only the needed libs, making the size of the all the libs smaller. But libraries from different versions would be just incompatible. Adding missing libraries was first step to attempt. It's just ends up in lots of references errors. So ended up taking all libs from same distro. QuoteThat doesn't mean it works, although all is compiled including all the standard libraries.Original libraries missing xkbcommon, qt6 libs, qt5 libs and something else, don't rememeber. I tested compiled apps with gtk2, qt5 and qt6 on FreeBSD 14.3 x86_64. They work. But i use X11. I'm not a fan of Wayland. And the app i was working is for X11. At least for now, until Wayland is more developer and user friendly. I can't test AArch64. Graphics won't run under Qemu emulation. ---------------------------------------------------------------------- regs · 2025-07-19 12:00 riscv64-linux.txz Compiles and links with gtk2, gtk3 and qt6. There is no libqt5pas in Debian, and therefore Ubuntu, for riscv64. https://drive.google.com/file/d/1SegEKdz9KUcBTkbcHkCVpBiZ2wvMi_gF/view ?usp=sharing On assembler errors https://gitlab.com/freepascal.org/fpc/source/-/issues/40880 ---------------------------------------------------------------------- regs · 2025-07-19 22:25 And the last batch for Loongarch64 Linux. Taken from Debian Ports Unstable (probably trixie, but i couldn't find affiliation of port names to official names). Compiles and links for gtk2, gtk3 and qt6. There is no libqt5pas in Debian for loong64. No ld update required. loongarch64-linux.txz https://drive.google.com/file/d/1PfFYohvPBaC186CLlGl1ajvc18nLn8q8/view ?usp=sharing That's it for now i guess. Other platforms aren't much popular for GUI. NetBSD and OpenBSD would probably have very different package names from FreeBSD, so would be time consuming. I looked up on libraryscanner source and it seem should be running from inside OS. But I really  don't have space to install them on VM. Instead i just compiled package list, downloaded with apt-get and fixed missing symlinks. 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 #!/bin/bash   # arch="amd64"# arch="arm64"# arch="riscv64"arch="loong64" package_list=("libharfbuzz-gobject0" "libcap2" "libstdc++6" "libatomic1" "libbz2-1.0" "libjpeg-turbo8" "libc6" "libc6-dev" "libqt6widgets6" "libqt6printsupport6" "libqt6pas6" "libqt6gui6" "libqt6dbus6" "libqt6core6t64" "libqt5x11extras5" "libqt5widgets5t64" "libqt5printsupport5t64" "libqt5pas1" "libqt5network5t64" "libqt5gui5t64" "libqt5core5t64" "libglvnd0" "libopengl0" "libxinerama1" "libxrandr2" "libsdl2-2.0-0" "libx11-6" "libxau6" "libxcomposite1" "libxcursor1" "libxdamage1" "libxdmcp6" "libxext6" "libxfixes3" "libxi6" "libxrender1" "libxss1" "libxtst6" "libxxf86vm1" "libasound2t64" "libatk1.0-0t64" "libatk- bridge2.0-0t64" "libatspi2.0-0t64" "libb2-1" "libblkid1" "libgdm1" "libfribidi0" "libbrotli1" "libbsd0" "libcairo-gobject2" "libcairo2" "libcom-err2" "libcrypt1" "libdatrie1" "libdbus-1-3" "libdeflate0" "libdouble-conversion3" "libdrm2" "libepoxy0" "libexpat1" "libffi-dev" "libffi8" "libfluidsynth3" "libfontconfig1" "libfreetype6" "libgcc-s1" "libgssapi-krb5-2" "libgcc-14-dev" "libgcrypt20" "libgdk-pixbuf-2.0-0" "libgomp1" "libgpg-error0" "libgraphite2-3" "libglib2.0-0t64" "libjack0" "libtiff6" "libgtk2.0-0t64" "libgtk-3-0t64" "libcloudproviders0" "libharfbuzz-icu0" "libharfbuzz0b" "libicu76" "libinstpatch-1.0-2" "libjbig0" "libjpeg62" "libzstd1" "libpangocairo-1.0-0" "libpangoft2-1.0-0" "libmd0" "libk5crypto3" "libkeyutils1" "libkrb5support0" "libkrb5-3" "liblz4-1" "liblzma5" "libmd4c0" "libmodplug1" "libmount1" "libmpg123-0t64" "libogg0" "libopus0" "libopusfile0" "libpango-1.0-0" "libpcre3" "libpcre2-16-0" "libpcre2-8-0" "libpixman-1-0" "libpng16-16t64" "libreadline8t64" "libpulse0" "libglx0" "libgl1" "libflac14" "libegl1" "libwayland- cursor0" "libselinux1" "libsndfile1" "libsqlite3-0" "libsystemd0" "libthai0" "libtinfo6" "libuuid1" "libvorbis0a" "libvorbisfile3" "libvorbisenc2" "libvulkan1" "libwayland-server0" "libwayland-egl1" "libwayland-client0" "libwayland-client0" "libwebp7" "libxcb1" "libxcb-shm0" "libxcb-render0" "libxkbcommon0" "zlib1g") for package in "${package_list[@]}"do  echo   #echo "\/ apt-cache madison $package:$arch"  #apt-cache madison $package:$arch  echo "Downloading $package:$arch..."  apt-get download $package:$archdone # dpkg --add- architecture arm64# dpkg --remove-architecture arm64# deb [arch=arm64] http://deb.debian.org/debian-ports/ unstable main contrib# deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports plucky main restricted universe multiverse# deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports plucky-updates main restricted universe multiverse ---------------------------------------------------------------------- DonAlfredo · 2025-07-20 10:29 https://github.com/LongDirtyAnimAlf/fpcupdeluxe/commit/78d176be455ff31 32852ded12c918a62273c78d9 Thanks.