Re: [fpc-devel] Issue with Compiling FPC and MacOS Big Sur

2020-11-15 Thread Karoly Balogh (Charlie/SGR) via fpc-devel
Hi,

On Sun, 15 Nov 2020, Jonas Maebe via fpc-devel wrote:

> > my Macs that the timestamp of that file changed), but this will not help
> > for compiling the compiler as the compiler is beeing compiled with the
> > flag -n which effectively turns off reading /etc/fpc.cfg.
>
> Indeed, I glossed over the fact that you were rebuilding FPC.
>
> > make clean all
> > OPT="-Fl/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib
> > -Ff/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks"
>
> You should use the -XR parameter
> (-XR/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk) instead of
> -Fl/Ff in this situation.

Yes, I already had to dothis in my build scripts on Mojave. I defined an
"FIXMOJAVE" environment var, which contains that -XR/Library/... path you
wrote above, and in all my build scripts I just do:

make OS_TARGET=foo CPU_TARGET=bar OPT="-other -args $FIXMOJAVE" CROSSOPT=...

It's not the most convenient thing, but it works.

Charlie
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel


Re: [fpc-devel] Issue with Compiling FPC and MacOS Big Sur

2020-11-15 Thread Karoly Balogh (Charlie/SGR) via fpc-devel
Hi,

On Sun, 15 Nov 2020, Jonas Maebe via fpc-devel wrote:

> On 15/11/2020 15:19, Karoly Balogh (Charlie/SGR) via fpc-devel wrote:
> >
> > Yes, I already had to dothis in my build scripts on Mojave. I defined an
> > "FIXMOJAVE" environment var, which contains that -XR/Library/... path you
> > wrote above, and in all my build scripts I just do:
> >
> > make OS_TARGET=foo CPU_TARGET=bar OPT="-other -args $FIXMOJAVE" CROSSOPT=...
>
> I also have macOS 10.14 (Mojave) and I don't need to specify any special
> options when building FPC. All libraries and object files are still
> available under /usr there, so I have no idea why it would be necessary
> in your case.

Me neither, but it's been like that ever since I upgrade to Mojave, that
these libs and objects are no longer in /usr/lib on my system. I used
Sierra on the same machine before, and that worked, then I updated to
Mojave and some then-recent XCode/command line utilities in one go
(without reinstall), and then the files were gone, I had to add this extra
argument to my FPC builds, otherwise things just didn't work.

But as I don't really develop native software on my Mac, only use to
crosscompile various versions of FPC, I never investigated further, it was
goon enough for me.

Charlie
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel


Re: [fpc-devel] 68k question

2020-12-21 Thread Karoly Balogh (Charlie/SGR) via fpc-devel
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___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel