Has someone got the ICU extension (dylib) for ARM64 / Apple Silicon?

Over a decade ago I figured out how to add Unicode support to Xojo’s built-in sqlite database:

https://forum.xojo.com/t/has-anyone-built-the-sqlite-icu-extension/20207/14

And Views of a Coder: Xojo SQLite databases: Enabling ICU for full Unicode support and adding custom functions

Now, I need that dylib to also work on arm64 for Apple Silicon Macs, but I can’t figure out how to build it on newer Macs that can build arm64 code. When I build the code on my High Sierra system (which can only build for Intel), the resulting dylib’s x64 code works fine. But if I build the same code on a newer macOS, e.g. Monterey, even if I just build the same x64 without arm64, the dylib does not work when I load it with `SELECT load_extension`. And I can’t figure out why. I even had the AI investigate and it can’t find out what’s wrong.

Has anyone been able to make this work for modern ARM apps on macOS?

I have been using the MBS plugin for a longer time:

IsICULoaded = InternalSQLiteLibraryMBS.LoadICU

I know, but that wasn’t what I asked.

So I finally found the issue when the build on Monterey produced a non-functional sqlite extension: Apple took the liberty to put a define directly into the sqliteext.h file that’s supposed to be passed as an argument to the compiler - and that define disabled the feature I need. My solution is to use a local copy of the file and undo Apple’s unexpected change.

A new version of the dylib with ARM support is now available in the download that’s on my blog post.

1 Like