Hi everyone,
I need to fix a bug with one of my optimisations that causes ppcross68k to raise an internal error. What target platform should I specify (cross-building from x86_64-win64)?
Gareth aka. Kit

Mailing lists / fpc-devel / 2020-12
12 messages · 3 people ·
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
Hi everyone,
I need to fix a bug with one of my optimisations that causes ppcross68k to raise an internal error. What target platform should I specify (cross-building from x86_64-win64)?
Gareth aka. Kit
Hi Graeth,
J. Gareth Moreton wroteI need to fix a bug with one of my optimisations that causes ppcross68k to raise an internal error. What target platform should I specify (cross-building from x86_64-win64)?
for example your could compile for m68k-amiga with
make crossall OS_TARGET=amiga CPU_TARGET=m68k CROSSOPT="-Avasm -XV"
you will need vasm and vlink (assembler and linker) I created them once already
you can download them here
http://build.alb42.de/fpcbinint/VasmVLinkforFPCWin32.zip
is that what you mean?
Greetings,
Marcus
That should be fine - thanks Marcus. I need to reproduce the internal error that's being reported, and so I can compare the disassembly of ppcross68k to see where my optimisation is going wrong.
Gareth aka. Kit
Hi Gareth,
btw it was catched by the build server
http://build.alb42.de:8080/job/FPC_m68k-amiga/6948/console http://build.alb42.de:8080/job/FPC_m68k-atari/6659/console http://build.alb42.de:8080/job/FPC_m68k-linux/6941/console
you can see if you get the same error message
Good luck.
So far under Windows, it compiled successfully:
make crossinstall CPU_TARGET=m68k OS_TARGET=amiga CROSSOPT="-Avasm -XV" CROSSBINDIR=C:\Users\garet\Documents\programming\fpc\VasmVLinkforFPCWin32
Is there anything particular that I need to do?
Gareth aka. Kit
Hi,
no, nothing special the server just do a
make distclean
make distclean
echo '###### start AMIGA making 68020'
make zipinstall PACKDIR=/tmp/jenkins-FPC_m68k-amiga-6948 OS_TARGET=amiga CPU_TARGET=m68k 'CROSSOPT=-Avasm -XV -Cp68020'
but the CPU options should do no difference because atari is compiled for 68000 and shows the same error
maybe the starting compiler is different?
the build server uses 3.2.0 as starting compiler
Greetings,
Marcus
No, I'm using 3.2.0 as well. It might be that it only shows up if you cross-build from Linux. I'll keep investigating.
Gareth aka. Kit
Hi,
I have a docker container with Lazarus/fpc3.2 and these vlink/vasm installed if it would help?
Greetings,
Marcus
I'll try my Ubuntu virtual machine first and get back to you. I'll get to the bottom of this!
Gareth aka. Kit
maybe you need this:
http://build.alb42.de/fpcbinint/VasmVlinkForFPCLinuxx64.tar.gz
;)
That should be fine - thanks Marcus. I need to reproduce the internal error that's…
Hi,
J. Gareth Moreton wroteThat should be fine - thanks Marcus. I need to reproduce the internal error that's being reported, and so I can compare the disassembly of ppcross68k to see where my optimisation is going wrong.
To bould any cross compiler, you don't even need the assembler for that particular platform, and you don't need to disassemble, you can just ask the compiler to generate an assembly source for you instead.
Here's how I'd build in this case:
make crossall CPU_TARGET=m68k OS_TARGET=amiga OPT="-al" CROSSOPT="-al -sh"
The OPT="-al" part will make sure that an external assembler is used to generate the crosscompiler assembly sources, and the compiler source lines are intermixed as comments with the generated assembly. Then resulting files will be placed in compiler/m68k/units/*.s
The code for the particular IE you're looking for will be in compiler/m68k/units/cgcpu.s, but of course it's possible the wrong code is not there, but somewhere where this function is called from, or in optimize_op_const() which is called right before that IE occurs.
You'll probably need Windows binutils to compile the compiler like this, because the use of the internal assembler is omitted. But I find this much more useful than digging into disassemblies...
Then CROSSOPT="-al -sh" is for triggering the crosscompiler part, "-al" will make sure again, that assembly sources are generated, and "-sh" will skip the assembling (and potentially linking, but that's not used for this particular build) for the target platform, which means you won't need any external utilities for the target platform. The generated m68k assembly files will be in rtl/units/m68k-amiga, and in the respective packages directories.
Cheers,
Hi Karoly,
Don't worry, I know I don't need a disassembler. It's more to build the cross compiler on an x86_64 machine and compare the assembly sources with -a as you mention, since an internal error gers generated for some reason via one of my new optimisations.
Gareth aka. Kit