[SOLVED] "Fatal: Can't find unit used by Program" ERROR - FPC Bug lazarus / 64-FPC development ---------------------------------------------------------------------- Key-Real · 2024-07-09 17:24 As I updated to the new gitlab version today, I have the 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 Free Pascal Compiler version 3.3.1 [2024/07/09] for mipselCopyright (c) 1993-2024 by Florian Klaempfl and othersTarget OS: PlayStation 1 for MIPSELCompiling test.pastest.pas(1,6) Note: tgobj: (SetFirstTempGen) set to 104test.pas(5,1) Note: tgobj: (ResetTempGen) all temps freedFatal: Can't find unit  used by ProgramFatal: Compilation aborted  error if I wanna compile this program: 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 begin      asm                move $a1, $11111111        end;end. all this compiles whitout any issues: 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 /compiler/ppcrossmipsel ./rtl/ps1/system.pp -Tps1 -Fi./rtl/mipsel -Fi./rtl/inc -Fi./rtl/ps1 -a -XP/usr/local/mipsel-unknown- elf/bin/mipsel-unknown-elf- -Cfnone./compiler/ppcrossmipsel ./rtl/inc/fpintres.pp -Tps1 -Fu./rtl/ps1 -Fi./rtl/mipsel -Fi./rtl/inc -Fi./rtl/ps1 -a -XP/usr/local/mipsel-unknown-elf/bin/mipsel-unknown- elf- -Cfnone ./compiler/ppcrossmipsel ./rtl/ps1/si_prc.pp -Tps1 -Fu./rtl/ps1 -Fi./rtl/mipsel -Fi./rtl/inc -Fi./rtl/ps1 -a -XP/usr/local/mipsel-unknown-elf/bin/mipsel-unknown-elf- -Cfnone ./compiler/ppcrossmipsel ./rtl/ps1/objpas.pp -Tps1 -Fu./rtl/ps1 -Fi./rtl/mipsel -Fi./rtl/inc -Fi./rtl/ps1 -a -XP/usr/local/mipsel- unknown-elf/bin/mipsel-unknown-elf- -Cfnone whats this???? ---------------------------------------------------------------------- Key-Real · 2024-07-09 20:35 here the repo to play with: https://gitlab.com/Key-Real/source build with: 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 make compiler_cycle CPU_TARGET=mipsel OS_TARGET=ps1 OPT="-O- -CR -glv" CROSSOPT="-O- -g-" ALLOW_WARNINGS=1 compile with 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 ./compiler/ppcrossmipsel test.pas -Fu./rtl/ps1 -Fu./rtl/inc -Fu./rtl/objpas -Tps1 -Cfnone -a -XP/usr/local/mipsel-unknown- elf/bin/mipsel-unknown-elf- don't forget to build the RTL: 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     ./compiler/ppcrossmipsel ./rtl/ps1/system.pp -Tps1 -Fi./rtl/mipsel -Fi./rtl/inc -Fi./rtl/ps1 -a -XP/usr/local/mipsel-unknown- elf/bin/mipsel-unknown-elf- -Cfnone    ./compiler/ppcrossmipsel ./rtl/inc/fpintres.pp -Tps1 -Fu./rtl/ps1 -Fi./rtl/mipsel -Fi./rtl/inc -Fi./rtl/ps1 -a -XP/usr/local/mipsel-unknown-elf/bin/mipsel-unknown- elf- -Cfnone    ./compiler/ppcrossmipsel ./rtl/ps1/si_prc.pp -Tps1 -Fu./rtl/ps1 -Fi./rtl/mipsel -Fi./rtl/inc -Fi./rtl/ps1 -a -XP/usr/local/mipsel-unknown-elf/bin/mipsel-unknown-elf- -Cfnone    ./compiler/ppcrossmipsel ./rtl/ps1/objpas.pp -Tps1 -Fu./rtl/ps1 -Fi./rtl/mipsel -Fi./rtl/inc -Fi./rtl/ps1 -a -XP/usr/local/mipsel- unknown-elf/bin/mipsel-unknown-elf- -Cfnone ---------------------------------------------------------------------- Key-Real · 2024-07-10 06:23 I toke today, the whole day, free from work to continue on the port. Can't proceed so please give me ideas about this bug, unimportant how strange they are ---------------------------------------------------------------------- Thaddy · 2024-07-10 07:02 A BASM configuration bug? ---------------------------------------------------------------------- Key-Real · 2024-07-10 07:07 whats BASM? ---------------------------------------------------------------------- Thaddy · 2024-07-10 09:11 The internal assembler syntax files. It seems you did not do that part correctly for mipsel. You have to explicitly implement that part of the compiler. It is actually a compiler on its own, but the compiler sources are such that basm, also known as internal assembler, is not that difficult to implement. that is: for the people that want to write their own compilers... ---------------------------------------------------------------------- Key-Real · 2024-07-10 09:22 I done no changes in ./compiler/mips at this stage ---------------------------------------------------------------------- Thaddy · 2024-07-10 13:59 But follow that lead: it must be somewhere there. ---------------------------------------------------------------------- ccrause · 2024-07-10 14:03 Quote from: Thaddy on July 10, 2024, 11:11:53 amThe internal assembler syntax files. It seems you did not do that part correctly for mipsel. You have to explicitly implement that part of the compiler. It is actually a compiler on its own, but the compiler sources are such that basm, also known as internal assembler, is not that difficult to implement. that is: for the people that want to write their own compilers... There is an internal assembler parser for mips, so unlikely to be the cause of the error. @Key-Real: Does the test program compile successfully if you delete the asm block, or have an empty asm block? ---------------------------------------------------------------------- Key-Real · 2024-07-10 15:30 I can do whatever (delete the block, have ann empty block, put more code...) I wanna, still the same result. Unfortunly something was changed in the mips code since I forked last time(about two months ago).  I could compile and run on real hardware and had everything working. Well the bug came only on programs not at units ---------------------------------------------------------------------- Key-Real · 2024-07-10 16:33 I copyied the racpugas.pas from the old fork to the new one, the behavier is still the same ---------------------------------------------------------------------- Key-Real · 2024-07-10 16:38 I complitley replaced the whole ./compiler/mips folder with the old (working) folder. The bug is still there ---------------------------------------------------------------------- ccrause · 2024-07-10 19:16 So the compiler error then has nothing to do with the inline assembler. Looking at the original error, it seems to be the regular error message, just without a unit name.  Just taking a wild guess, a unit dependency is added on the compiler side, but no name is assigned? Or maybe starts with a null character? The error is triggered either in pmodules.pas or fppu.pas.  My suggestion is to debug the compiler, set  breakpoints on the lines linked to earlier, then look at the stack trace to figure out why an empty unit name crops up. Alternatively, add -va when compiling your test program, this will show a lot more information. There is a small possibility that someone can figure out what leads to your error. ---------------------------------------------------------------------- Key-Real · 2024-07-11 11:21 I can compile MIPSEL for LINUX and it works, except the linking, but he passes the stage with my Issue. Can this info help? ---------------------------------------------------------------------- Key-Real · 2024-07-11 11:54 AHA! in ./compiler/systems.pas in systems_internal_sysinit I removed system_mipsel_ps1 now it compiles but ofcourse doesn't link Does this info helps? ---------------------------------------------------------------------- Key-Real · 2024-07-11 13:28 ohman, someone changed the default   LINKER.sysinitunit to '' !! now I have to specify this in 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 procedure TLinkerPS1.InitSysInitUnitName;begin  sysinitunit:='si_prc';end;