From dbd9b1c698f00bf132d8ddbf51c06a64970eb55c Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Mon, 28 Sep 2020 16:21:15 +0300 Subject: [PATCH] public: build: add ARMv8 32-bit support, in case of someone actually uses it --- cmake/LibraryNaming.cmake | 8 +++++--- public/build.h | 17 +++++++++-------- scripts/waifulib/library_naming.py | 12 +++++++----- 3 files changed, 21 insertions(+), 16 deletions(-) diff --git a/cmake/LibraryNaming.cmake b/cmake/LibraryNaming.cmake index 22581078..f4e3d4b0 100644 --- a/cmake/LibraryNaming.cmake +++ b/cmake/LibraryNaming.cmake @@ -7,13 +7,13 @@ check_symbol_exists(XASH_AMD64 "build.h" XASH_AMD64) check_symbol_exists(XASH_ANDROID "build.h" XASH_ANDROID) check_symbol_exists(XASH_APPLE "build.h" XASH_APPLE) check_symbol_exists(XASH_ARM "build.h" XASH_ARM) -check_symbol_exists(XASH_ARM64 "build.h" XASH_ARM64) check_symbol_exists(XASH_ARM_HARDFP "build.h" XASH_ARM_HARDFP) check_symbol_exists(XASH_ARM_SOFTFP "build.h" XASH_ARM_SOFTFP) check_symbol_exists(XASH_ARMv4 "build.h" XASH_ARMv4) check_symbol_exists(XASH_ARMv5 "build.h" XASH_ARMv5) check_symbol_exists(XASH_ARMv6 "build.h" XASH_ARMv6) check_symbol_exists(XASH_ARMv7 "build.h" XASH_ARMv7) +check_symbol_exists(XASH_ARMv8 "build.h" XASH_ARMv8) check_symbol_exists(XASH_BIG_ENDIAN "build.h" XASH_BIG_ENDIAN) check_symbol_exists(XASH_BSD "build.h" XASH_BSD) check_symbol_exists(XASH_E2K "build.h" XASH_E2K) @@ -55,11 +55,13 @@ if(XASH_AMD64) set(BUILDARCH "amd64") elseif(XASH_X86) set(BUILDARCH "") -elseif(XASH_ARM64) +elseif(XASH_ARM AND XASH_64BIT) set(BUILDARCH "arm64") elseif(XASH_ARM) set(BUILDARCH "armv") - if(XASH_ARMv7) + if(XASH_ARMv8) + set(BUILDARCH "${BUILDARCH}8_32") + elseif(XASH_ARMv7) set(BUILDARCH "${BUILDARCH}7") elseif(XASH_ARMv6) set(BUILDARCH "${BUILDARCH}6") diff --git a/public/build.h b/public/build.h index a087c22c..043a11cd 100644 --- a/public/build.h +++ b/public/build.h @@ -45,13 +45,13 @@ For more information, please refer to #undef XASH_ANDROID #undef XASH_APPLE #undef XASH_ARM -#undef XASH_ARM64 #undef XASH_ARM_HARDFP #undef XASH_ARM_SOFTFP #undef XASH_ARMv4 #undef XASH_ARMv5 #undef XASH_ARMv6 #undef XASH_ARMv7 +#undef XASH_ARMv8 //#undef XASH_BIG_ENDIAN #undef XASH_BSD #undef XASH_E2K @@ -169,14 +169,13 @@ For more information, please refer to #define XASH_AMD64 1 #elif defined(__i386__) || defined(_X86_) || defined(_M_IX86) #define XASH_X86 1 -#elif defined __aarch64__ +#elif defined __aarch64__ || defined _M_ARM64 #define XASH_64BIT 1 - #define XASH_ARM64 1 + #define XASH_ARM 8 #elif defined __arm__ || defined _M_ARM - #if defined _M_ARM - // msvc can only armv7 ? - #define XASH_ARM 7 - #elif __ARM_ARCH == 7 || __ARM_ARCH_7__ + #if __ARM_ARCH == 8 || __ARM_ARCH_8__ + #define XASH_ARM 8 + #elif __ARM_ARCH == 7 || __ARM_ARCH_7__ || defined _M_ARM // msvc can only armv7 in 32 bit #define XASH_ARM 7 #elif __ARM_ARCH == 6 || __ARM_ARCH_6__ || __ARM_ARCH_6J__ #define XASH_ARM 6 @@ -212,7 +211,9 @@ For more information, please refer to #define XASH_64BIT 1 #endif -#if XASH_ARM == 7 +#if XASH_ARM == 8 + #define XASH_ARMv8 1 +#elif XASH_ARM == 7 #define XASH_ARMv7 1 #elif XASH_ARM == 6 #define XASH_ARMv6 1 diff --git a/scripts/waifulib/library_naming.py b/scripts/waifulib/library_naming.py index 827ef76c..6ee9a725 100644 --- a/scripts/waifulib/library_naming.py +++ b/scripts/waifulib/library_naming.py @@ -25,13 +25,13 @@ DEFINES = [ 'XASH_ANDROID', 'XASH_APPLE', 'XASH_ARM', -'XASH_ARM64', 'XASH_ARM_HARDFP', 'XASH_ARM_SOFTFP', 'XASH_ARMv4', 'XASH_ARMv5', 'XASH_ARMv6', 'XASH_ARMv7', +'XASH_ARMv8', 'XASH_BIG_ENDIAN', 'XASH_BSD', 'XASH_E2K', @@ -61,9 +61,9 @@ def configure(conf): 'fragment': CHECK_SYMBOL_EXISTS_FRAGMENT % (x, x), 'includes': [conf.path.find_node('public/').abspath()], 'define_name': x }, DEFINES ) - + conf.multicheck(*tests, msg = '', mandatory = False, quiet = True) - + # engine/common/build.c if conf.env.XASH_ANDROID: buildos = "android" @@ -87,11 +87,13 @@ def configure(conf): buildarch = "amd64" elif conf.env.XASH_X86: buildarch = "" - elif conf.env.XASH_ARM64: + elif conf.env.XASH_ARM and conf.env.XASH_64BIT: buildarch = "arm64" elif conf.env.XASH_ARM: buildarch = "armv" - if conf.env.XASH_ARMv7: + if conf.env.XASH_ARMv8: + buildarch += "8_32" + elif conf.env.XASH_ARMv7: buildarch += "7" elif conf.env.XASH_ARMv6: buildarch += "6"