Author Topic: [SOLVED] Assembler error ‘illegal operands’ when compiling on RISC-V 64 computer  (Read 7146 times)

PascalDragon

  • Hero Member
  • *****
  • Posts: 6454
  • Compiler Developer
Re: Assembler error ‘illegal operands’ when compiling on RISC-V 64 computer
« Reply #15 on: December 04, 2025, 09:50:58 pm »
From the comments above I got feeling only me and a couple of other stupid newbies don't have it working as a charm.  (*sarcasm*)

Because if one knows how to build FPC it's no problem, however you explicitly asked for an installer and there is none.

yurets_z

  • New member
  • *
  • Posts: 9
Re: Assembler error ‘illegal operands’ when compiling on RISC-V 64 computer
« Reply #16 on: December 04, 2025, 11:18:23 pm »
OK. Then its all clear. The request is solved. Time to go and ask elsewhere

Thausand

  • Hero Member
  • *****
  • Posts: 629
Re: Assembler error ‘illegal operands’ when compiling on RISC-V 64 computer
« Reply #17 on: December 05, 2025, 08:22:45 am »
OK. Then its all clear. The request is solved. Time to go and ask elsewhere
Ask elsewhere for installer or have ask elsewhere for build FPC ?

For installer that correct: is burden Linux distribution (there is exist debian linux package FPC and I have assume install x86 and risc is same then have copy-paste or have better use install script linux FPC that is store sourceforge).

For build is make cross-compile compiler. It make generate risc exe (and package/unit) then can make archive and have use install script SourceForge).

It not exist installer because risc target not finish (yet).
A docile goblin always follow HERMES.md

yurets_z

  • New member
  • *
  • Posts: 9
Ask elsewhere for constructive assistance.

Thausand

  • Hero Member
  • *****
  • Posts: 629
Ask elsewhere for constructive assistance.
Yes, I have understand but that is no tell what is constructive assistance for you :)

As write PascalDragon when ask for installer: There is no installer exists. It is no exists because FPC risc-v support not finish yet. When is risc-v for FPC finish then can make installer. Installer is for OS and FPC<>OS. Then is come play distribution/package maintainer and have make installer/package (or make script that other linux distribution is use and copy->pasta).

If want FPC for risc now then have need for build fpc and use github (development) source. That is prerequisite and have learn how build FPC (that is require read and understand for build-faq and wiki. I think there not exist dedicate FPC wiki risc-v.

If not know or no want know/learn how is build FPC then can use FPCUpDeluxe (Is exist version linux 64 bit riscv but then have no share what is exact target/host).

When ask assistance then question need be clear. That is no reflect for be constructive or no constructive :)
A docile goblin always follow HERMES.md

dbannon

  • Hero Member
  • *****
  • Posts: 3927
    • tomboy-ng, a rewrite of the classic Tomboy
 yurets_z, you seem to be getting a bit of a roasting here, I have no idea why. Thaddy is always rude to people, please disregard him. Please don't judge us all by this exchange.

It does seem you downloaded exactly what you should have, the readme for it says -

Quote
This snapshot fpc-3.3.1.riscv64-linux.built.on.x86_64-linux.tar.gz was generated 2026-01-14 12:14 on gcc421 using:
make singlezipinstall OS_TARGET=linux CPU_TARGET=riscv64 SNAPSHOT=1 "BUILDFULLNATIVE=1 BUILDFULLNATIVE=1" PP=ppcx64 CROSSOPT="-XR/home/muller/sys-root/riscv64-linux  -Fl/home/muller/sys-root/riscv64-linux/usr/lib64/lp64d  -Fl=/home/muller/sys-root/riscv64-linux//usr/lib64/lp64d  -Fl/home/muller/sys-root/riscv64-linux/usr/lib64/lp64  -Xd -k--sysroot=/home/muller/sys-root/riscv64-linux -dXr_disabled" OPT=""

I have never used those installers but looks like a good thing !

So, you are planning to run Lazarus (and FPC) on the SBC to do development work there ?  If so, you would be better to build a RISC-V64 compiler, not a cross compiler. Move it to the SBC and then run your Lazarus build there (if it has enough memory).

Alternatively, if you plan to develop on your x86_64 box and cross compile then you don't need to build Lazarus with the cross compiler, just build (or install) a standard Lazarus and set a project mode to use your cross compiler from within the IDE. The IDE just does IDE stuff, it passes the compiling to what ever compiler is necessary.

So, question, do you have an x86_64 compiler on your x86_64 machine ? The cross compiler you downloaded is not enough to build Lazarus.

Davo
Lazarus 4, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

yurets_z

  • New member
  • *
  • Posts: 9
Ok, thanks for the info. Seems like now there are available dedicated instructions for building risc-v compiler and cross compiler at the wiki https://wiki.freepascal.org/Instructions_for_building_the_Free_Pascal_Compiler_for_the_RISC-V.

The initial idea was to port and continue development of the existing project on a resource rich risc-v SBC and run the app on a low spec risc-v SBC.

Maybe one day I will return to that idea. Maybe when risc-v compiler /IDE will be released. Currently have no more time and motivation to play with those compilers and  cross compilers. The project still happily runs on the old x86 netbook.
« Last Edit: October 07, 2026, 01:12:55 am by yurets_z »

Thaddy

  • Hero Member
  • *****
  • Posts: 19978
  • Pointless static linking author
On - Debian - linux there are only two dependencies to compile trunk:
- buildessential (or its equivalent on non-debian derived nixes)
- fp-compiler package (does just install the compiler + rtl: you do not need the full fpc package which installs a lot more and does not make sense if you are going to build from scratch)
Both are in the distro's repositories.

For riscv cross-compilation you need the riscv toolchain to be installed:
e.g.:https://github.com/riscv-collab/riscv-gnu-toolchain

I also use a clang install. (but gnu would also work, I guess)

Debian (and derivatives):
Code: Bash  [Select][+][-]
  1. sudo apt install buildessential
  2. sudo apt install fp-compiler -y
Equivalents for buildessential for suse and fedora:
Code: Bash  [Select][+][-]
  1. sudo dnf groupinstall "Development Tools" "Development Libraries"
  2. sudo dnf install fp-compiler #check this! I seldom use a suse or fedora

There are no prebuilds for this. It involves some work, but quite easy work, even for beginners.
« Last Edit: October 07, 2026, 09:48:51 am by Thaddy »
Any "programmer" that knows only one programming language is not a programmer

 

TinyPortal © 2005-2018