MacOSX Mojave

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

MacOSX Mojave

C Western-2
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  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: MacOSX Mojave

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

Colin

On 06/10/2018 15:37, Michael Ring wrote:

> 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  -  [hidden email]
>> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: MacOSX Mojave

Jonas Maebe-3
In reply to this post by C Western-2
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  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: MacOSX Mojave

Michael Ring-2
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  -  [hidden email]
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: MacOSX Mojave

C Western-2
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


On 08/10/2018 22: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.
>
>
> 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  -  [hidden email]
>> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
>
> _______________________________________________
> fpc-pascal maillist  -  [hidden email]
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: MacOSX Mojave

Jonas Maebe-3
In reply to this post by Michael Ring-2
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  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: MacOSX Mojave

Michael Ring-2
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

Am 09.10.18 um 19:51 schrieb Jonas Maebe:

> 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  -  [hidden email]
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: MacOSX Mojave

Jonas Maebe-3
On 09/10/18 21:06, 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
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal