diff --git a/build/envsetup.sh b/build/envsetup.sh index 70e5e2f32172b23a4ca3aada4fc4a9a9ddebf204..4b98030a545df3451c4d8a4efffaca3c134032bb 100644 --- a/build/envsetup.sh +++ b/build/envsetup.sh @@ -16,7 +16,7 @@ function print_usage { echo " " - echo "usage: source envsetup.sh arm/ark/engine/riscv release/debug" + echo "usage: source envsetup.sh arm/ark/arkasm/engine/riscv release/debug" echo " " } @@ -80,6 +80,9 @@ elif [ $1 = "engine" ]; then elif [ $1 = "ark" ]; then PLATFORM=ark USEOJ=1 +elif [ $1 = "arkasm" ]; then + PLATFORM=arkasm + USEOJ=0 else print_usage return diff --git a/build/third_party/patch.sh b/build/third_party/patch.sh index 647ba0f34807bfaa40c99d440c44170c4f04cb95..9a8a965cb7b2a252237259602d6faeae813492ba 100644 --- a/build/third_party/patch.sh +++ b/build/third_party/patch.sh @@ -23,7 +23,7 @@ MODIFIED_AOSP_PATH=$THIRD_PARTY_PATH/aosp_modified MODIFIED_LLVM_PATH=$THIRD_PARTY_PATH/llvm_modified function install_patch { - if [ -d $MODIFIED_AOSP_PATH ];then + if [ -d $MODIFIED_AOSP_PATH ] && [ -d $MODIFIED_LLVM_PATH ];then echo "Already Patched." exit 0 fi diff --git a/src/mapleall/BUILD.gn b/src/mapleall/BUILD.gn index 4d087663c09d8f0860ec4aea671a9d2b384ef9be..7eb0385f2b092cb9d5bfc6c0be5415de3c256a0f 100644 --- a/src/mapleall/BUILD.gn +++ b/src/mapleall/BUILD.gn @@ -55,6 +55,13 @@ config("mapleallcompilecfg") { ] } + if (TARGET == "arkasm") { + cflags_cc += [ + "-DTARGARKASM", + "-DMAPLE_ROOT=\"${MAPLE_ROOT}\"", + ] + } + if (GN_BUILD_TYPE == "DEBUG") { cflags_c += [ "-DDEBUG" ] cflags_cc += [ "-DDEBUG" ] diff --git a/src/mapleall/maple_be/BUILD.gn b/src/mapleall/maple_be/BUILD.gn index 484c399a42edd87c753788f53425750c89609c34..41c0845783f631a344146230dd8d36937b6d1b30 100644 --- a/src/mapleall/maple_be/BUILD.gn +++ b/src/mapleall/maple_be/BUILD.gn @@ -70,6 +70,14 @@ if (TARGET == "ark") { deps_libcg += [ ":libcgark" ] } +if (TARGET == "arkasm") { + include_directories += [ + "${MAPLEALL_ROOT}/maple_be/include/cg/arkasm", + "${MAPLEALL_ROOT}/maple_be/include/be/arkasm", + ] + deps_libcg += [ ":libcgarkasm" ] +} + src_libmplad = [ "src/ad/mad.cpp" ] src_libcglowerer = [ @@ -174,6 +182,8 @@ src_libcgriscv64 = [ src_libcgark = [ "src/cg/ark/foo.cpp" ] +src_libcgarkasm = [ "src/cg/arkasm/foo.cpp" ] + src_libcgphases = [ "src/cg/cfgo.cpp", "src/cg/ebo.cpp", @@ -274,6 +284,11 @@ source_set("libcgark") { include_dirs = include_directories } +source_set("libcgarkasm") { + sources = src_libcgarkasm + include_dirs = include_directories +} + source_set("libcgphases") { sources = src_libcgphases include_dirs = include_directories diff --git a/src/mapleall/maple_be/src/cg/ark/foo.cpp b/src/mapleall/maple_be/src/cg/ark/foo.cpp new file mode 100644 index 0000000000000000000000000000000000000000..e772df5b4fadd28b6664e5704355a863d228213c --- /dev/null +++ b/src/mapleall/maple_be/src/cg/ark/foo.cpp @@ -0,0 +1 @@ +int foo() {} diff --git a/src/mapleall/maple_be/src/cg/arkasm/foo.cpp b/src/mapleall/maple_be/src/cg/arkasm/foo.cpp new file mode 100644 index 0000000000000000000000000000000000000000..e772df5b4fadd28b6664e5704355a863d228213c --- /dev/null +++ b/src/mapleall/maple_be/src/cg/arkasm/foo.cpp @@ -0,0 +1 @@ +int foo() {}