We've had this discussion (Jonas and me) a looong time ago (2013) with MacOS Maverics....
In the past, when xcode commandline tools was installed it created a link to crt1.10.5.o in /usr/lib.
It now seems that this is not done anymore (at least not on my computer...) and as /usr/lib is write protected for root in newer versions of MacOSX it is not that easy to create a link by hand.
The good news is that
clang -print-search-dirs
programs: =/Library/Developer/CommandLineTools/usr/bin libraries: =/Library/Developer/CommandLineTools/usr/lib/clang/10.0.0
returns a libraries path that helps finding a valid crt1.(10.5).o file:
find /Library/Developer/CommandLineTools/ -name "crt1*" /Library/Developer/CommandLineTools//SDKs/MacOSX.sdk/usr/lib/crt1.o /Library/Developer/CommandLineTools//SDKs/MacOSX.sdk/usr/lib/crt1.10.5.o /Library/Developer/CommandLineTools//SDKs/MacOSX.sdk/usr/lib/crt1.10.6.o
I managed to get a successful compile by doing this:
make clean buildbase CPU_TARGET=x86_64 INSTALL_PREFIX=$HOME/3.1.1 FPCOPT="-XR/Library/Developer/CommandLineTools//SDKs/MacOSX.sdk/"
and patching my /etc/fpc.cfg to include:
#ifdef cpui386
-XR/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/ -Fl/Library/Developer/CommandLineTools/usr/lib/clang/10.0.0 #endif
#ifdef cpux86_64
-XR/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/ -Fl/Library/Developer/CommandLineTools/usr/lib/clang/10.0.0 #endif
both actions were needed for a successful compile...
Is there a better way to make compiles work on Mojave?
Michael
