Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2018-10

MacOSX Mojave

8 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

C Western

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

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

Reply by email

C Western

I didn't see that thread. I can confirm that
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/ exists on my system

Colin

Michael Ring wrote 60 lines
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:=''; Am 06.10.18 um 16:01 schrieb C Western: > 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 > > 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 > > _______________________________________________ > fpc-pascal maillist  -  > http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply by email

Jonas Maebe
to C Western: Possibly unwisely, I updated by Mac to Mojave. I found that things (including 32 bit…
C Western wrote 10 lines
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

Reply by email

Michael Ring
to Jonas Maebe

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

Jonas Maebe wrote 21 lines
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  -  http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply by email

C Western
to Michael Ring

I meant to mention in my original message that I needed to add

OPT=-Fl/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib

to the end of the make distclean install I use to compile the trunk compiler.

My fpc.cfg also has #ifdef darwin, rather then #ifdef i386.

Colin

Michael Ring wrote 113 lines
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  -  > http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal _______________________________________________ fpc-pascal maillist  -  http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply by email

Jonas Maebe
to Michael Ring: I just realized on a freshly set up computer that there is one more issue, I tried to…
Michael Ring wrote 20 lines
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.

As Colin mentioned, you can pass the necessary options to make via OPT="-option1 -option2"

Show quoted text 6 lines
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

It's because the necessary files for x86-64 can be found in /usr/lib, where the compiler looks by default.

Jonas

Reply by email

Michael Ring
to Jonas Maebe

Until now you could compile trunk without such specific opts, so making OPT= something mandatory for future builds of trunk to work at all does not sound like a good plan to me.

and no, at least in my installation there are no crt1* files in /usr/lib, if there were any we would not have this discussion here ;-)

I am not trying to solve something for myself, my own builds are working for quite a long time on Mojave, just wanted to make sure that compiling trunk keeps as straightforward as ever....

Michael

Jonas Maebe wrote 40 lines
On 08/10/18 23:19, Michael Ring wrote: > 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. As Colin mentioned, you can pass the necessary options to make via OPT="-option1 -option2" > 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 It's because the necessary files for x86-64 can be found in /usr/lib, where the compiler looks by default. Jonas _______________________________________________ fpc-pascal maillist  -  http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply by email

Jonas Maebe
to Michael Ring
Michael Ring wrote
Until now you could compile trunk without such specific opts, so making OPT= something mandatory for future builds of trunk to work at all does not sound like a good plan to me.

I committed a fix that could be merged to 3.0.4 without having to change the compiler, in order to minimise the chances of introducing any bugs in an existing release. Maybe I'll hardcode new paths in the compiler as well, but hardcoding new paths in the compiler every couple of new macOS releases is not a good plan either.

and no, at least in my installation there are no crt1* files in /usr/lib, if there were any we would not have this discussion here ;-)

There indeed are none, that is why for x86-64 there is a -XR/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk option in fpc.cfg. That does not work for i386, because the libraries in that SDK don't contain i386 versions. Only the versions installed as part of the operating systems do (but the crt1.o file for i386 is only there, hence the -Fl statement for that architecture).

Jonas

Reply by email