Recent

Author Topic: Apple leaving Intel for ARM - how will it affect Lazarus/FPC/Cocoa?  (Read 17324 times)

Jonas Maebe

  • Hero Member
  • *****
  • Posts: 1058
Re: Apple leaving Intel for ARM - how will it affect Lazarus/FPC/Cocoa?
« Reply #60 on: July 21, 2020, 04:33:04 pm »
Do you know a way to check an executable file (my or others) for a target version? x86 or ARM?
Run the "file" command on it.

Igor Kokarev

  • Sr. Member
  • ****
  • Posts: 370
Re: Apple leaving Intel for ARM - how will it affect Lazarus/FPC/Cocoa?
« Reply #61 on: July 21, 2020, 08:40:30 pm »
Do you know a way to check an executable file (my or others) for a target version? x86 or ARM?
Run the "file" command on it.
Works fine. Shows "arm64" for my created test project in Lazarus. Thanks.

Dan3468298

  • Full Member
  • ***
  • Posts: 131
Re: Apple leaving Intel for ARM - how will it affect Lazarus/FPC/Cocoa?
« Reply #62 on: July 24, 2020, 11:50:14 pm »
In theory, shouldn't it be much easier to port Lazarus Cocoa/LCL to iPhone and iPad?  And then an emulator for those too would be easier to test code on a Mac?
MacOS 10.15.5/Lazarus 2.0.10 Build 2020-07-07

ChrisR

  • Full Member
  • ***
  • Posts: 247
Re: Apple leaving Intel for ARM - how will it affect Lazarus/FPC/Cocoa?
« Reply #63 on: July 25, 2020, 01:48:12 pm »
Dan3468298 MacOS and iOS have different controls (https://www.raywenderlich.com/759-macos-controls-tutorial-part-1-2). For example, MacOS uses NSButton, NSTextField, etc while iOS uses UIButton, UITextField, etc each tuned for their mode of interaction (mouse/keyboard vs touch). While tools like Catalyst aid the porting of iOS apps to MacOS, going the other way would be a challenge. Historically, one uses an x86-64 Mac to build executables to ARM-based iOS devices, using Xcode or Lazarus (https://wiki.lazarus.freepascal.org/iPhone/iPod_development). I think it would be hard to compile Arm-Mac tools on an iPAD as it does not have the sdk. I think it would be hard to port the Lazarus IDE to iOS as the user interface would not translate over.

I do think that one can create an FPC compiler for x86-64 that emits Aarch64 code. This would allow an x86-64 user to generate both x86-64 and Aarch64 executables that you could lips into a single executable to target either platform. Likewise, a Aarch64 user can create a compiler that emits x86-64 and create universal binaries.

For my tools, the current FPC and Lazarus support Aarch64 just fine. The only issues I had were hand-built assembly that leveraged x86-64 specific routines (e.g. SSE2). Beyond those unusual (and expected) challenges, support of this new architecture seems pretty seamless.

Igor Kokarev

  • Sr. Member
  • ****
  • Posts: 370
Re: Apple leaving Intel for ARM - how will it affect Lazarus/FPC/Cocoa?
« Reply #64 on: August 03, 2020, 02:43:35 pm »
Jonas,

Do you plan to include AARCH64 for Darwin in FPC 3.2.x brunch?

Trunk version works very well on ARM.

Jonas Maebe

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

Igor Kokarev

  • Sr. Member
  • ****
  • Posts: 370
Re: Apple leaving Intel for ARM - how will it affect Lazarus/FPC/Cocoa?
« Reply #66 on: August 05, 2020, 09:28:04 am »
Jonas,

Thanks

 

TinyPortal © 2005-2018