From 88e07e8bfccb50db37507ab0ad9ac93ed3ab5c68 Mon Sep 17 00:00:00 2001 From: Stefano Bonicatti Date: Mon, 18 Dec 2023 16:28:16 +0100 Subject: [PATCH] macOS --- libraries/cmake/source/zlib/README.md | 42 ++++++++++++++------------- libraries/cmake/source/zlib/src | 2 +- 2 files changed, 23 insertions(+), 21 deletions(-) diff --git a/libraries/cmake/source/zlib/README.md b/libraries/cmake/source/zlib/README.md index 91be226e6eaf..fa554ee58a3f 100644 --- a/libraries/cmake/source/zlib/README.md +++ b/libraries/cmake/source/zlib/README.md @@ -1,33 +1,35 @@ # zlib library build notes -Check that the generated `zconf.h` and the compilation enables the defines that we are hardcoding in the CMakeLists.txt. +Check that the defines we are hardcoding in the CMakeLists.txt corresponds to the ones that are enabled during compilation. +Also verify that if there are preprocessors `#if/#ifdef` checks in `zconf.h` that are modified to `#if 1`, +the respective define checked is also present among the defines we are hardcoding. -## Linux - -### Linux x86_64 +For instance if +``` +#ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */ +# define Z_HAVE_UNISTD_H +#endif +``` -Generated with the following commands: +becomes +``` +#if 1 /* was set to #if 1 by ./configure */ +# define Z_HAVE_UNISTD_H +#endif +``` -```bash -export TOOLCHAIN=/usr/local/osquery-toolchain -export PATH="${TOOLCHAIN}/usr/bin:${PATH}" -export CFLAGS="--sysroot ${TOOLCHAIN}" -export CXXFLAGS="${CFLAGS}" -export CPPFLAGS="${CFLAGS}" -export CC=clang +Add `HAVE_UNISTD_H` in the hardcoded defines. -./configure --static --64 -make -``` +## Linux -### Linux AArch64 +### Linux x86_64/AArch64 Generated with the following commands: ```bash export TOOLCHAIN=/usr/local/osquery-toolchain -export PATH="/usr/local/osquery-toolchain/usr/bin:${PATH}" -export CFLAGS="--sysroot /usr/local/osquery-toolchain" +export PATH="${TOOLCHAIN}/usr/bin:${PATH}" +export CFLAGS="--sysroot ${TOOLCHAIN}" export CXXFLAGS="${CFLAGS}" export CPPFLAGS="${CFLAGS}" export CC=clang @@ -43,14 +45,14 @@ Generated with the following commands: ### macOS ARM (M1, M2, etc.) ```sh -CFLAGS="-isysroot /Applications/Xcode_13.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk -target arm64-apple-macos10.15" ./configure --static --64 +CFLAGS="-isysroot /Applications/Xcode_15.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk -target arm64-apple-macos10.15" ./configure --static --64 make ``` ### macOS x86-64 ```sh -CFLAGS="-isysroot /Applications/Xcode_13.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk -target x86_64-apple-macos10.14" +CFLAGS="-isysroot /Applications/Xcode_15.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk -target x86_64-apple-macos10.15" ./configure --static --64 make ``` diff --git a/libraries/cmake/source/zlib/src b/libraries/cmake/source/zlib/src index 04f42ceca40f..09155eaa2f92 160000 --- a/libraries/cmake/source/zlib/src +++ b/libraries/cmake/source/zlib/src @@ -1 +1 @@ -Subproject commit 04f42ceca40f73e2978b50e93806c2a18c1281fc +Subproject commit 09155eaa2f9270dc4ed1fa13e2b4b2613e6e4851