forked from OSchip/llvm-project
![]() With the initial support added, clang can compile `helloworld` C to executable file for loongarch64. For example: ``` $ cat hello.c int main() { printf("Hello, world!\n"); return 0; } $ clang --target=loongarch64-unknown-linux-gnu --gcc-toolchain=xxx --sysroot=xxx hello.c ``` The output a.out can run within qemu or native machine. For example: ``` $ file ./a.out ./a.out: ELF 64-bit LSB pie executable, LoongArch, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-loongarch-lp64d.so.1, for GNU/Linux 5.19.0, with debug_info, not stripped $ ./a.out Hello, world! ``` Currently gcc toolchain and sysroot can be found here: https://github.com/loongson/build-tools/releases/download/2022.08.11/loongarch64-clfs-5.1-cross-tools-gcc-glibc.tar.xz Reference: https://github.com/loongson/LoongArch-Documentation The last commit hash (main branch) is: 99016636af64d02dee05e39974d4c1e55875c45b Note loongarch32 is not fully tested because there is no reference gcc toolchain yet. Differential Revision: https://reviews.llvm.org/D130255 |
||
---|---|---|
.. | ||
Targets | ||
Attributes.cpp | ||
BuiltinTargetFeatures.h | ||
Builtins.cpp | ||
CLWarnings.cpp | ||
CMakeLists.txt | ||
CharInfo.cpp | ||
CodeGenOptions.cpp | ||
Cuda.cpp | ||
DarwinSDKInfo.cpp | ||
Diagnostic.cpp | ||
DiagnosticIDs.cpp | ||
DiagnosticOptions.cpp | ||
ExpressionTraits.cpp | ||
FileEntry.cpp | ||
FileManager.cpp | ||
FileSystemStatCache.cpp | ||
IdentifierTable.cpp | ||
LangOptions.cpp | ||
LangStandards.cpp | ||
MakeSupport.cpp | ||
Module.cpp | ||
NoSanitizeList.cpp | ||
ObjCRuntime.cpp | ||
OpenCLOptions.cpp | ||
OpenMPKinds.cpp | ||
OperatorPrecedence.cpp | ||
ProfileList.cpp | ||
SanitizerSpecialCaseList.cpp | ||
Sanitizers.cpp | ||
Sarif.cpp | ||
SourceLocation.cpp | ||
SourceManager.cpp | ||
Stack.cpp | ||
TargetID.cpp | ||
TargetInfo.cpp | ||
Targets.cpp | ||
Targets.h | ||
TokenKinds.cpp | ||
TypeTraits.cpp | ||
Version.cpp | ||
Warnings.cpp | ||
XRayInstr.cpp | ||
XRayLists.cpp |