Hi All, I'm trying to build osquery from source on...
# macos
i
Hi All, I'm trying to build osquery from source on MacOS, but I can't find how to make one package for both architectures (arm, x86). I would be grateful for any hints.
s
While technically CMake can make a build for a single binary with both architectures, we build different pieces depending on the architecture, so you need to do 2 separate builds. You pass the architecture to the CMake configuration phase with
-DCMAKE_OSX_ARCHITECTURES
,
x86_64
or
arm64
then use the
lipo
tool to stitch the two binaries together, with
lipo -create <binary x86_64> <binary arm64> -output <universal binary>
i
thanks a lot!
a
If you meant the actual pkg and not just the binary, there’s a line you’d put in the distribution file that’s fed to pkgbuild which specifies applicable architectures, IIRC. To my ahem let’s go with delight, a vendor that shall rename nameless Duo screwed this up for a solid year after releasing universal binaries, so the installer itself continuously required Rosetta 🤪