diff --git a/deps/capstone2llvmir/deps/llvm/CMakeLists.txt b/deps/capstone2llvmir/deps/llvm/CMakeLists.txt index 7a2ad0c..492056e 100644 --- a/deps/capstone2llvmir/deps/llvm/CMakeLists.txt +++ b/deps/capstone2llvmir/deps/llvm/CMakeLists.txt @@ -206,7 +206,10 @@ if(CMAKE_THREAD_LIBS_INIT) target_link_libraries(llvm INTERFACE optimized ${CMAKE_THREAD_LIBS_INIT}) endif() -if(UNIX) +if(APPLE) + target_link_libraries(llvm INTERFACE debug ${ZLIB_LIBRARIES} curses ) + target_link_libraries(llvm INTERFACE optimized ${ZLIB_LIBRARIES} curses ) +elseif(UNIX) target_link_libraries(llvm INTERFACE debug ${ZLIB_LIBRARIES} rt dl tinfo) target_link_libraries(llvm INTERFACE optimized ${ZLIB_LIBRARIES} rt dl tinfo) endif() diff --git a/deps/fileformat/deps/openssl/CMakeLists.txt b/deps/fileformat/deps/openssl/CMakeLists.txt index afa11d3..ec62f93 100644 --- a/deps/fileformat/deps/openssl/CMakeLists.txt +++ b/deps/fileformat/deps/openssl/CMakeLists.txt @@ -15,6 +15,8 @@ endif() if(WIN32) set(OS_WINDOWS 1) +elseif(APPLE) + set(OS_MACOS 1) elseif(UNIX) set(OS_LINUX 1) else() @@ -27,7 +29,7 @@ if(OS_WINDOWS) else() message(ERROR "Unsupported compiler. Supported: MSVC.") endif() -else(OS_LINUX) +elseif(OS_LINUX) if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") set(COMPILER_GCC 1) elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") @@ -46,6 +48,13 @@ if(OS_WINDOWS) set(OPENSSL_CONFIGURE_ARCH "VC-WIN64A") endif() endif() +elseif(OS_MACOS) + set(OPENSSL_MAKE make -j${CPUS}) + if(ARCH_32BIT) + set(OPENSSL_CONFIGURE_ARCH "darwin-i386-cc") + elseif(ARCH_64BIT) + set(OPENSSL_CONFIGURE_ARCH "darwin64-x86_64-cc") + endif() elseif(OS_LINUX) set(OPENSSL_MAKE make -j${CPUS}) if(ARCH_32BIT) diff --git a/deps/fileformat/include/fileformat/file_format/intel_hex/intel_hex_parser/intel_hex_parser.h b/deps/fileformat/include/fileformat/file_format/intel_hex/intel_hex_parser/intel_hex_parser.h index 1db74fe..2a52c7a 100644 --- a/deps/fileformat/include/fileformat/file_format/intel_hex/intel_hex_parser/intel_hex_parser.h +++ b/deps/fileformat/include/fileformat/file_format/intel_hex/intel_hex_parser/intel_hex_parser.h @@ -31,7 +31,7 @@ class IntelHexSection /// @name Operators /// @{ - bool operator<(IntelHexSection const &a); + bool operator<(IntelHexSection const &a) const; /// @} }; diff --git a/deps/fileformat/src/ar-extractor/archive_wrapper.cpp b/deps/fileformat/src/ar-extractor/archive_wrapper.cpp index 3a654eb..86e2b10 100644 --- a/deps/fileformat/src/ar-extractor/archive_wrapper.cpp +++ b/deps/fileformat/src/ar-extractor/archive_wrapper.cpp @@ -227,7 +227,7 @@ bool ArchiveWrapper::getJsonList( Value object(kObjectType); object.AddMember("name", Value(outName.c_str(), allocator).Move(), allocator); if (numbers) { - object.AddMember("index", counter++, allocator); + object.AddMember("index", (uint64_t)counter++, allocator); } objects.PushBack(object, allocator); } diff --git a/deps/fileformat/src/fileformat/file_format/intel_hex/intel_hex_parser/intel_hex_parser.cpp b/deps/fileformat/src/fileformat/file_format/intel_hex/intel_hex_parser/intel_hex_parser.cpp index 5c73935..12704da 100644 --- a/deps/fileformat/src/fileformat/file_format/intel_hex/intel_hex_parser/intel_hex_parser.cpp +++ b/deps/fileformat/src/fileformat/file_format/intel_hex/intel_hex_parser/intel_hex_parser.cpp @@ -32,7 +32,7 @@ IntelHexSection::~IntelHexSection() /** * operator < */ -bool IntelHexSection::operator<(const IntelHexSection &a) +bool IntelHexSection::operator<(const IntelHexSection &a) const { return address < a.address; } diff --git a/deps/fileformat/src/unpackertool/CMakeLists.txt b/deps/fileformat/src/unpackertool/CMakeLists.txt index 94ce8d5..0c7ba44 100644 --- a/deps/fileformat/src/unpackertool/CMakeLists.txt +++ b/deps/fileformat/src/unpackertool/CMakeLists.txt @@ -16,7 +16,9 @@ if(NOT TARGET unpackertool) # 3. The libraries that are used in plugins under Windows are linked to plugins themselves in plugins/*/CMakeLists.txt # 4. The libraries that are used both by core and plugins need to be linked as whole-archive under Linux, and under Windows like in 1 and 3 simultaneously target_link_libraries(unpackertool cpdetect) - if(UNIX) + if(APPLE) + target_link_libraries(unpackertool -rdynamic -Wl,-force_load tl-cpputils unpacker loader pelib dl) + elseif(UNIX) target_link_libraries(unpackertool -rdynamic -Wl,-whole-archive tl-cpputils unpacker loader pelib -Wl,-no-whole-archive dl) elseif(MSVC) target_link_libraries(unpackertool shlwapi) diff --git a/deps/fileformat/src/unpackertool/plugins/mpress/CMakeLists.txt b/deps/fileformat/src/unpackertool/plugins/mpress/CMakeLists.txt index c90c342..950faa6 100644 --- a/deps/fileformat/src/unpackertool/plugins/mpress/CMakeLists.txt +++ b/deps/fileformat/src/unpackertool/plugins/mpress/CMakeLists.txt @@ -9,6 +9,8 @@ target_include_directories(mpress PUBLIC ${PROJECT_SOURCE_DIR}/src/) # Plugin related libraries are linked to the plugin on Windows if(MSVC) target_link_libraries(mpress unpacker) +elseif(APPLE) + target_link_libraries(mpress unpacker) endif() install(TARGETS mpress LIBRARY DESTINATION bin/unpacker-plugins diff --git a/deps/fileformat/src/unpackertool/plugins/upx/CMakeLists.txt b/deps/fileformat/src/unpackertool/plugins/upx/CMakeLists.txt index f4f34a9..94c5c78 100644 --- a/deps/fileformat/src/unpackertool/plugins/upx/CMakeLists.txt +++ b/deps/fileformat/src/unpackertool/plugins/upx/CMakeLists.txt @@ -21,6 +21,8 @@ target_include_directories(upx PUBLIC ${PROJECT_SOURCE_DIR}/src/) # Plugin related libraries are linked to the plugin on Windows if(MSVC) target_link_libraries(upx tl-cpputils unpacker) +elseif(APPLE) + target_link_libraries(upx tl-cpputils unpacker) endif() install(TARGETS upx LIBRARY DESTINATION bin/unpacker-plugins diff --git a/deps/fnc-patterns/deps/fileformat/deps/openssl/CMakeLists.txt b/deps/fnc-patterns/deps/fileformat/deps/openssl/CMakeLists.txt index afa11d3..ec62f93 100644 --- a/deps/fnc-patterns/deps/fileformat/deps/openssl/CMakeLists.txt +++ b/deps/fnc-patterns/deps/fileformat/deps/openssl/CMakeLists.txt @@ -15,6 +15,8 @@ endif() if(WIN32) set(OS_WINDOWS 1) +elseif(APPLE) + set(OS_MACOS 1) elseif(UNIX) set(OS_LINUX 1) else() @@ -27,7 +29,7 @@ if(OS_WINDOWS) else() message(ERROR "Unsupported compiler. Supported: MSVC.") endif() -else(OS_LINUX) +elseif(OS_LINUX) if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") set(COMPILER_GCC 1) elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") @@ -46,6 +48,13 @@ if(OS_WINDOWS) set(OPENSSL_CONFIGURE_ARCH "VC-WIN64A") endif() endif() +elseif(OS_MACOS) + set(OPENSSL_MAKE make -j${CPUS}) + if(ARCH_32BIT) + set(OPENSSL_CONFIGURE_ARCH "darwin-i386-cc") + elseif(ARCH_64BIT) + set(OPENSSL_CONFIGURE_ARCH "darwin64-x86_64-cc") + endif() elseif(OS_LINUX) set(OPENSSL_MAKE make -j${CPUS}) if(ARCH_32BIT) diff --git a/src/bin2llvmirtool/CMakeLists.txt b/src/bin2llvmirtool/CMakeLists.txt index 77b21d2..7d754fa 100644 --- a/src/bin2llvmirtool/CMakeLists.txt +++ b/src/bin2llvmirtool/CMakeLists.txt @@ -14,6 +14,8 @@ if(MSVC) # its properties, second as path to library to link it as a whole. target_link_libraries(bin2llvmirtool bin2llvmir -WHOLEARCHIVE:$) set_target_properties(bin2llvmirtool PROPERTIES LINK_FLAGS "/FORCE:MULTIPLE") +elseif(APPLE) + target_link_libraries(bin2llvmirtool -Wl,-force_load bin2llvmir ) else() # Linux/MSYS2 target_link_libraries(bin2llvmirtool -Wl,--whole-archive bin2llvmir -Wl,--no-whole-archive) endif() diff --git a/src/llvmir2hlltool/CMakeLists.txt b/src/llvmir2hlltool/CMakeLists.txt index 72468e2..21c554c 100644 --- a/src/llvmir2hlltool/CMakeLists.txt +++ b/src/llvmir2hlltool/CMakeLists.txt @@ -13,6 +13,8 @@ if(MSVC) # state 'llvmir2hll' twice in target_link_libraries(), first as a target to get # its properties, second as path to library to link it as a whole. target_link_libraries(llvmir2hlltool llvmir2hll -WHOLEARCHIVE:$) +elseif(APPLE) # macOS + target_link_libraries(llvmir2hlltool -Wl,-force_load llvmir2hll) else() # Linux/MSYS2 target_link_libraries(llvmir2hlltool -Wl,--whole-archive llvmir2hll -Wl,--no-whole-archive) endif()