diff --git a/build.sh b/build.sh index 2c2f96e..ee19338 100755 --- a/build.sh +++ b/build.sh @@ -194,6 +194,9 @@ if [ $PLATFORM == "OpenBSD" ] || [ $PLATFORM == "DragonFly" ]; then patch -p0 < $PATCH_DIR/cctools-ld64-epath.patch popd &>/dev/null fi +if [ $LINKER_VERSION == "134.9" ]; then + patch -p1 < $PATCH_DIR/cctools-ld64-134.9-old-compiler.patch +fi echo "" CONFFLAGS="--prefix=$TARGET_DIR --target=x86_64-apple-$TARGET" [ -n "$DISABLE_LTO_SUPPORT" ] && CONFFLAGS+=" --enable-lto=no" diff --git a/patches/cctools-ld64-134.9-old-compiler.patch b/patches/cctools-ld64-134.9-old-compiler.patch new file mode 100644 index 0000000..fa6925a --- /dev/null +++ b/patches/cctools-ld64-134.9-old-compiler.patch @@ -0,0 +1,29 @@ +diff --git cctools/ld64/src/ld/code-sign-blobs/memutils.h cctools/ld64/src/ld/code-sign-blobs/memutils.h +index b0421f0..30514d3 100644 +--- cctools/ld64/src/ld/code-sign-blobs/memutils.h ++++ cctools/ld64/src/ld/code-sign-blobs/memutils.h +@@ -34,6 +34,7 @@ + #include + + #ifdef __GLIBCXX__ ++#include + using namespace __gnu_cxx; + #endif + +diff --git cctools/ld64/src/ld/parsers/macho_relocatable_file.cpp cctools/ld64/src/ld/parsers/macho_relocatable_file.cpp +index 37cd0f2..e63d1ef 100644 +--- cctools/ld64/src/ld/parsers/macho_relocatable_file.cpp ++++ cctools/ld64/src/ld/parsers/macho_relocatable_file.cpp +@@ -1499,6 +1499,12 @@ ld::relocatable::File* Parser::parse(const ParserOptions& opts) + uint32_t countOfCFIs = 0; + if ( _EHFrameSection != NULL ) + countOfCFIs = _EHFrameSection->cfiCount(); ++#ifdef __clang__ ++ // Workaround to get rid of the following clang <= 3.4 error: ++ // macho_relocatable_file.cpp:1506:49: error: variable length array of non-POD element type 'typename CFISection::CFI_Atom_Info' (aka 'CFI_Atom_Info::OAS>') ++ // Don't ask me why this fixes the error. ++ typename CFISection::CFI_Atom_Info __clang_workaround[2]; ++#endif + typename CFISection::CFI_Atom_Info cfiArray[countOfCFIs]; + // stack allocate (if not too large) a copy of __eh_frame to apply relocations to + uint8_t* ehBuffer = NULL;