[fpc-devel] 68k question
J. Gareth Moreton
gareth at moreton-family.com
Tue Dec 22 00:57:50 CET 2020
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
On 21/12/2020 23:18, Karoly Balogh (Charlie/SGR) wrote:
> Hi,
>
> On Mon, 21 Dec 2020, J. Gareth Moreton via fpc-devel wrote:
>
>> 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.
> 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,
> --
> Charlie
--
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
More information about the fpc-devel
mailing list