Discussion:
[fpc-devel] [fpc-pascal] MacOSX Mojave
Michael Ring
2018-10-06 14:37:23 UTC
Permalink
A whilke ago I have proposed a fix in fpc-devel in Thread: "MacOS Mojave
beta - crt1.o not installed to /usr/lib"

Using the CommandLineTools directory (and not the XCode directory) makes
it possible to use fpc without the need to have the very huge xcode
installed, I deleted it a while ago and am happy since then.

Can you please check if this path also exists in your installation?


@CoreDevelopers, any change to merge this fix to trunk?


Michael


Index: compiler/systems/t_bsd.pas
===================================================================
--- compiler/systems/t_bsd.pas    (revision 39358)
+++ compiler/systems/t_bsd.pas    (working copy)
@@ -377,7 +377,10 @@
   if startupfile<>'' then
     begin
      if not librarysearchpath.FindFile(startupfile,false,result) then
-       result:='/usr/lib/'+startupfile
+       if sysutils.fileexists('/usr/lib/'+startupfile) then
+         result:='/usr/lib/'+startupfile
+       else if
sysutils.fileexists('/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/'+startupfile)
then
+
result:='/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/'+startupfile

     end
   else
     result:='';
Possibly unwisely, I updated by Mac to Mojave. I found that things
I had to add
-Fl/Applications/Xcode.app/Con
tents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib
to my fpc.cfg to avoid "/usr/lib/crt1.o not found" errors. It seems as
though the startup files are no longer in /usr/lib
The gdb from MacPorts also didn't seem to work. I had some success
using lldb - I notice an alpha package for this can be installed in
lazarus, and this seemed to work, at least on the basic test I did.
Colin
_______________________________________________
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
_______________________________________________
fpc-devel maillist - fpc-***@lists.freepascal.org
http://lists.fre
C Western
2018-10-06 14:47:16 UTC
Permalink
I didn't see that thread. I can confirm that
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/ exists on
my system

Colin
Post by Michael Ring
A whilke ago I have proposed a fix in fpc-devel in Thread: "MacOS
Mojave beta - crt1.o not installed to /usr/lib"
Using the CommandLineTools directory (and not the XCode directory)
makes it possible to use fpc without the need to have the very huge
xcode installed, I deleted it a while ago and am happy since then.
Can you please check if this path also exists in your installation?
@CoreDevelopers, any change to merge this fix to trunk?
Michael
Index: compiler/systems/t_bsd.pas
===================================================================
--- compiler/systems/t_bsd.pas    (revision 39358)
+++ compiler/systems/t_bsd.pas    (working copy)
@@ -377,7 +377,10 @@
   if startupfile<>'' then
     begin
      if not librarysearchpath.FindFile(startupfile,false,result) then
-       result:='/usr/lib/'+startupfile
+       if sysutils.fileexists('/usr/lib/'+startupfile) then
+         result:='/usr/lib/'+startupfile
+       else if
sysutils.fileexists('/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/'+startupfile)
then
+
result:='/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/'+startupfile
     end
   else
     result:='';
Possibly unwisely, I updated by Mac to Mojave. I found that things
I had to add
-Fl/Applications/Xcode.app/Con
tents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib
to my fpc.cfg to avoid "/usr/lib/crt1.o not found" errors. It seems
as though the startup files are no longer in /usr/lib
The gdb from MacPorts also didn't seem to work. I had some success
using lldb - I notice an alpha package for this can be installed in
lazarus, and this seemed to work, at least on the basic test I did.
Colin
_______________________________________________
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
_______________________________________________
fpc-devel maillist - fpc-***@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mail

Loading...