[argyllcms] Re: Patch for Apple Silicon M1 to correctly detect display names and build native

  • From: Simone Karin Lehmann <simone@xxxxxxxxxx>
  • To: argyllcms@xxxxxxxxxxxxx
  • Date: Mon, 15 Feb 2021 15:11:25 +0100



I’ve written some small patches against ArgyllCMS 2.1.2. These will use a 
new API in macOS 10.15
and later, which will allow disown.c to correctly detect the display names. 

thanks for your work.

you’re welcome :-)


And there are some small modifications to smoothly build as native Apple 
Silicon binaries.

You could have saved a little work by starting with the current
source code snapshot in <https://www.argyllcms.com/Argyll_dev_src.zip> :-)


Is there a git repository or any other version control system? That would make 
contributing much easier.

So maybe you can take a look t it and I’d be glad, if you’ll apply the 
patches to ArgyllCMS. 

So I've updated <https://www.argyllcms.com/Argyll_dev_src.zip> with the 
patches
applied, but I've had to make a number of changes and additions to get it
to work on older compile environments and OS X operating systems, so it would
be good if you could test it.

hmm, I didn’t know, that you wanted to support development on such old Xcode 
versions. I will try to build the beta sources with the latest Xcode version on 
Apple Silicon in the next few days. 

Anyway, I had a look at your modifications. IMO the compile time test for SDKs 
= 10.4 and the run time test for localizedName doesn’t make much sense. Why 
should one compile an Intel binary with old Xcode version, link it against old 
SDKs and run that binary through Rosetta 2 on Apple Silicon, when there’s a way 
to compile it as native Apple Silicon binary? 

Any Intel build will work properly with the CF source path on any Intel 
machine. And any native build for Apple Silicon needs an SKD >= 11. And only 
Intel binaries linked against 10.15 will detect the display name, but still run 
under Rosetta. Any other Intel binary will just show '(unknown)‘’ and run under 
Rosetta.

So IMO there should be a compile time test >= 10.15 SDK which also should 
exclude the CF code path, because it will never be used on Apple Silicon.

BTW, your question Rosetta2 on the M1 returns NULL here. Why ??

This is because CGDisplayIOServicePort is no longer available on Apple Silicon 
and therefor dport is always 0

Anyway, thanks for including my patch.

Regards
Simone Karin



Thanks,
      Graeme Gill.


Attachment: smime.p7s
Description: S/MIME cryptographic signature

Other related posts: