From d14c022feada8ce6d8c45792a9f37b1e44fb8530 Mon Sep 17 00:00:00 2001 From: binaryfz Date: Fri, 4 Sep 2020 09:39:09 +0800 Subject: [PATCH 1/2] MCC_getFuncPtrFromItab bugfix --- src/BUILD.gn | 2 +- src/bin/maple | Bin 5204056 -> 5204056 bytes src/maple_be/BUILD.gn | 1 - src/maple_driver/BUILD.gn | 5 +---- src/mpl2mpl/src/vtable_impl.cpp | 8 +++++++- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/BUILD.gn b/src/BUILD.gn index df5383bd8f..4b8a86442e 100644 --- a/src/BUILD.gn +++ b/src/BUILD.gn @@ -16,7 +16,7 @@ config("mapleallcompilecfg") { cflags_cc = [] cflags_cc += [ "-std=c++14", - "-Werror", + "-fno-common", "-DTARGAARCH64", ] diff --git a/src/bin/maple b/src/bin/maple index 75aece5c09d8464c7b132e1f2edb1edc291794ce..0b31ff486ecb0f187301f4edd3633f5fad6874b7 100755 GIT binary patch delta 222 zcmWN?IZgsm0D$4Vff)pmQ3M4Sz(H`seF0=wLFJ*g+`tRiOYuhw3KE*B=_yU7vXa=5 zP;v~8z$?Cd)5)(kRXPYXT)5FO@UVavAB*@|B7n&!6jE*b3>LKd2T6Cq(qqtRchRE&jWQDJo3ad%^&%x vi>}?#Hp3*f1E2|-|Ls%z0CRR|IS7TIHP1ipBA zmEVsDHrHpMC=d4H=d-V$_&%6DCcW zHX~=&oOuftEm^i=)tYr1Hf`CqW7nR22M!%McH-2Ta~CdMy+==B@KVf&Q7KT&CgWbq mU&-hp5xkXispv5bK8vMv^cVa*7cx=oI(8GgEf+F(-}nDQ6HZeA diff --git a/src/maple_be/BUILD.gn b/src/maple_be/BUILD.gn index 256adece13..1f94c77d1b 100644 --- a/src/maple_be/BUILD.gn +++ b/src/maple_be/BUILD.gn @@ -111,7 +111,6 @@ src_libcg = [ deps_libcg = [] deps_libcg += [ ":libcgaarch64" ] -cflags_cc += [ "-DTARGAARCH64" ] cflags_cc -= [ "-DRC_NO_MMAP" ] cflags_cc -= [ "-DMIR_JAVA=1" ] diff --git a/src/maple_driver/BUILD.gn b/src/maple_driver/BUILD.gn index 57fe6029dc..aae4faf220 100644 --- a/src/maple_driver/BUILD.gn +++ b/src/maple_driver/BUILD.gn @@ -14,10 +14,7 @@ # configs = [ "${MAPLEALL_ROOT}:mapleallcompilecfg" ] -cflags_cc += [ - "-DTARGAARCH64", - "-DMAPLE_ROOT=\"${MAPLE_ROOT}\"", -] +cflags_cc += [ "-DMAPLE_ROOT=\"${MAPLE_ROOT}\"" ] include_directories = [ "${MAPLEALL_ROOT}", diff --git a/src/mpl2mpl/src/vtable_impl.cpp b/src/mpl2mpl/src/vtable_impl.cpp index df3e65239e..fa13552b70 100644 --- a/src/mpl2mpl/src/vtable_impl.cpp +++ b/src/mpl2mpl/src/vtable_impl.cpp @@ -19,7 +19,9 @@ // This phase is mainly to lower interfacecall into icall namespace { -#ifdef USE_32BIT_REF +#if USE_ARM32_MACRO +constexpr char kInterfaceMethod[] = "MCC_getFuncPtrFromItabSecondHash32"; +#elif USE_32BIT_REF constexpr char kInterfaceMethod[] = "MCC_getFuncPtrFromItab"; #else constexpr char kInterfaceMethod[] = "MCC_getFuncPtrFromItabSecondHash64"; @@ -193,7 +195,11 @@ void VtableImpl::ItabProcess(StmtNode &stmt, const ResolveFuncNode &resolveNode, CHECK_FATAL(currentFuncMpAllocator != nullptr, "null ptr check"); MapleVector opnds(currentFuncMpAllocator->Adapter()); opnds.push_back(builder->CreateExprRegread(PTY_ptr, pregItabAddress)); +#ifdef USE_ARM32_MACRO + opnds.push_back(builder->CreateIntConst(secondHashCode, PTY_u32)); +#else opnds.push_back(builder->CreateIntConst(secondHashCode, PTY_u64)); +#endif UStrIdx strIdx = GlobalTables::GetUStrTable().GetOrCreateStrIdxFromName(signature); MemPool *currentFunMp = builder->GetCurrentFuncCodeMp(); CHECK_FATAL(currentFunMp != nullptr, "null ptr check"); -- Gitee From ba6f55a0fbef958f24a20d3ff0affb07f0fe46f3 Mon Sep 17 00:00:00 2001 From: binaryfz Date: Mon, 21 Sep 2020 10:54:05 +0800 Subject: [PATCH 2/2] mod lib output path --- src/huawei_secure_c/BUILD.gn | 2 +- src/maple_be/BUILD.gn | 6 +++--- src/maple_driver/BUILD.gn | 2 +- src/maple_ipa/BUILD.gn | 2 +- src/maple_ir/BUILD.gn | 2 +- src/maple_me/BUILD.gn | 2 +- src/mpl2mpl/BUILD.gn | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/huawei_secure_c/BUILD.gn b/src/huawei_secure_c/BUILD.gn index d4a337f30d..c2f07b9018 100644 --- a/src/huawei_secure_c/BUILD.gn +++ b/src/huawei_secure_c/BUILD.gn @@ -62,5 +62,5 @@ include_common = [ static_library("libHWSecureC") { sources = src_libHWSecureC include_dirs = include_common - output_dir = "${root_out_dir}/lib/${HOST_ARCH}" + output_dir = "${root_out_dir}/ar" } diff --git a/src/maple_be/BUILD.gn b/src/maple_be/BUILD.gn index 1f94c77d1b..56589ac8db 100644 --- a/src/maple_be/BUILD.gn +++ b/src/maple_be/BUILD.gn @@ -119,7 +119,7 @@ configs = [ "${MAPLEALL_ROOT}:mapleallcompilecfg" ] static_library("libmplad") { sources = src_libmplad include_dirs = include_directories - output_dir = "${root_out_dir}/lib/${HOST_ARCH}" + output_dir = "${root_out_dir}/ar" cflags_cc += [ "-DRC_NO_MMAP" ] } @@ -137,7 +137,7 @@ static_library("libmplbe") { sources = src_libmplbe deps = deps_libmplbe include_dirs = include_directories - output_dir = "${root_out_dir}/lib/${HOST_ARCH}" + output_dir = "${root_out_dir}/ar" } source_set("libcgaarch64") { @@ -149,7 +149,7 @@ static_library("libcg") { sources = src_libcg include_dirs = include_directories deps = deps_libcg - output_dir = "${root_out_dir}/lib/${HOST_ARCH}" + output_dir = "${root_out_dir}/ar" } executable("maplegen") { diff --git a/src/maple_driver/BUILD.gn b/src/maple_driver/BUILD.gn index aae4faf220..194f035ec2 100644 --- a/src/maple_driver/BUILD.gn +++ b/src/maple_driver/BUILD.gn @@ -82,7 +82,7 @@ static_library("libdriver_option") { include_dirs = [ "${MAPLEALL_ROOT}/maple_driver/include" ] - output_dir = "${root_out_dir}/lib/${HOST_ARCH}" + output_dir = "${root_out_dir}/ar" } static_library("liboption_parser") { diff --git a/src/maple_ipa/BUILD.gn b/src/maple_ipa/BUILD.gn index 0715afab09..01c1a14217 100644 --- a/src/maple_ipa/BUILD.gn +++ b/src/maple_ipa/BUILD.gn @@ -37,5 +37,5 @@ configs = [ "${MAPLEALL_ROOT}:mapleallcompilecfg" ] static_library("libmplipa") { sources = src_libmplipa include_dirs = include_directories - output_dir = "${root_out_dir}/lib/${HOST_ARCH}" + output_dir = "${root_out_dir}/ar" } diff --git a/src/maple_ir/BUILD.gn b/src/maple_ir/BUILD.gn index a002c51d80..5c573bccfa 100644 --- a/src/maple_ir/BUILD.gn +++ b/src/maple_ir/BUILD.gn @@ -56,7 +56,7 @@ cflags_cc += [ "-DSTORE_BACK_VTABLE_REF_AFTER_LOAD=1" ] static_library("libmplir") { sources = src_libmplir include_dirs = include_directories - output_dir = "${root_out_dir}/lib/${HOST_ARCH}" + output_dir = "${root_out_dir}/ar" libs = [] libs += [ "${OPENSOURCE_DEPS}/libmplutil.a" ] deps = [ diff --git a/src/maple_me/BUILD.gn b/src/maple_me/BUILD.gn index 01e63614ff..e72b446af8 100644 --- a/src/maple_me/BUILD.gn +++ b/src/maple_me/BUILD.gn @@ -96,7 +96,7 @@ configs = [ "${MAPLEALL_ROOT}:mapleallcompilecfg" ] static_library("libmplme") { sources = src_libmplme include_dirs = include_directories - output_dir = "${root_out_dir}/lib/${HOST_ARCH}" + output_dir = "${root_out_dir}/ar" } static_library("libmplmewpo") { diff --git a/src/mpl2mpl/BUILD.gn b/src/mpl2mpl/BUILD.gn index 9303c664e0..2a54c02163 100644 --- a/src/mpl2mpl/BUILD.gn +++ b/src/mpl2mpl/BUILD.gn @@ -45,5 +45,5 @@ configs = [ "${MAPLEALL_ROOT}:mapleallcompilecfg" ] static_library("libmpl2mpl") { sources = src_libmpl2mpl include_dirs = include_directories - output_dir = "${root_out_dir}/lib/${HOST_ARCH}" + output_dir = "${root_out_dir}/ar" } -- Gitee