Recent

Author Topic: Apple Developer Transition Kit  (Read 31425 times)

Jonas Maebe

  • Hero Member
  • *****
  • Posts: 1058
Re: Apple Developer Transition Kit
« Reply #135 on: November 19, 2020, 08:07:20 pm »
What is better:
A. Use a stable Lazarus 2.0.10 with FPC Trunk 3.3.1?
B. Or Lazarus Trunk + FPC Trunk 3.3.1?
You can also use FPC fixes_3_2 (I have merged the macOS/AArch64 support there, except for the inline assembly vector instructions support for now). And you can also use the lazarus fixes_2_0 branch.

For FPC, I would recommend the fixes_3_2 branch. There are several known bugs in peephole optimizations that have been added for AArch64 in trunk, and those do not exist in fixes_3_2. For Lazarus, I can't recommend anything. There is no general "best" combination. It all depends on whether you need any fixes/features that are only available on a particular Lazarus branch. I don't know whether there are any AArch64/macOS 11.0-specific fixes in Lazarus (and/or other fixes that your application depends on), and if so on which branches they are.

Igor Kokarev

  • Sr. Member
  • ****
  • Posts: 370
Re: Apple Developer Transition Kit
« Reply #136 on: November 19, 2020, 08:39:00 pm »
Jonas,

Thanks for the great advices!

I'll try tomorrow to compile/install fpc fixes_3_2 branch on Intel Mac.

And Lazarus 2.0 fixes.
« Last Edit: November 20, 2020, 08:01:51 am by Igor Kokarev »

Igor Kokarev

  • Sr. Member
  • ****
  • Posts: 370
Re: Apple Developer Transition Kit
« Reply #137 on: November 20, 2020, 09:38:06 am »
Jonas,

Can you update wiki "ARM64/AArch64/AppleSilicon Support"?

Xcode now is a stable version "Xcode.app", probably we can remove "Xcode-beta.app" from examples?

And it would be great to add instrusctions for cross-compilation for aarch64 on Intel Mac which you gave me recently.

Jonas Maebe

  • Hero Member
  • *****
  • Posts: 1058
Re: Apple Developer Transition Kit
« Reply #138 on: November 20, 2020, 10:01:13 am »
It's a wiki, you can edit it too! :)

Igor Kokarev

  • Sr. Member
  • ****
  • Posts: 370
Re: Apple Developer Transition Kit
« Reply #139 on: November 20, 2020, 10:43:49 am »
Jonas,

I could compile cross-platform compiler fpc 3.2.0 fixes on Intel Mac. And with existing Lazarus 2.0.10 I can target binary for x86-64 or arm64.

But if I now try to compile Lazarus from sources - 2.0.10 or 2.0 branch fixes I get the following error:

make bigide

Code: Pascal  [Select][+][-]
  1. Compiling carbonbars.pp
  2. carbonbars.pp(16,2) Error: User defined: only cpu i386 is supported
  3. Compiling carbonprivate.pp
  4. Compiling carbondef.pp
  5. carbondef.pp(187,1) Fatal: There were 1 errors compiling module, stopping
  6. Fatal: Compilation aborted
  7. make[3]: *** [../lcl.ppu] Error 1
  8. make[2]: *** [carbon_all] Error 2
  9. make[1]: *** [interfaces] Error 2
  10. make: *** [lcl] Error 2

Jonas Maebe

  • Hero Member
  • *****
  • Posts: 1058

Igor Kokarev

  • Sr. Member
  • ****
  • Posts: 370
Re: Apple Developer Transition Kit
« Reply #141 on: November 20, 2020, 03:54:39 pm »
Jonas,

Thanks! I successfully compiled Lazarus 2.0-fixes now.

I have a strange problem on second Intel Mac with FPC fixes tree (3.2.1).

It was compiled and installed without errors. But I can't use it for aarch64 target. Once I choose aarch64 in Project Options and click OK button, I see an error - /usr/local/bin/fpc doesn't support aarch64 target.
In Preferences of Lazarus I see: /usr/local/bin/fpc
Also /usr/local/bin/fpc has an old file date (May 2020) and shows 3.2.0 version

I have a new file: /usr/local/lib/fpc/3.2.1/ppca64

On first Mac everything works correctly.

I tried to recompile FPC 3.2.1 (fixes tree) with the same result.

I used your instructions:
https://forum.lazarus.freepascal.org/index.php/topic,50476.msg382427.html#msg382427
« Last Edit: November 20, 2020, 05:36:08 pm by Igor Kokarev »

Jonas Maebe

  • Hero Member
  • *****
  • Posts: 1058
Re: Apple Developer Transition Kit
« Reply #142 on: November 21, 2020, 05:29:12 pm »

Igor Kokarev

  • Sr. Member
  • ****
  • Posts: 370
Re: Apple Developer Transition Kit
« Reply #143 on: November 21, 2020, 05:38:43 pm »
Jonas,

Yes, I replaced version number to 3.2.1 (fpc 3.2.0 with fixes).

sudo ln -sf /usr/local/lib/fpc/3.2.1/ppca64 /usr/local/bin

I tried 5 times to recompile FPC and re-download sources again.

When I type "fpc" in Terminal, I see version "3.2.0". Does it correct?

Probably /usr/bin/local/fpc incorrectly calls required version?

On Apple DTK when I type "fpc" I see version "3.2.1".


Jonas Maebe

  • Hero Member
  • *****
  • Posts: 1058
Re: Apple Developer Transition Kit
« Reply #144 on: November 21, 2020, 05:41:09 pm »
Jonas,

Yes, I replaced version number to 3.2.1 (fpc 3.2.0 with fixes).

sudo ln -sf /usr/local/lib/fpc/3.2.1/ppca64 /usr/local/bin

I tried 5 times to recompile FPC and re-download sources again.

When I type "fpc" in Terminal, I see version "3.2.0". Does it correct?
Yes, because the default compiler binary that gets started by "fpc" is the one for the host platform (technically, for the platform for which the "fpc" binary itself was compiled). On an Intel Mac that will be ppcx64, which is version 3.2.0 on your machine. If you use "fpc -Paarch64", you should see 3.2.1 instead (since that will start the AArch64 version of the compiler).

Igor Kokarev

  • Sr. Member
  • ****
  • Posts: 370
Re: Apple Developer Transition Kit
« Reply #145 on: November 21, 2020, 06:28:35 pm »
Yes, on Macbook with Intel I see version "3.2.1" when I type "fpc -Paarch64".
And I can compile project with a target aarch64.

I will check iMac on Monday.

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: Apple Developer Transition Kit
« Reply #146 on: November 23, 2020, 08:11:40 am »
But if I now try to compile Lazarus from sources - 2.0.10 or 2.0 branch fixes I get the following error:

make bigide

carbonbars.pp(16,2) Error: User defined: only cpu i386 is supported

Code: Pascal  [Select][+][-]
  1. make bigide LCL_PLATFORM=cocoa

Igor Kokarev

  • Sr. Member
  • ****
  • Posts: 370
Re: Apple Developer Transition Kit
« Reply #147 on: November 23, 2020, 01:09:02 pm »
Jonas,

I've got this result in Terminal:

Code: Pascal  [Select][+][-]
  1. bash-3.2$ fpc -Paarch64
  2. Free Pascal Compiler version 3.2.1 [2020/11/20] for aarch64

But when I choose target aarch64 in Project Options in Lazarus 2.0.10 (release). I get this error on Intel Mac:

Quote
Compiler "/usr/local/bin/fpc" does not support target aarch64-macos

The same error in Lazarus 2.0.11 fixes.
« Last Edit: November 23, 2020, 02:09:45 pm by Igor Kokarev »

Jonas Maebe

  • Hero Member
  • *****
  • Posts: 1058
Re: Apple Developer Transition Kit
« Reply #148 on: November 23, 2020, 06:51:11 pm »
The correct target is Darwin, not MacOS (which will be renamed to "Classic MacOS" in FPC 3.2.2 to reduce confusion).

Igor Kokarev

  • Sr. Member
  • ****
  • Posts: 370
Re: Apple Developer Transition Kit
« Reply #149 on: November 23, 2020, 08:34:57 pm »
Jonas,

Thanks, I've understood. I'll try tomorrow with target "Darwin" + aarch64 on iMac.

It's a bit strange that first Macbook can compile to aarch64 with target OS "By default" (which works as "darwin").

But another iMac wrongly interprets "By default" as "classic macOS" and cannot compile to darwin-aarch64.

Both Macs with Big Sur 11.0.1, Xcode 12.2, Lazarus 2.0.10 and FPC 3.2.1 (fixes).

Probably some wrong old settings in /etc/fpc.cfg ?

 

TinyPortal © 2005-2018