ElistError in FPC cross compiler release mode for x86_64 to loongarch lazarus / 64-FPC development ---------------------------------------------------------------------- TYDQ · 2024-05-27 13:27 My full pascal code is on Github https://github.com/TYDQSoft/UEFIPascalOS I have run the buildall.sh to compile x86_64 arch,cross compile aarch64 arch and loongarch64 arch. buildall.sh: Code: Bash  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i         mkdir installer        mkdir kernel        /home/tydq/source/compiler/ppc1 -Aas -n -O1 -Si -Sc -Sg -Xd -Us -CX -XXs -Px86_64 -Rintel -Cg system.pas        /home/tydq/source/compiler/ppc1 -Aas -n -O1 -Si -Sc -Sg -Xd -CX -XXs -Px86_64 -Rintel -Cg uefiinstaller.pas         /home/tydq/source/compiler/ppc1 -Aas -n -O1 -Si -Sc -Sg -Xd -CX -XXs -Px86_64 -Rintel -Cg uefimain.pas         ld --gc-sections -nostdlib -znocombreloc -shared -Bsymbolic --no-keep-memory uefiinstaller.o uefi.o tydqfs.o system.o -e efi_main -o installer.so        objcopy -O efi-app-x86_64 installer.so installer/bootx64.efi        ld --gc- sections -nostdlib -znocombreloc -shared -Bsymbolic --no-keep-memory uefimain.o uefi.o tydqfs.o system.o -e efi_main -o main.so        objcopy -O efi-app-x86_64 main.so kernel/bootx64.efi        rm *.o       rm *.ppu        rm *.so        /home/tydq/source/compiler/ppcrossa64 -XPaarch64-linux-gnu- -Aas -n -O1 -Si -Sc -Sg -Xd -Us -CX -XXs -Cg -Tlinux system.pas        /home/tydq/source/compiler/ppcrossa64 -XPaarch64-linux-gnu- -Aas -n -O1 -Si -Sc -Sg -Xd -CX -XXs -Cg -Tlinux uefiinstaller.pas         /home/tydq/source/compiler/ppcrossa64 -XPaarch64-linux-gnu- -Aas -n -O1 -Si -Sc -Sg -Xd -CX -XXs -Cg -Tlinux uefimain.pas         aarch64-linux-gnu-ld --gc-sections -nostdlib -znocombreloc -shared -Bsymbolic --no-keep-memory uefiinstaller.o uefi.o tydqfs.o system.o -e efi_main -o installer.so        aarch64-linux-gnu-objcopy -O efi- app-aarch64 installer.so installer/bootaa64.efi        aarch64-linux- gnu-ld --gc-sections -nostdlib -znocombreloc -shared -Bsymbolic --no- keep-memory uefimain.o uefi.o tydqfs.o system.o -e efi_main -o main.so        aarch64-linux-gnu-objcopy -O efi-app-aarch64 main.so kernel/bootaa64.efi        rm *.o         rm *.ppu        rm *.so      /home/tydq/source/compiler/ppcrossloongarch64 -XPloongarch64-linux- gnu -Aas -n -O- -Si -Sc -Sg -Xd -Us -CX -XXs -Cg system.pas        /home/tydq/source/compiler/ppcrossloongarch64 -XPloongarch64-linux-gnu -Aas -n -O- -Si -Sc -Sg -Xd -CX -XXs -Cg uefiinstaller.pas         /home/tydq/source/compiler/ppcrossloongarch64 -XPloongarch64-linux-gnu -Aas -n -O- -Si -Sc -Sg -Xd -CX -XXs -Cg uefimain.pas         loongarch64-linux-gnu-ld --gc-sections -nostdlib -znocombreloc -shared -Bsymbolic --no-keep-memory uefiinstaller.o uefi.o tydqfs.o system.o -e efi_main -o installer.so        loongarch64-linux-gnu-objcopy -O efi-app-loongarch64 installer.so installer/bootloongarch.efi        loongarch64-linux-gnu-ld --gc-sections -nostdlib -znocombreloc -shared -Bsymbolic --no-keep-memory uefimain.o uefi.o tydqfs.o system.o -e efi_main -o main.so        loongarch64-linux-gnu-objcopy -O efi-app- loongarch64 main.so kernel/bootloongarch.efi        rm *.o         rm *.ppu        rm *.so        dd if=/dev/zero of=fat.img bs=512 count=131072        /usr/sbin/mkfs.vfat -F 32 fat.img        mmd -i fat.img ::        mmd -i fat.img ::/EFI        mmd -i fat.img ::/EFI/BOOT        mmd -i fat.img ::/EFI/SETUP        mcopy -i fat.img installer/*.efi ::/EFI/BOOT        mcopy -i fat.img kernel/*.efi ::/EFI/SETUP        mkdir iso        cp fat.img iso        xorriso -as mkisofs -R -f -e fat.img -no-emul-boot -o TestOS.iso iso        rm -rf iso        rm -rf fat.img        rm -rf installer        rm -rf kernel        rm -rf *.soThe same code can be compiled in x86_64 and aarch64,but compile in loongarch64 it give me error: Error: Compilation raised exception internally An unhandled exception occurred at $000000000047C8B3: EListError: List index exceeds bounds (0)   $000000000047C8B3 So does anyone know the same code only can't be compiled in loongarch64 mode?(I have tested x86_64(host),aarch64,loongarch64) And does anyone know how to build aarch64 efi and loongarch64 efi correctly? ---------------------------------------------------------------------- TYDQ · 2024-05-30 10:56 I updated the binutils but the same error exists and I don't know why?Is it the internal error in fpc or my code is wrong? ---------------------------------------------------------------------- Thaddy · 2024-05-30 11:02 loongarch is not a common platform. If your code works on AARCH it is likely that loongarch  is at fault here. BTW, I find it commendable that your uefi compiler works, albeit not everywhere. That is a great achievement on its own! ---------------------------------------------------------------------- TYDQ · 2024-05-30 14:32 Quote from: Thaddy on May 30, 2024, 01:02:08 pmloongarch is not a common platform. If your code works on AARCH it is likely that loongarch  is at fault here. BTW, I find it commendable that your uefi compiler works, albeit not everywhere. That is a great achievement on its own! Yeah,I hope as the fpc updates the support of loongarch64 will be stable and normally. However,I cannot install clang cross compiler in x64 to aarch64 because my computer RAM is not enough and I need to change the way to generate efi files like using hacks  as gnu-efi do.The gnu-efi linker script is not suitable for pascal compiled objects because the exported file is too large.So it must have another way to solve the problem that elf to efi(I have tested the elf2efi in github,It is useless as it reminds .hash unrecognized).