Recent

Author Topic: FreePascal on macOS 10.14 Mojave doesn't work  (Read 20558 times)

JLucB

  • New member
  • *
  • Posts: 8
FreePascal on macOS 10.14 Mojave doesn't work
« on: September 25, 2018, 09:04:41 am »
Freepascal don't work on macOS 10.14. While compiling I get this error :"ld: file not found: /usr/lib/crt1.o".
I know it usually means that command line tools are not install, but I do install them...
I've tried to re-install FreePascal, but the installer won't let me as it consider that command line tools aren't already installed...
Seems like both the compiler and the installer are looking for command line tools to be install in "/usr/lib" but with macOS 10.14 Mojave they are in "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib".

I've tried to create a link in /usr/lib with "sudo ln -f -s /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/crt1.o /usr/lib" but even with root privileges it won't let me... "ln: /usr/lib/crt1.o: Operation not permitted".

Doest any one know a workaround or does an updated version of FreePascal ready for macOS 10.14 will be available soon?

Many thanks in advance!!!

Bart

  • Hero Member
  • *****
  • Posts: 5275
    • Bart en Mariska's Webstek
Re: FreePascal on macOS 10.14 Mojave doesn't work
« Reply #1 on: September 25, 2018, 10:29:39 am »
Try -Flpath/to/lib when compiling.
If that works, put it in your fpc.cfg

W.r.t. to crt1.o: does this link help?

Bart

JLucB

  • New member
  • *
  • Posts: 8
Re: FreePascal on macOS 10.14 Mojave doesn't work
« Reply #2 on: September 25, 2018, 11:11:09 am »
Try -Flpath/to/lib when compiling.
If that works, put it in your fpc.cfg
When compiling I just type in the terminal "fpc -B -gl myFile.pas", I'm not sure to understand your point.

W.r.t. to crt1.o: does this link help?
I've already install command line tools using "xcode-select --install"

Jonas Maebe

  • Hero Member
  • *****
  • Posts: 1058
Re: FreePascal on macOS 10.14 Mojave doesn't work
« Reply #3 on: September 25, 2018, 11:30:14 am »
If FPC is already installed, you should be able to compile by adding -XR/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk (either on the command line, or to your configuration file)

The installer check will need to be updated.

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1739
Re: FreePascal on macOS 10.14 Mojave doesn't work
« Reply #4 on: September 25, 2018, 11:42:46 am »
Dunno if it might help, but try to add -WM10.14 to the commandline.

JLucB

  • New member
  • *
  • Posts: 8
Re: FreePascal on macOS 10.14 Mojave doesn't work
« Reply #5 on: September 25, 2018, 12:07:43 pm »
If FPC is already installed, you should be able to compile by adding -XR/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk (either on the command line, or to your configuration file)

The installer check will need to be updated.

Thanks for the answer.
Adding "-XR/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk", helps... but seems like I'm using "Free Pascal Compiler version 3.0.2 [2017/02/12] for i386" (and cannot install the newer compiler since the install cannot detect the new folder use for the command line tools...). Since macOS 10.14 is 64bits only I get this error : "The i386 architecture is deprecated for macOS (remove from the Xcode build setting: ARCHS)"

JLucB

  • New member
  • *
  • Posts: 8
Re: FreePascal on macOS 10.14 Mojave doesn't work
« Reply #6 on: September 25, 2018, 12:13:58 pm »
Dunno if it might help, but try to add -WM10.14 to the commandline.

It works ! Thanks !

I can compile... but for the time being I cannot update the compiler... But at least I can compile and do my daily work, while waiting for the new FreePascal version compatible with macOS 10.14 to be released...

Thanks for your help!
« Last Edit: September 25, 2018, 12:15:36 pm by JLucB »

Jonas Maebe

  • Hero Member
  • *****
  • Posts: 1058
Re: FreePascal on macOS 10.14 Mojave doesn't work
« Reply #7 on: September 25, 2018, 12:58:41 pm »
Adding "-XR/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk", helps... but seems like I'm using "Free Pascal Compiler version 3.0.2 [2017/02/12] for i386" (and cannot install the newer compiler since the install cannot detect the new folder use for the command line tools...). Since macOS 10.14 is 64bits only I get this error : "The i386 architecture is deprecated for macOS (remove from the Xcode build setting: ARCHS)"

macOS 10.14 is still fully 32 and 64 bit. If it weren't, it would not be able to run FPC 3.0.2 binaries. Support for 32 bit binaries will only be removed in macOS 10.15.

Hansaplast

  • Hero Member
  • *****
  • Posts: 674
  • Tweaking4All.com
    • Tweaking4All
Re: FreePascal on macOS 10.14 Mojave doesn't work
« Reply #8 on: September 25, 2018, 01:57:16 pm »
Woops, I just posted an issue with compiling the Lazarus IDE.


Probably more like a temporary fix, I re-installed the XCode command-line tools for macOS 10.13, which resolved the issue (for now). It's probably not a great fix, but at least I can work again.


UPDATE: This is probably a bad solution - all kinds of controls (mostly listboxes and grids) no longer respond to moving the scrollbar. I'm not 100% sure, but I suspect the "out of sync" warnings were not for nothing ...
« Last Edit: September 25, 2018, 05:36:50 pm by Hansaplast »

Frank

  • Jr. Member
  • **
  • Posts: 69
Re: FreePascal on macOS 10.14 Mojave doesn't work
« Reply #9 on: September 27, 2018, 10:56:46 pm »
Hi All,

I have been able to compile 32bit/carbon & 64bit/cocoa from SVN on Mojave.
This assumes you have upgraded to Xcode 10 / Mojave.

1/ download install Command_Line_Tools_macOS_10.13_for_Xcode_9.4.dmg
2/ copy & rename /Library/Developer/ComandLineTools to /Library/Developer/ComandLineTools-10.13
3/ download/install Command_Line_Tools_macOS_10.14_for_Xcode_10.dmg
4/ edit/add to /etc/fpc.cfg :

#ifdef cpui386
-XR/Library/Developer/CommandLineTools-10.13/SDKs/MacOSX.sdk/
-Fl/Library/Developer/CommandLineTools-10.13/usr/lib/clang/9.1.0
#endif
#ifdef cpux86_64
-XR/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/
-Fl/Library/Developer/CommandLineTools/usr/lib/clang/10.0.0
#endif

note1: Thanks to all before me who posted their findings, one builds on the efforts of others.
note2: I have yet to get gdb operational yet with Mojave/Xcode 10 (it worked fine with Xcode 9.4).

Frank



 

Hansaplast

  • Hero Member
  • *****
  • Posts: 674
  • Tweaking4All.com
    • Tweaking4All
Re: FreePascal on macOS 10.14 Mojave doesn't work
« Reply #10 on: September 28, 2018, 10:05:58 am »
Good to hear that!
For debugging my previously installed GDB kind-a still works, but I decided to start using LLDB.
There is a package (lazdebuggerfplldb.lpk - the one with the "f" in it) that enables that for you.
At the moment neither GDB nor LLDB is perfect, but LLDB does what I need it to do so far.


Are you running the IDE in Cocoa? If yes; is the Object Inspector working OK for you?
I'm having some serious problems with the Object Inspector - tried it on 2 Mac's and a clean VM (Parallels Lite - it's free in the Apple app store and can run Linux and Mac VM's). All show the same issues in Mojave but not in High Sierra (all tested with Cocoa).
See also bug reports 34335 and 34336.

Frank

  • Jr. Member
  • **
  • Posts: 69
Re: FreePascal on macOS 10.14 Mojave doesn't work
« Reply #11 on: September 28, 2018, 08:41:32 pm »
@Hansaplast : Thanks ! I've installed "lazdebuggerfplldb.lpk" & am starting to use it. Mind you it took me by surprise, in my previous post I have been using a script to compile both 32bit carbon / 64bit cocoa & I found I had to delete both the svn folder AND my Lazarus config for 32bit/carbon to get Lazarus to re-compile itself !

My Cocoa IDE was several months old ( I've not been able to work on it until now...) & then it wasn't that bad (but not as good as the carbon/windows version). I've now updated my svn for Cocoa. I tried to compile my Cocoa Application & found it would not compile, it seems there has been alot of changes in the Cocoa interface in the last few months ( I made use of some more direct calls based on the cocoa widgetset). As I familiarize myself more with the cocoa IDE, if I see any (repeatable) bugs, I'll post to the BugTracker.

Frank

Frank

  • Jr. Member
  • **
  • Posts: 69
Re: FreePascal on macOS 10.14 Mojave doesn't work
« Reply #12 on: September 28, 2018, 11:12:57 pm »
@Hansaplast : The object inspector in Mojave (svn 59174), is acting strangely...
                      Component selection is all over the place...
                      Haven't discovered root component yet thought...

Hansaplast

  • Hero Member
  • *****
  • Posts: 674
  • Tweaking4All.com
    • Tweaking4All
Re: FreePascal on macOS 10.14 Mojave doesn't work
« Reply #13 on: September 29, 2018, 11:35:35 am »

I just updated to SVN r59179 (on Mojave, Lazarus 2.1.0 r59179 FPC 3.0.4 x86_64-darwin-cocoa (alpha)).
(with "-XR/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk" in fpc.cfg)
Object Inspector still unusable and placing controls is also all over the place.


Compiling the same SVN version under High Sierra (on a Virtual Machine, in Parallels Lite) results in a stable IDE and compiled applications work as expected.


I'll try again on a completely clean Mojave VM this weekend.

Hansaplast

  • Hero Member
  • *****
  • Posts: 674
  • Tweaking4All.com
    • Tweaking4All
Re: FreePascal on macOS 10.14 Mojave doesn't work
« Reply #14 on: September 30, 2018, 10:43:31 am »
For some reason I cannot get FPC to install on a clean Mojave (with XCode and XCode commandline tools installed).
Any suggestions are most welcome.
Seems FPC (3.0.4) does not recognize XCode Commandline tools anymore.


Steps I followed (in a Virtual Machine):


1) Install clean Mojave (10.14 release, not a beta version)
2) Install XCode (works)
3) Install XCode Commandline Tools (xcode-select --install)
4) Created test app in XCode - compiled and ran just fine
5) Checked if "ld", "lldb" and "make" exist, they do (not sure what else to check for)
6) Download and install FPC (failed install, commandline tools not detected)

 

TinyPortal © 2005-2018