Skip to content

LoongArch64: initial the coredistools supporting LA64. #367

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions build-coredistools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ case "$TargetOSArchitecture" in
LLVMHostTriple=x86_64-linux-gnu
;;

linux-loongarch64)
CMakeCrossCompiling=OFF
LLVMHostTriple=loongarch64-linux-gnu
LLVMTargetsToBuild="LoongArch"
;;

osx-arm64)
CMakeCrossCompiling=ON
CMakeOSXArchitectures=arm64
Expand Down
6 changes: 6 additions & 0 deletions src/coredistools/coredistools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,9 @@ bool CorDisasm::setTarget() {
case Triple::aarch64:
TheTargetArch = Target_Arm64;
break;
case Triple::loongarch64:
TheTargetArch = Target_LoongArch64;
break;
default:
Print->Error("Unsupported Architecture: %s\n",
Triple::getArchTypeName(TheTriple->getArch()));
Expand All @@ -304,6 +307,9 @@ bool CorDisasm::setTarget() {
case Target_X64:
TheTriple->setArch(Triple::x86_64);
break;
case Target_LoongArch64:
TheTriple->setArch(Triple::loongarch64);
break;
default:
Print->Error("Unsupported Architecture: %s\n",
Triple::getArchTypeName(TheTriple->getArch()));
Expand Down
3 changes: 2 additions & 1 deletion src/coredistools/coredistools.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ enum TargetArch {
Target_X86,
Target_X64,
Target_Thumb,
Target_Arm64
Target_Arm64,
Target_LoongArch64
};

struct CorDisasm;
Expand Down