使用示例
以龙芯LLVM8编译工具链为例,使用方式如下:
clang -fuse-ld=lld --target=loongarch64-linux-gnu --sysroot=$GCC_TOOLCHAIN_PATH/loongarch64-linux-gnu/sysroot/ hello.c
clang --target=loongarch64-linux-gnu --sysroot=$GCC_TOOLCHAIN_PATH/loongarch64-linux-gnu/sysroot/ -B $GCC_TOOLCHAIN_PATH hello.c
注:$GCC_TOOLCHAIN_PATH为gcc交叉工具链路径,需要从这里下载。
更多关于如何交叉编译,可参考上游社区手册。