Apple / MacOS / Universal Binary (x86_64 & arm64) build

Description

Hi,

I need help on Mac.
I'm working on MacOS Catalina (10.15.7) with XCode

I'm trying to build a UniversalBinary (x86_64 & arm64) package.
In my project I need icui18n(i18n), icuuc (common) and icudata (data) as dylibs in Release and debug.
Debug should be compiled on my mac target (x86_64 on Intel Mac, arm64 on Silicon Mac)
Release should be compiled as UniversalBinary (both x86_64 and arm64 targets)

On an Intel Mac I can't build the arm64 part
I tryed using XCode 12 Beta 5, XCode 12.2 Beta 3

On the same machine and same XCodes, I succeeded building openSSL, libzip and zlib opensource projects.
For those, I build x86_64 and arm64 targets and then using lipo I can get the UniversalBinary target

Is there a way to build UniversalBinary (x86_64&arm64) i18n, common and data targets on MacIntel ?
If not, is there a way to build arm64 target on x86_64 mac or x86_64 target on Silicon mac ?

Regards

Activity

Show:
Moussa BELLAHCENE
November 3, 2020, 10:37 AM
Edited

Solved

In the makefile I got 4 steps

1 - Unpack in $(ICU_ROOT)

2- $(ICU_ROOT)/configure in $(ICU_ROOT)/build_ub

3- cd $(ICU_ROOT)/build_ub; make

 

I added a step between 2 and 3

Using sed it adds “ -arch x86_64 -arch arm64” to CC=clang and CXX=clang++ in $(ICU_ROOT)/build_ub/icudefs.mk

After that, the step 3 builds the universal binary tools and dylibs.

 

I tryed to export CC and CXX before the configure step but it seems configure overwitted’em.

Notice that the state of art XCode 12 Release can’t build arm64 part on a MacIntel today

On a MacIntel you’ll have to use XCode 12 Beta (tested with 12.2 Beta3)

Regards

Moussa BELLAHCENE
October 29, 2020, 12:04 PM

Hi,

I’m working using XCode 12 Beta 5 for Universal Binary (x86_64 & arm64) on MacOs 10.15.7 (Catalina) on an x86_64 Mac.

Thanks :)

Peter Edberg
October 28, 2020, 6:04 PM

Which version of Xcode are you using?

Assignee

Peter Edberg

Reporter

Moussa BELLAHCENE

Components

Labels

None

Reviewer

None

Priority

major

Time Needed

None

Fix versions