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

2020-11-15 Thread Jonas Maebe via fpc-devel
On 15/11/2020 17:16, Karoly Balogh (Charlie/SGR) via fpc-devel wrote:
> e 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

This suggests you did not in fact reinstall the command line utilities.
That installer is what adds those files on that version of the OS.


Jonas
___
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] Issue with Compiling FPC and MacOS Big Sur

2020-11-15 Thread Jonas Maebe via fpc-devel
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.


Jonas
___
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:

> > 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 Jonas Maebe via fpc-devel
On 14/11/2020 16:51, Michael Ring via fpc-devel wrote:
> Hi Jonas, thank you for your answer!
> 
> I cannot say if I did see a warning or not when installing fpc-package
> but I did not reinstall commandline tools before or after installing the
> 3.2.0 compiler. They have been on all of my Macs for years.

They usually get removed when you upgrade to a new macOS version.

> What are you doing in the installer that creates that dependency?
> 
> My guess would be that you rewrite /etc/fpc.cfg (I think I saw on one of

That is correct.

> 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.

> So I guess the best solution would be to change the compiler Makefiles
> to add the Fl/Ff parameter to the compile when on a Mac. I am currently
> investigating this, what do you think, could that solve the issue once
> and for all? (We have already had this kind of conversation several
> times over the last years, usually on crt1.o
> 
> Fixing the Makefile will make this work for already existing compilers,
> I'd still propose to add this path from within fpc, when the linker
> commands are generated.
> 
> Or am I missing something ?

From the top of my head:
1) it won't work when cross-compiling on another platform, because xcrun
won't exist there. So it would create (invisible) compiler behaviour
differences depending on whether or not you're cross-compiling.
2) if someone compiles on macOS itself using a non-default SDK (e.g. to
build i386 binaries on 10.15+, or PPC/PPC64 binaries on 10.6+), this
should not be done. I could detect this by looking at whether or not a
-XR parameter is specified, but if someone uses -Fl/Ff instead, I have
no idea what would happen when mixing SDKs like that (and that, again,
could lead to very hard to debug problems).


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