Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create a "Universal Binary" from two apps?

Short question: How do you take two apps, one for intel and the other ppc, and package them into one Universal Binary?

My current thoughts on this problem:

I have read though the apple developer documentation on universal binaries and haven't been able to find an answer so it may not be possible.

Due to reasons I won't go into here I have two apps of my program (apposed to using xtools to compile the binary universally once), one for Intel Macs and the other for Mac >=10.3.9 running on PPC. Sharing resources is a non-issue.

I could put both MyProg_intel.app and MyProg_ppc.app into one zip and distribute it that way; but that may result in confusion for many people who I will be distributing my program to.

like image 634
marshallpenguin Avatar asked Aug 19 '09 14:08

marshallpenguin


People also ask

Does Apple use binary code?

A universal binary runs natively on both Apple silicon and Intel-based Mac computers, because it contains executable code for both architectures.

What is the difference between Apple silicon and universal?

An "Apple Silicon" application will only contain code built for AArch64, an "Intel" one will only run under x86_64, and a "Universal" app will contain code for both of them. As you see, both Firefox and the system-provided ls have both been built and shipped as fat binaries.

What is Apple universal binary?

A universal binary looks no different than a regular app, but its executable file contains two versions of your compiled code. One version runs natively on Apple silicon, and the other runs natively on Intel-based Mac computers. At runtime, the system automatically chooses which version to run on the current platform.

What is Apple catalyst?

Mac Catalyst is the technology that lets you bring your existing iOS applications to macOS, allowing them to take full advantage of the Mac's larger display, integrated keyboard, and mouse or trackpad.


1 Answers

See the lipo tool. It will let you stitch together your PPC and i386 binaries.

Also, sometimes separate targets for different architectures can be avoided by using conditional build settings in Xcode. This is useful if you need to link against a different binary library for each architecture, for example.

like image 166
amrox Avatar answered Sep 21 '22 01:09

amrox