[fpc-pascal] MacOSX Mojave

Michael Ring mail at michael-ring.org
Mon Oct 8 23:19:27 CEST 2018


I just realized on a freshly set up computer that there is one more 
issue, I tried to build the trunk x86_64 compiler and compile fails:

/bin/mkdir -p x86_64/units/x86_64-darwin
/Applications/Xcode.app/Contents/Developer/usr/bin/make ./msg2inc
/usr/local/bin/ppcx64 -Ur -Xs -O2 -n -Fux86_64 -Fusystems 
-Fu/Users/ring/devel/fpc/rtl/units/x86_64-darwin -Fix86_64 -FE. 
-FUx86_64/units/x86_64-darwin -dRELEASE    -dx86_64 -dGDB -dBROWSERLOG 
-Fux86 -Sew -FE. utils/msg2inc.pp
ld: file not found: /usr/lib/crt1.10.5.o
An error occurred while linking
msg2inc.pp(822,51) Error: Error while linking
msg2inc.pp(822,51) Fatal: There were 1 errors compiling module, stopping
Fatal: Compilation aborted


problem is that ppcx64 is called with option -n so fpc.cfg gets ignored.


I guess the only way to fix this is to change the makefile itself.


Also, one thing I do not understand in /etc/fpc.cfg installed by the 
3.0.4a installer, why if -Fl ifdef'ed for i386 only?

#ifdef cpui386
-Fl/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib
#endif



Here's the patch for the makefile that worked for me:

Index: compiler/Makefile
===================================================================
--- compiler/Makefile    (revision 39905)
+++ compiler/Makefile    (working copy)
@@ -4248,7 +4248,7 @@
  clean: tempclean execlean cleanall $(addsuffix _clean,$(CPC_TARGET)) 
$(addsuffix _clean,$(TARGET_DIRS))
  distclean: tempclean execlean cleanall $(addsuffix 
_clean,$(ALLTARGETS)) $(addsuffix _distclean,$(TARGET_DIRS))
  $(MSG2INC): $(COMPILER_TARGETDIR) $(COMPILER_UNITTARGETDIR) 
$(COMPILERUTILSDIR)/msg2inc.pp
-    $(COMPILER) -FE. $(COMPILERUTILSDIR)/msg2inc.pp
+    $(COMPILER) -FE. $(COMPILERUTILSDIR)/msg2inc.pp 
-Fl/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib
  msgtxt.inc: $(MSGFILE)
      $(MAKE) $(MSG2INC)
      $(MSG2INC) $(MSGFILE) msg msg
@@ -4328,7 +4328,7 @@
  endif
      $(COMPILER) version.pas
  endif
-    $(COMPILER) pp.pas
+    $(COMPILER) pp.pas 
-Fl/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib
      $(EXECPPAS)
      $(MOVE) $(COMPILER_TARGETDIR)/$(PPEXENAME) $(EXENAME)
  .PHONY: cycle fullcycle wpocycle
Index: compiler/Makefile.fpc
===================================================================
--- compiler/Makefile.fpc    (revision 39905)
+++ compiler/Makefile.fpc    (working copy)
@@ -538,7 +538,7 @@
  #####################################################################

  $(MSG2INC): $(COMPILER_TARGETDIR) $(COMPILER_UNITTARGETDIR) 
$(COMPILERUTILSDIR)/msg2inc.pp
-        $(COMPILER) -FE. $(COMPILERUTILSDIR)/msg2inc.pp
+        $(COMPILER) -FE. $(COMPILERUTILSDIR)/msg2inc.pp 
-Fl/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib

  # The msgtxt.inc only depends on the error?.msg file, not on msg2inc,
  # because that one will be new almost everytime
@@ -641,7 +641,7 @@
  endif
          $(COMPILER) version.pas
  endif
-        $(COMPILER) pp.pas
+        $(COMPILER) pp.pas 
-Fl/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib
          $(EXECPPAS)
          $(MOVE) $(COMPILER_TARGETDIR)/$(PPEXENAME) $(EXENAME)

Michael

Am 07.10.18 um 19:38 schrieb Jonas Maebe:
> On 06/10/18 16:01, C Western wrote:
>> Possibly unwisely, I updated by Mac to Mojave. I found that things 
>> (including 32 bit apps) worked, but:
>>
>> 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
>
> I've created an FPC 3.0.4a release for macOS yesterday that adds the 
> appropriate directives to /etc/fpc.cfg (no changes to the compiler).
>
>
> Jonas
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal



More information about the fpc-pascal mailing list