Are there current slimmers to remove ARM code from new Fat binaries?

It’ll be interesting to see what happens when you try to apply an update to the app. Could you follow up here with that info, please?

1 Like

I did one better – I asked an expert, Howard Oakley,¹ who has written extensively about app signatures and related issues.

I posed this question:

If one ‘thins’ a fat binary, that will break the signature of the app, which we can bypass by removing the quarantine flag. However, I assume (but don’t know for sure) that may prevent the Mac App Store and/or Sparkle from updating the app properly. Do you know?

and he replied:

https://twitter.com/howardnoakley/status/1330286138196680705


¹ Howard’s site https://eclecticlight.co and more specifically https://eclecticlight.co/category/macs/ is, IMO, required reading for anyone wanting power-user level information about Macs.

1 Like

That’s my concern with Rosetta: If it is the notional 20s on first launch of an updated app that’s going to get old very fast.

Ah! DLLs. Of course! Putting these in the app bundle eliminates the Window’s problem of DLL Hell, but now I wonder how much wasted space there is from having identical DLLs in multiple app bundles? Luckily disk space is cheap, at least until you run out. Also it is interesting that while almost all the x86_64 DLLs are shared, most all those for arm64 are not. Assuming the shared libraries actually are shared, this could mean a RAM usage hit for Apple Silicon Macs.

Apologies for the late response, I’ve been away from my Mac…

If I am interpreting this correctly:

% ls -l /Applications/Pages.app/Contents/Frameworks 
total 0
drwxr-xr-x  15 root  wheel  480 Nov  4 10:54 ./
drwxr-xr-x  12 root  wheel  384 Nov 18 09:53 ../
drwxr-xr-x   5 root  wheel  160 Nov 18 09:53 EquationKit.framework/
drwxr-xr-x   5 root  wheel  160 Nov 18 09:53 TSAccessibility.framework/
drwxr-xr-x   5 root  wheel  160 Nov 18 09:53 TSApplication.framework/
drwxr-xr-x   5 root  wheel  160 Nov 18 09:53 TSCalculationEngine.framework/
drwxr-xr-x   5 root  wheel  160 Nov 18 09:53 TSCharts.framework/
drwxr-xr-x   5 root  wheel  160 Nov 18 09:53 TSCoreSOS.framework/
drwxr-xr-x   5 root  wheel  160 Nov 18 09:53 TSDrawables.framework/
drwxr-xr-x   5 root  wheel  160 Nov 18 09:53 TSKit.framework/
drwxr-xr-x   5 root  wheel  160 Nov 18 09:53 TSPersistence.framework/
drwxr-xr-x   5 root  wheel  160 Nov 18 09:53 TSStyles.framework/
drwxr-xr-x   5 root  wheel  160 Nov 18 09:53 TSTables.framework/
drwxr-xr-x   5 root  wheel  160 Nov 18 09:53 TSText.framework/
drwxr-xr-x   5 root  wheel  160 Nov 18 09:53 TSUtility.framework/

then the frameworks are all links, thus there is no duplication of DLL’s.

1 Like

In Unix parlance, the lowercase D at the start of drwxr-xr-x indicates that something is a directory, not a link.

If it was a link, the first character would be a lowercase L.

The link count of a directory is the number of items in the directory. For instance if we look at the first one, EquationKit.framework, we see:

% ls -a EquationKit.framework 
.		..		EquationKit	Resources	Versions
%

Namely the five items, three contained folders, self, and parent folders.

I don’t know if hard links to folders are allowed in macOS other than TimeMachine backups. They aren’t allowed in Unix. We can see that two different EquationKits are different by looking at their inodes, which are not the same:

% ls -di /Applications/Pages.app/Contents/Frameworks/EquationKit.framework

12219421 /Applications/Pages.app/Contents/Frameworks/EquationKit.framework

% ls -di /Applications/Numbers.app/Contents/Frameworks/EquationKit.framework

12315283 /Applications/Numbers.app/Contents/Frameworks/EquationKit.framework

 %

For a symbolic link, yes. For a hard link, no.

However, @tomalmy is correct when he says

So I was, in fact, misinterpreting the directory listing.

2 Likes

It’s a moot point now but directory hard links are allowed in macOS on HFS+ volumes. The installed version of “ln” won’t do it, though; you have to use the GNU version. This still works in Catalina.

In the following example, /Volumes/HFS_Plus_Volume/dir2/subdir2 is a link of /Volumes/HFS_Plus_Volume/dir1/subdir1; they have the same inode (129).

% ls -lRi /Volumes/HFS_Plus_Volume/dir1 /Volumes/HFS_Plus_Volume/dir2
/Volumes/HFS_Plus_Volume/dir1:
total 0
128 drwxr-xr-x 3 Jim staff 102 Dec 12 16:02 ./
2 drwxrwxr-x 8 Jim staff 340 Dec 12 16:02 …/
129 drwxr-xr-x 3 Jim staff 102 Dec 12 16:06 subdir1/
 
/Volumes/HFS_Plus_Volume/dir1/subdir1:
total 0
129 drwxr-xr-x 3 Jim staff 102 Dec 12 16:06 ./
128 drwxr-xr-x 3 Jim staff 102 Dec 12 16:02 …/
136 -rw-r–r-- 1 Jim staff 0 Dec 12 16:06 foo
 
/Volumes/HFS_Plus_Volume/dir2:
total 0
130 drwxr-xr-x 3 Jim staff 102 Dec 12 16:05 ./
2 drwxrwxr-x 8 Jim staff 340 Dec 12 16:02 …/
129 drwxr-xr-x 3 Jim staff 102 Dec 12 16:06 subdir2/
 
/Volumes/HFS_Plus_Volume/dir2/subdir2:
total 0
129 drwxr-xr-x 3 Jim staff 102 Dec 12 16:06 ./
130 drwxr-xr-x 3 Jim staff 102 Dec 12 16:05 …/
136 -rw-r–r-- 1 Jim staff 0 Dec 12 16:06 foo

2 Likes