diff --git a/build/config.gni b/build/config.gni index 2a1b78893a02962eb258cf5e72c43bc3e8ad9b42..5ed59b245ff197686a0327e0446b8a350d6527c9 100644 --- a/build/config.gni +++ b/build/config.gni @@ -14,7 +14,12 @@ # # Toolchain setup -CLANG_PATH = "${MAPLE_ROOT}/tools/clang+llvm-8.0.0-x86_64-linux-gnu-ubuntu-16.04" +if (OLD_OS == "1") { + CLANG_PATH = "${MAPLE_ROOT}/tools/clang+llvm-8.0.0-x86_64-linux-gnu-ubuntu-16.04" +} else { + CLANG_PATH = "/usr" +} + ANDROID_GCC_PATH = "${MAPLE_ROOT}/tools/gcc" ANDROID_CLANG_PATH = "${MAPLE_ROOT}/tools/clang-r353983c" GCC_LINARO_PATH = "${MAPLE_ROOT}/tools/gcc-linaro-7.5.0" diff --git a/build/config/BUILDCONFIG.gn b/build/config/BUILDCONFIG.gn index 1fa4e65631d70795ce7786eaa966a181bc1001c4..84af356ab1c76de937758fe9e414de9fd090babf 100644 --- a/build/config/BUILDCONFIG.gn +++ b/build/config/BUILDCONFIG.gn @@ -31,6 +31,12 @@ MAPLE_ROOT = getenv("MAPLE_ROOT") ANDROID_ROOT = "${MAPLE_ROOT}/android" MAPLE_BUILD_TYPE = getenv("MAPLE_BUILD_TYPE") MAPLE_BUILD_OUTPUT = getenv("MAPLE_BUILD_OUTPUT") +OLD_OS = getenv("OLD_OS") +if (OLD_OS == "1") { + DESIGNATOR="-Wno-gnu-designator" +} else { + DESIGNATOR="-Wno-c99-designator" +} DYNAMICLANG = true RC_V2 = true @@ -108,6 +114,7 @@ cflags_c += [ "-Werror", "-Wdate-time", "-Wfloat-equal", + "${DESIGNATOR}", ] cflags_cc += [ @@ -120,6 +127,7 @@ cflags_cc += [ "-Werror", "-Wdate-time", "-Wfloat-equal", + "${DESIGNATOR}", ] if (HOST_ARCH == 64) { diff --git a/build/core/maple_variables.mk b/build/core/maple_variables.mk index c28d4b151b79b7e3f7b34de65ede945c51de81e6..a529a6f6aa75684acfb44f26070c49dcf30ee226 100644 --- a/build/core/maple_variables.mk +++ b/build/core/maple_variables.mk @@ -18,7 +18,12 @@ LIB_CORE_PATH := $(MAPLE_BUILD_OUTPUT)/libjava-core LIB_CORE_JAR := $(LIB_CORE_PATH)/java-core.jar LIB_CORE_MPLT := $(LIB_CORE_PATH)/java-core.mplt -CLANG_PATH := $(MAPLE_ROOT)/tools/clang+llvm-8.0.0-x86_64-linux-gnu-ubuntu-16.04 +ifeq ($(OLD_OS), 1) + CLANG_PATH = "${MAPLE_ROOT}/tools/clang+llvm-8.0.0-x86_64-linux-gnu-ubuntu-16.04" +else + CLANG_PATH = "/usr" +endif + ANDROID_GCC_PATH := $(MAPLE_ROOT)/tools/gcc ANDROID_CLANG_PATH := $(MAPLE_ROOT)/tools/clang-r353983c GCC_LINARO_PATH := $(MAPLE_ROOT)/tools/gcc-linaro-7.5.0 @@ -65,13 +70,13 @@ ifeq ($(OPS_ANDROID), 0) QEMU_CLANG_FLAGS += -nostdlibinc \ --gcc-toolchain=$(GCC_LINARO_PATH) \ --sysroot=$(GCC_LINARO_PATH)/aarch64-linux-gnu/libc \ - -isystem $(GCC_LINARO_PATH)/bin/../lib/gcc/aarch64-linux-gnu/7.5.0/../../../../aarch64-linux-gnu/include/c++/7.5.0 \ - -isystem $(GCC_LINARO_PATH)/bin/../lib/gcc/aarch64-linux-gnu/7.5.0/../../../../aarch64-linux-gnu/include/c++/7.5.0/aarch64-linux-gnu \ - -isystem $(GCC_LINARO_PATH)/bin/../lib/gcc/aarch64-linux-gnu/7.5.0/../../../../aarch64-linux-gnu/include/c++/7.5.0/backward \ - -isystem $(GCC_LINARO_PATH)/bin/../lib/gcc/aarch64-linux-gnu/7.5.0/include \ - -isystem $(GCC_LINARO_PATH)/bin/../lib/gcc/aarch64-linux-gnu/7.5.0/include-fixed \ - -isystem $(GCC_LINARO_PATH)/bin/../lib/gcc/aarch64-linux-gnu/7.5.0/../../../../aarch64-linux-gnu/include \ - -isystem $(GCC_LINARO_PATH)/bin/../aarch64-linux-gnu/libc/usr/include \ + -isystem $(GCC_LINARO_PATH)/aarch64-linux-gnu/include/c++/7.5.0 \ + -isystem $(GCC_LINARO_PATH)/aarch64-linux-gnu/include/c++/7.5.0/aarch64-linux-gnu \ + -isystem $(GCC_LINARO_PATH)/aarch64-linux-gnu/include/c++/7.5.0/backward \ + -isystem $(GCC_LINARO_PATH)/lib/gcc/aarch64-linux-gnu/7.5.0/include \ + -isystem $(GCC_LINARO_PATH)/lib/gcc/aarch64-linux-gnu/7.5.0/include-fixed \ + -isystem $(GCC_LINARO_PATH)/aarch64-linux-gnu/include \ + -isystem $(GCC_LINARO_PATH)/aarch64-linux-gnu/libc/usr/include \ -target aarch64-linux-gnu else QEMU_CLANG_FLAGS := -Wall -fstack-protector-strong -fPIC -Werror -Wno-unused-command-line-argument \ diff --git a/build/envsetup.sh b/build/envsetup.sh index 81e8417c653f978114c1d9d76c8b3c82bbc931b3..f61521763c8ce34bbf0e3597cdb8b09521b03046 100644 --- a/build/envsetup.sh +++ b/build/envsetup.sh @@ -41,6 +41,14 @@ fi export GCOV_PREFIX=${MAPLE_ROOT}/report/gcda export GCOV_PREFIX_STRIP=7 +OS_VERSION=`lsb_release -r | sed -e "s/^[^0-9]*//" -e "s/\..*//"` +if [ "$OS_VERSION" = "16" ] || [ "$OS_VERSION" = "18" ]; then + OLD_OS=1 +else + OLD_OS=0 +fi +export OLD_OS=${OLD_OS} + # workaround for current build if [ "$#" -eq 0 ]; then unset MAPLE_BUILD_OUTPUT diff --git a/doc/cn/DevelopmentPreparation.md b/doc/cn/DevelopmentPreparation.md index 40d597820ad4618c3fc18d4cfde2b8bfe046fd4d..83be18d14c35ca23d65e5e2517479c8d6e0049ee 100644 --- a/doc/cn/DevelopmentPreparation.md +++ b/doc/cn/DevelopmentPreparation.md @@ -10,12 +10,21 @@ ## 开发环境推荐 -您需要安装一个64位版本的Ubuntu(推荐Ubuntu 16.04) +您需要安装一个64位版本的Ubuntu(Ubuntu 16.04,18.04,20.04皆可) ``` +sudo apt-get -y install clang llvm lld libelf-dev libssl-dev python sudo apt-get -y install openjdk-8-jdk git-core build-essential zlib1g-dev libc6-dev-i386 g++-multilib gcc-multilib linux-libc-dev:i386 + +Ubuntu 16.04: sudo apt-get -y install gcc-5-aarch64-linux-gnu g++-5-aarch64-linux-gnu + +Ubuntu 18.04: +sudo apt-get -y install gcc-7-aarch64-linux-gnu g++-7-aarch64-linux-gnu + +Ubuntu 20.04: +sudo apt-get -y install gcc-9-aarch64-linux-gnu g++-9-aarch64-linux-gnu ``` ## 自动安装工具 @@ -25,7 +34,7 @@ tools/setup_tools.sh ``` -## 安装Clang编译器并完成配置(用于编译方舟编译器代码) +## 安装Clang编译器并完成配置(用于编译方舟编译器代码,已改为使用系统安装的Clang) 下载**clang+llvm-8.0.0-x86_64-linux-gnu-ubuntu-16.04** (具体版本请根据系统版本确定) diff --git a/src/mapleall/mpl2mpl/src/reflection_analysis.cpp b/src/mapleall/mpl2mpl/src/reflection_analysis.cpp index 4a65fa8c35de1c09bb774b90c66ff9759454ecd7..5ca55d7c60e092923fe0c062a058581c90ecabe0 100755 --- a/src/mapleall/mpl2mpl/src/reflection_analysis.cpp +++ b/src/mapleall/mpl2mpl/src/reflection_analysis.cpp @@ -1546,7 +1546,7 @@ void ReflectionAnalysis::GenClassMetaData(Klass &klass) { } if (structType->IsMIRClassType()) { MIRClassType *classType = static_cast(structType); - for (TyIdx const kTyIdx : classType->GetInterfaceImplemented()) { + for (TyIdx const &kTyIdx : classType->GetInterfaceImplemented()) { Klass *interface = klassH->GetKlassFromTyIdx(kTyIdx); if (interface == nullptr) { MIRType *type = GlobalTables::GetTypeTable().GetTypeFromTyIdx(kTyIdx); diff --git a/src/mplfe/common/src/fe_type_manager.cpp b/src/mplfe/common/src/fe_type_manager.cpp index d03ed9d12f2010448cc4149c65306c616e076862..11ea27e59871047ec53e897a1320834a80666c23 100644 --- a/src/mplfe/common/src/fe_type_manager.cpp +++ b/src/mplfe/common/src/fe_type_manager.cpp @@ -142,7 +142,7 @@ void FETypeManager::CheckSameNamePolicy() const { if (result.size() > 0) { WARN(kLncWarn, "========== Structs list with the same name =========="); } - for (const std::pair> &item : result) { + for (const std::pair> &item : result) { std::string typeName = GlobalTables::GetStrTable().GetStringFromStrIdx(item.first); WARN(kLncWarn, "Type: %s", typeName.c_str()); for (const GStrIdx &mpltNameIdx : item.second) { @@ -584,4 +584,4 @@ MIRFunction *FETypeManager::GetMCCFunction(const GStrIdx &funcNameIdx) const { return it->second; } } -} // namespace maple \ No newline at end of file +} // namespace maple diff --git a/src/mplfe/common/src/feir_stmt.cpp b/src/mplfe/common/src/feir_stmt.cpp index 1c7befe89481d922674f820307844bff91bf0e95..79f2433e9241f27277dd44164c6313a67c0e5b58 100644 --- a/src/mplfe/common/src/feir_stmt.cpp +++ b/src/mplfe/common/src/feir_stmt.cpp @@ -449,7 +449,7 @@ FEIRStmtSwitch::~FEIRStmtSwitch() { std::list FEIRStmtSwitch::GenMIRStmtsImpl(MIRBuilder &mirBuilder) const { std::list ans; CaseVector switchTable(mirBuilder.GetCurrentFuncCodeMpAllocator()->Adapter()); - for (const std::pair &targetPair : mapValueTargets) { + for (const std::pair &targetPair : mapValueTargets) { CHECK_NULL_FATAL(targetPair.second); switchTable.push_back(std::make_pair(targetPair.first, targetPair.second->GetMIRLabelIdx())); } diff --git a/src/mplfe/jbc_input/include/jbc_attr.h b/src/mplfe/jbc_input/include/jbc_attr.h index 4d6cf42a883d41828ca9476b7408d51ebaa3de11..0fba2413cefd7bffa2bffd48c3abaf6527669166 100644 --- a/src/mplfe/jbc_input/include/jbc_attr.h +++ b/src/mplfe/jbc_input/include/jbc_attr.h @@ -166,7 +166,7 @@ class JBCAttrCode : public JBCAttr { ~JBCAttrCode(); void InitLocalVarInfo(); void SetLoadStoreType() const; - const MapleMap &GetInstMap() const { + const MapleMap &GetInstMap() const { return instructions; } @@ -218,7 +218,7 @@ class JBCAttrCode : public JBCAttr { MapleVector exceptions; uint16 nAttr; MapleVector attrs; - MapleMap instructions; + MapleMap instructions; JBCAttrMap attrMap; JBCAttrLocalVariableInfo localVarInfo; }; diff --git a/src/mplfe/jbc_input/src/jbc_attr.cpp b/src/mplfe/jbc_input/src/jbc_attr.cpp index 977bc653eb9ebb2ba689961c9e0cf0a9d58a468f..f451870e1b0e89829bd4c3dbc00e77b54133ce43 100644 --- a/src/mplfe/jbc_input/src/jbc_attr.cpp +++ b/src/mplfe/jbc_input/src/jbc_attr.cpp @@ -253,7 +253,7 @@ std::list JBCAttrLocalVariableInfo::EmitToStrings() const { std::list ans; std::stringstream ss; ans.emplace_back("===== Local Variable Info ====="); - for (const std::pair, JavaAttrLocalVariableInfoItem> &itemPair : itemMap) { + for (const std::pair, JavaAttrLocalVariableInfoItem> &itemPair : itemMap) { const JavaAttrLocalVariableInfoItem &item = itemPair.second; ss.str(""); ss << "slot[" << item.slotIdx << "]: "; diff --git a/src/mplfe/jbc_input/src/jbc_function.cpp b/src/mplfe/jbc_input/src/jbc_function.cpp index c502004181b604a692325234f7b08992ffdab472..022160c379ad70e8fe52606629b6f5c79d8e726d 100644 --- a/src/mplfe/jbc_input/src/jbc_function.cpp +++ b/src/mplfe/jbc_input/src/jbc_function.cpp @@ -318,8 +318,8 @@ bool JBCFunction::CheckJVMStackResult() { } bool JBCFunction::PreBuildJsrInfo(const jbc::JBCAttrCode &code) { - const MapleMap &instMap = code.GetInstMap(); - for (const std::pair &it : instMap) { + const MapleMap &instMap = code.GetInstMap(); + for (const std::pair &it : instMap) { uint32 pc = it.first; jbc::JBCOp *op = it.second; ASSERT_NOT_NULL(op); @@ -353,8 +353,8 @@ bool JBCFunction::PreBuildJsrInfo(const jbc::JBCAttrCode &code) { bool JBCFunction::BuildStmtFromInstruction(const jbc::JBCAttrCode &code) { GeneralStmt *stmt = nullptr; - const MapleMap &instMap = code.GetInstMap(); - for (const std::pair &it : instMap) { + const MapleMap &instMap = code.GetInstMap(); + for (const std::pair &it : instMap) { uint32 pc = it.first; const jbc::JBCOp *op = it.second; ASSERT(op != nullptr, "null ptr check"); @@ -416,7 +416,7 @@ GeneralStmt *JBCFunction::BuildStmtFromInstructionForSwitch(const jbc::JBCOp &op GeneralStmt *stmt = uniStmt.get(); stmt->SetFallThru(false); const jbc::JBCOpSwitch &opSwitch = static_cast(op); - for (const std::pair &targetInfo : opSwitch.GetTargets()) { + for (const std::pair &targetInfo : opSwitch.GetTargets()) { GeneralStmt *target = BuildAndUpdateLabel(targetInfo.second, uniStmt); static_cast(stmt)->AddSucc(target); } @@ -491,7 +491,7 @@ void JBCFunction::BuildStmtForTry(const jbc::JBCAttrCode &code) { rawInfo[std::make_pair(start, end)].push_back(handlerPC); } BuildTryInfo(rawInfo, outMapStartEnd, outMapStartCatch); - for (const std::pair &startEnd : outMapStartEnd) { + for (const std::pair &startEnd : outMapStartEnd) { // Try JBCStmtPesudoTry *stmtTry = static_cast(RegisterGeneralStmt(std::make_unique())); @@ -620,8 +620,8 @@ void JBCFunction::BuildStmtForInstComment(const jbc::JBCAttrCode &code) { uint16 currLineNum = 0xFFFF; // use 0xFFFF as invalid line number std::stringstream ss; const jbc::JBCConstPool &constPool = method.GetConstPool(); - const MapleMap &instMap = code.GetInstMap(); - for (const std::pair &it : instMap) { + const MapleMap &instMap = code.GetInstMap(); + for (const std::pair &it : instMap) { uint32 pc = it.first; jbc::JBCOp *op = it.second; if (mapPCLineNum.find(pc) != mapPCLineNum.end()) { diff --git a/src/mplfe/jbc_input/src/jbc_function_context.cpp b/src/mplfe/jbc_input/src/jbc_function_context.cpp index c2ab16a5b97514d7677b61a345ddd363eb5afdc7..f0b594d8c50a80c56ce13d829b9be247351a3d73 100644 --- a/src/mplfe/jbc_input/src/jbc_function_context.cpp +++ b/src/mplfe/jbc_input/src/jbc_function_context.cpp @@ -39,7 +39,7 @@ void JBCFunctionContext::ArrangeStmts() { * comment * inst */ - for (const std::pair &pcInst : mapPCStmtInst) { + for (const std::pair &pcInst : mapPCStmtInst) { uint32 pc = pcInst.first; GeneralStmt *stmtInst = pcInst.second; if (mapPCEndTryStmt.find(pc) != mapPCEndTryStmt.end()) { @@ -80,4 +80,4 @@ const FEIRType *JBCFunctionContext::GetSlotType(uint16 slotIdx) const { const jbc::JavaAttrLocalVariableInfoItem &info = localVarInfo.GetItemByStart(slotIdx, startPC); return info.feirType; } -} // namespace maple \ No newline at end of file +} // namespace maple diff --git a/test/testsuite/maple.py b/test/testsuite/maple.py index 393950c88be11e82a789f322a569d1175a737b7b..8f9b86cd4f943382e2cd44ae3ae5d72be11803f8 100644 --- a/test/testsuite/maple.py +++ b/test/testsuite/maple.py @@ -219,7 +219,11 @@ def do_prepare(components, info, maple_root): maple_out_path = os.environ.get("MAPLE_BUILD_OUTPUT") maple_out_lib_path = maple_out_path + "/ops" maple_out_bin_path = maple_out_path + "/bin/" - gnu_bin_path = maple_root + "/tools/clang+llvm-8.0.0-x86_64-linux-gnu-ubuntu-16.04/bin/" + old_os = os.environ.get("OLD_OS") + if old_os == "1": + gnu_bin_path = maple_root + "/tools/clang+llvm-8.0.0-x86_64-linux-gnu-ubuntu-16.04/bin/" + elif old_os == "0": + gnu_bin_path = "/usr/bin/" as_options = "-g3 -O2 -x assembler-with-cpp -march=armv8-a -target aarch64-linux-gnu -c " cc_options = "-g3 -O2 -c -march=armv8-a -target aarch64-linux-gnu" cxx_options = "-g3 -O2 -c -fPIC -march=armv8-a -target aarch64-linux-gnu" diff --git a/tools/setup_tools.sh b/tools/setup_tools.sh index 34a9b7943b526f31abed1500cd356d7e7e83079d..f3945849bc6a1691063f6954b2a68da76fc1b74b 100755 --- a/tools/setup_tools.sh +++ b/tools/setup_tools.sh @@ -31,9 +31,43 @@ ANDROID_SRCDIR=$MAPLE_ROOT/../android/$ANDROID_VERSION ANDROID_DIR=$MAPLE_ROOT/android +if [ "$OLD_OS" == "1" ]; then + if [ ! -f $TOOLS/clang+llvm-8.0.0-x86_64-linux-gnu-ubuntu-16.04/bin/clang ]; then + cd $TOOLS + echo Start wget llvm-8.0.0 ... + wget https://releases.llvm.org/8.0.0/clang+llvm-8.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz + echo unpacking clang+llvm ... + tar xf clang+llvm-8.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz + echo Downloaded clang+llvm. + fi +fi + +if [ "$android_env" == "android" ]; then + if [ ! -f $TOOLS/android-ndk-r21/ndk-build ]; then + cd $TOOLS + wget https://dl.google.com/android/repository/android-ndk-r21d-linux-x86_64.zip + echo unpacking android ndk ... + unzip android-ndk-r21d-linux-x86_64.zip > /dev/null + mv android-ndk-r21d android-ndk-r21 + echo Downloaded android ndk. + fi + + if [ ! -L $TOOLS/gcc ]; then + cd $TOOLS + ln -s ../android/prebuilts/gcc . + echo Linked gcc. + fi + + if [ ! -L $TOOLS/clang-r353983c ]; then + cd $TOOLS + ln -s ../android/prebuilts/clang/host/linux-x86/clang-r353983c . + echo Linked clang. + fi +fi + if [ ! -f $TOOLS/ninja/ninja ]; then cd $TOOLS - echo Start wget ninja.............. + echo Start wget ninja ... mkdir -p ./ninja cd ./ninja || exit 3 wget https://github.com/ninja-build/ninja/releases/download/v1.10.0/ninja-linux.zip @@ -43,24 +77,15 @@ fi if [ ! -f $TOOLS/gn/gn ]; then cd $TOOLS - echo Start clone gn.................. + echo Start clone gn ... git clone https://gitee.com/xlnb/gn_binary.git gn chmod +x gn/gn echo Downloaded gn. fi -if [ ! -f $TOOLS/clang+llvm-8.0.0-x86_64-linux-gnu-ubuntu-16.04/bin/clang ]; then - cd $TOOLS - echo Start wget llvm-8.0.0........................ - wget https://releases.llvm.org/8.0.0/clang+llvm-8.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz - echo unpacking clang+llvm ... - tar xf clang+llvm-8.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz - echo Downloaded clang+llvm. -fi - if [ ! -f $TOOLS/gcc-linaro-7.5.0/bin/aarch64-linux-gnu-gcc ]; then cd $TOOLS - echo Start wget gcc-linaro-7.5.0................... + echo Start wget gcc-linaro-7.5.0 ... wget https://releases.linaro.org/components/toolchain/binaries/latest-7/aarch64-linux-gnu/gcc-linaro-7.5.0-2019.12-i686_aarch64-linux-gnu.tar.xz echo unpacking gcc ... tar xf gcc-linaro-7.5.0-2019.12-i686_aarch64-linux-gnu.tar.xz @@ -68,18 +93,9 @@ if [ ! -f $TOOLS/gcc-linaro-7.5.0/bin/aarch64-linux-gnu-gcc ]; then echo Downloaded gcc aarch64 compiler. fi -if [ ! -f $TOOLS/android-ndk-r21/ndk-build ] && [ "$android_env" == "android" ]; then - cd $TOOLS - wget https://dl.google.com/android/repository/android-ndk-r21d-linux-x86_64.zip - echo unpacking android ndk ... - unzip android-ndk-r21d-linux-x86_64.zip > /dev/null - mv android-ndk-r21d android-ndk-r21 - echo Downloaded android ndk. -fi - if [ ! -f $MAPLE_ROOT/third_party/d8/lib/d8.jar ]; then cd $TOOLS - echo Start clone d8............... + echo Start clone d8 ... git clone https://gitee.com/xlnb/r8-d81513.git mkdir -p $MAPLE_ROOT/third_party/d8/lib cp -f r8-d81513/d8/lib/d8.jar $MAPLE_ROOT/third_party/d8/lib @@ -88,38 +104,26 @@ fi if [ ! -d $MAPLE_ROOT/third_party/icu ]; then cd $TOOLS - echo Start clone ICU4C.............. + echo Start clone ICU4C ... git clone https://gitee.com/xlnb/icu4c.git mkdir -p $MAPLE_ROOT/third_party/icu cp -r icu4c/lib/ $MAPLE_ROOT/third_party/icu/ echo Downloaded icu4c libs fi -# download and build andriod source +# download prebuilt andriod if [ ! -d $ANDROID_DIR/out/target/product/generic_arm64 ]; then cd $TOOLS - echo Start clone AOSP CORE LIB........... + echo Start clone AOSP CORE LIB ... git clone https://gitee.com/xlnb/aosp_core_bin.git cp -r aosp_core_bin/android $MAPLE_ROOT/ cp -r aosp_core_bin/libjava-core $MAPLE_ROOT/ echo Downloaded AOSP CORE LIB fi -if [ ! -L $TOOLS/gcc ] && [ "$android_env" == "android" ]; then - cd $TOOLS - ln -s ../android/prebuilts/gcc . - echo Linked gcc. -fi - -if [ ! -L $TOOLS/clang-r353983c ] && [ "$android_env" == "android" ]; then - cd $TOOLS - ln -s ../android/prebuilts/clang/host/linux-x86/clang-r353983c . - echo Linked clang. -fi - if [ ! -f $MAPLE_ROOT/third_party/libdex/prebuilts/aarch64-linux-gnu/libz.so.1.2.8 ]; then cd $TOOLS - echo Start wget libz............................. + echo Start wget libz ... wget http://ports.ubuntu.com/pool/main/z/zlib/zlib1g_1.2.8.dfsg-2ubuntu4_arm64.deb mkdir -p libz_extract dpkg --extract zlib1g_1.2.8.dfsg-2ubuntu4_arm64.deb libz_extract @@ -129,3 +133,19 @@ if [ ! -f $MAPLE_ROOT/third_party/libdex/prebuilts/aarch64-linux-gnu/libz.so.1.2 echo Downloaded libz. fi +# install qemu-user 2.5 +if [ ! -f $MAPLE_ROOT/tools/qemu/done ]; then + cd $TOOLS + echo Start wget qemu-user ... + rm -rf qemu + mkdir -p qemu + cd qemu + wget http://security.ubuntu.com/ubuntu/pool/universe/q/qemu/qemu-user_2.5+dfsg-5ubuntu10.48_amd64.deb + echo Install qemu-aarch64 ... + # use the following to make sure only the specific version of qemu-user is isstalled + # the first version sometimes insists to install the system default qemu-user. + # sudo apt install ./qemu-user_2.5+dfsg-5ubuntu10.48_amd64.deb + sudo dpkg -i ./qemu-user_2.5+dfsg-5ubuntu10.48_amd64.deb || sudo apt install -f + touch done + echo Installed qemu-aarch64 +fi