diff --git a/devel/zydis/Makefile b/devel/zydis/Makefile index cec11579fbad5..044319d5b8cc0 100644 --- a/devel/zydis/Makefile +++ b/devel/zydis/Makefile @@ -10,11 +10,12 @@ WWW= https://zydis.re LICENSE= MIT LICENSE_FILE= ${WRKSRC}/LICENSE -ONLY_FOR_ARCHS= aarch64 amd64 armv6 armv7 i386 +ONLY_FOR_ARCHS= aarch64 amd64 armv6 armv7 i386 powerpc powerpc64 ONLY_FOR_ARCHS_REASON= see definitions in include/Zycore/Defines.h -USES= cmake cpe localbase:ldflags +USES= cmake cpe dos2unix localbase:ldflags USE_GITHUB= yes +DOS2UNIX_FILES= src/String.c GH_ACCOUNT= zyantific GH_TUPLE= zyantific:zycore-c:273e26a:zydis/dependencies/zycore CPE_VENDOR= zyantific diff --git a/devel/zydis/files/patch-dependencies_zycore_include_Zycore_Defines.h b/devel/zydis/files/patch-dependencies_zycore_include_Zycore_Defines.h new file mode 100644 index 0000000000000..82cd1dcc20513 --- /dev/null +++ b/devel/zydis/files/patch-dependencies_zycore_include_Zycore_Defines.h @@ -0,0 +1,13 @@ +--- dependencies/zycore/include/Zycore/Defines.h.orig 2022-09-29 22:15:50 UTC ++++ dependencies/zycore/include/Zycore/Defines.h +@@ -131,6 +131,10 @@ + # define ZYAN_AARCH64 + #elif defined(_M_ARM) || defined(_M_ARMT) || defined(__arm__) || defined(__thumb__) + # define ZYAN_ARM ++#elif defined(__powerpc64__) ++# define ZYAN_PPC64 ++#elif defined(__powerpc__) ++# define ZYAN_PPC + #elif defined(__EMSCRIPTEN__) + // Nothing to do, `ZYAN_EMSCRIPTEN` is both platform and arch macro for this one. + #else diff --git a/devel/zydis/files/patch-dependencies_zycore_src_Format.c b/devel/zydis/files/patch-dependencies_zycore_src_Format.c new file mode 100644 index 0000000000000..c207378cc1a2c --- /dev/null +++ b/devel/zydis/files/patch-dependencies_zycore_src_Format.c @@ -0,0 +1,38 @@ +--- dependencies/zycore/src/Format.c.orig 2022-09-29 22:16:44 UTC ++++ dependencies/zycore/src/Format.c +@@ -83,7 +83,7 @@ static const ZyanStringView STR_SUB = ZYAN_DEFINE_STRI + /* Decimal */ + /* ---------------------------------------------------------------------------------------------- */ + +-#if defined(ZYAN_X86) || defined(ZYAN_ARM) || defined(ZYAN_EMSCRIPTEN) ++#if defined(ZYAN_X86) || defined(ZYAN_ARM) || defined(ZYAN_EMSCRIPTEN) || defined(ZYAN_PPC) + ZyanStatus ZyanStringAppendDecU32(ZyanString* string, ZyanU32 value, ZyanU8 padding_length) + { + if (!string) +@@ -179,7 +179,7 @@ ZyanStatus ZyanStringAppendDecU64(ZyanString* string, + /* Hexadecimal */ + /* ---------------------------------------------------------------------------------------------- */ + +-#if defined(ZYAN_X86) || defined(ZYAN_ARM) || defined(ZYAN_EMSCRIPTEN) ++#if defined(ZYAN_X86) || defined(ZYAN_ARM) || defined(ZYAN_EMSCRIPTEN) || defined(ZYAN_PPC) + ZyanStatus ZyanStringAppendHexU32(ZyanString* string, ZyanU32 value, ZyanU8 padding_length, + ZyanBool uppercase) + { +@@ -423,7 +423,7 @@ ZyanStatus ZyanStringAppendFormat(ZyanString* string, + + ZyanStatus ZyanStringAppendDecU(ZyanString* string, ZyanU64 value, ZyanU8 padding_length) + { +-#if defined(ZYAN_X64) || defined(ZYAN_AARCH64) ++#if defined(ZYAN_X64) || defined(ZYAN_AARCH64) || defined(ZYAN_PPC64) + return ZyanStringAppendDecU64(string, value, padding_length); + #else + // Working with 64-bit values is slow on non 64-bit systems +@@ -464,7 +464,7 @@ ZyanStatus ZyanStringAppendDecS(ZyanString* string, Zy + ZyanStatus ZyanStringAppendHexU(ZyanString* string, ZyanU64 value, ZyanU8 padding_length, + ZyanBool uppercase) + { +-#if defined(ZYAN_X64) || defined(ZYAN_AARCH64) ++#if defined(ZYAN_X64) || defined(ZYAN_AARCH64) || defined(ZYAN_PPC64) + return ZyanStringAppendHexU64(string, value, padding_length, uppercase); + #else + // Working with 64-bit values is slow on non 64-bit systems diff --git a/devel/zydis/files/patch-src_String.c b/devel/zydis/files/patch-src_String.c new file mode 100644 index 0000000000000..70044c976829c --- /dev/null +++ b/devel/zydis/files/patch-src_String.c @@ -0,0 +1,38 @@ +--- src/String.c.orig 2022-09-29 22:19:15 UTC ++++ src/String.c +@@ -65,7 +65,7 @@ static const char* const DECIMAL_LOOKUP = + /* Decimal */ + /* ---------------------------------------------------------------------------------------------- */ + +-#if defined(ZYAN_X86) || defined(ZYAN_ARM) || defined(ZYAN_EMSCRIPTEN) ++#if defined(ZYAN_X86) || defined(ZYAN_ARM) || defined(ZYAN_EMSCRIPTEN) || defined(ZYAN_PPC) + ZyanStatus ZydisStringAppendDecU32(ZyanString* string, ZyanU32 value, ZyanU8 padding_length) + { + ZYAN_ASSERT(string); +@@ -157,7 +157,7 @@ ZyanStatus ZydisStringAppendDecU64(ZyanString* string, + /* Hexadecimal */ + /* ---------------------------------------------------------------------------------------------- */ + +-#if defined(ZYAN_X86) || defined(ZYAN_ARM) || defined(ZYAN_EMSCRIPTEN) ++#if defined(ZYAN_X86) || defined(ZYAN_ARM) || defined(ZYAN_EMSCRIPTEN) || defined(ZYAN_PPC) + ZyanStatus ZydisStringAppendHexU32(ZyanString* string, ZyanU32 value, ZyanU8 padding_length, + ZyanBool uppercase) + { +@@ -312,7 +312,7 @@ ZyanStatus ZydisStringAppendDecU(ZyanString* string, Z + ZYAN_CHECK(ZydisStringAppend(string, prefix)); + } + +-#if defined(ZYAN_X64) || defined(ZYAN_AARCH64) ++#if defined(ZYAN_X64) || defined(ZYAN_AARCH64) || defined(ZYAN_PPC64) + ZYAN_CHECK(ZydisStringAppendDecU64(string, value, padding_length)); + #else + if (value & 0xFFFFFFFF00000000) +@@ -337,7 +337,7 @@ ZyanStatus ZydisStringAppendHexU(ZyanString* string, Z + ZYAN_CHECK(ZydisStringAppend(string, prefix)); + } + +-#if defined(ZYAN_X64) || defined(ZYAN_AARCH64) ++#if defined(ZYAN_X64) || defined(ZYAN_AARCH64) || defined(ZYAN_PPC64) + ZYAN_CHECK(ZydisStringAppendHexU64(string, value, padding_length, uppercase)); + #else + if (value & 0xFFFFFFFF00000000)