steven-michaud / HookCase

Tool for reverse engineering macOS/OS X

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

32-bit hook libraries sometimes fail to build on macOS 10.14

steven-michaud opened this issue · comments

Up to the present, all hook libraries included with HookCase are built with 32-bit and 64-bit code combined into a single binary. But sometimes the 32-bit parts of these builds fail on macOS Mojave, usually with error messages about missing include files. The underlying reason for this is that Apple is trying to make it difficult to do any building from the command line. By default, installing XCode, or even its command line tools, doesn't install all the files needed for building from the command line. For example /usr/include is missing.

The standard workaround for this is to install a package that comes with XCode, but gets hidden away in the /Library/Developer/CommandLineTools/Packages directory:

    installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /

Note that you need to do this again with each new version of XCode. For more information see https://apple.stackexchange.com/questions/337940/why-is-usr-include-missing-i-have-xcode-and-command-line-tools-installed-moja.

Apple has of course deprecated 32-bit apps, and will be removing support for them. And, though Apple claims that macOS Mojave still supports 32-bit apps fully, I don't know of any that work there. For example TextWrangler doesn't. So I no longer think there's much point in HookCase continuing to support 32-bit hook libraries on Mojave (and above). I've created a patch to all the hook library Makefiles for HookCase's hook library examples, which removes support for 32-bit builds on Mojave and above. I'm about to land it.

Since my patch works around this issue, I'm going to close it.