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;