TLDRWhat one should do to realease 32 bit "universal" binaries and 64 bit "universal" binaries?
BackgroundApple has completely dropped all 32 bit support from macOS 10.15 Catalina (released in October 2019).
Apple has already discontinued production of Intel-based Macs, and the company has stated that it plans to transition its entire Mac lineup to its own custom silicon chips.
Universal 2 binariesTo create an Universal 2 binary with support for both Intel x86_x64 and M1 arm64 architectures, you need to compile your code separately for each architecture, and then use the "lipo" command to create a single binary that includes both versions. ChatGPT may tell you:
Here are the steps to follow:
1. Open your Lazarus project in the Lazarus IDE.
2. Click on "Project" in the menu bar, and then click on "Compiler Options".
3. In the Compiler Options dialog box, click on the "Target OS" drop-down menu and select "Darwin".
4. In the "Target CPU" drop-down menu, select "x86_64" for 64-bit support.
5. Click on "Configure Build Lazarus" in the "Build Modes" tab, and select "Release" as the build mode.
6. In the "Path Settings" tab, make sure that the "FPC Source Directory" and "FPC Binary Directory" are set to the correct paths.
7. Click on "OK" to save the changes.
8. Click on "Project" in the menu bar, and then click on "Clean All".
9. Click on "Project" again, and then click on "Build".
10. Once the build process is complete, your Intel binary should be located in the directory of your Lazarus project.
11. Now, repeat steps 3-10, but this time select "arm64" in the "Target CPU" drop-down menu.
12. Once the build process is complete, your M1 binary should be located in the directory of your Lazarus project.
13. Open a Terminal window and navigate to the directory containing the two binaries.
14. Use the "lipo" command to create the Universal 2 binary:
lipo -create -output universal_binary intel_binary arm_binary
This will create a single binary file named "universal_binary" that contains both the Intel and M1 versions of your application.
Note that you may need to adjust your project's source code to ensure that it is compatible with both architectures. Additionally, you should test the Universal 2 binary on both Intel and M1 hardware to ensure that it works correctly on both platforms.
Right now, I am successfully creating MyApp.app bundles with Intel-M1-Cocoa "universal" binaries (althoug no "universal" label is shown in the file type column", I am missing something?)
Ok, but what about old 32bit machines? The "universal binary" wikipedia page mentions that people were building different sorts of universal binaries. What is the best approach for 32 bit machines? Creating a i386-Carbon with some sort of backward compatibility?
Also, is it possible to extend backward compatibility with Carbon to "MacOSX"?
Resourceshttps://wiki.freepascal.org/Installing_Lazarus_on_macOShttps://en.wikipedia.org/wiki/Universal_binaryhttps://en.wikipedia.org/wiki/MacOS_version_history