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 |
||
---|---|---|
.. | ||
ToolChains | ||
Action.cpp | ||
CMakeLists.txt | ||
Compilation.cpp | ||
Distro.cpp | ||
Driver.cpp | ||
DriverOptions.cpp | ||
Job.cpp | ||
Multilib.cpp | ||
OffloadBundler.cpp | ||
OptionUtils.cpp | ||
Phases.cpp | ||
SanitizerArgs.cpp | ||
Tool.cpp | ||
ToolChain.cpp | ||
Types.cpp | ||
XRayArgs.cpp |