Skip to content

Commit

Permalink
workaround for build mtoc in sonoma
Browse files Browse the repository at this point in the history
Signed-off-by: SergeySlice <[email protected]>
  • Loading branch information
SergeySlice committed Dec 8, 2023
1 parent e614deb commit 09a7eef
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Patches/Mtoc/libstuff.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

// HEADER_SEARCH_PATHS includes the local toolchain headers in order to find
// "llvm-c/lto.h"
HEADER_SEARCH_PATHS = ${inherited} ${DT_TOOLCHAIN_DIR}/usr/local/include
HEADER_SEARCH_PATHS = ${inherited} ${TOOLCHAIN_DIR}/usr/local/include

// libstuff currently requires the LTO_SUPPORT macro to be defined in order to
// compile support for LTO. This is built non-conditionally, and can probably
Expand Down
8 changes: 8 additions & 0 deletions buildmtoc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,14 @@ fnCompileMtoc ()
# Mtoc build
local cmd logfile
cd "$CCTOOLS_DIR"

# Replace deprecated DT_TOOLCHAIN_DIR as a workaround for building in Xcode 15
xcodeapp=$(defaults read /Applications/Xcode.app/Contents/version.plist CFBundleShortVersionString)
if [[ $xcodeapp == 15.* ]]; then
sed -i '' 's/DT_TOOLCHAIN_DIR/TOOLCHAIN_DIR/g' "$CCTOOLS_DIR"/xcode/cctools.xcconfig
sed -i '' 's/DT_TOOLCHAIN_DIR/TOOLCHAIN_DIR/g' "$CCTOOLS_DIR"/xcode/libstuff.xcconfig
sed -i '' 's/DT_TOOLCHAIN_DIR/TOOLCHAIN_DIR/g' "$CCTOOLS_DIR"/xcode/strip.xcconfig
fi
# Removal of _structs.h needed as a workaround for a bug in cctools-900 or above
/bin/rm -f ./include/mach/i386/_structs.h
echo "- cctools-${CCTOOLS_VERSION} make mtoc..."
Expand Down

0 comments on commit 09a7eef

Please sign in to comment.