# llvm-toolchains **Repository Path**: riscv-sig/llvm-toolchains ## Basic Information - **Project Name**: llvm-toolchains - **Description**: riscv64架构去除eflags检查的工具链 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: weekly_20230905 - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 3 - **Created**: 2023-10-27 - **Last Updated**: 2025-09-09 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # llvm15-riscv64工具链介绍 ## 1、工具链代码下载 ```shell repo init -u https://gitee.com/OpenHarmony/manifest.git -b master -m llvm-toolchain.xml repo sync -c repo forall -c 'git lfs pull' repo start master --all ``` ## 2、环境配置 ``` bash ./toolchain/llvm-project/llvm-build/env_prepare.sh ``` ## 3、工具链代码修改 打开文件`toolchain/llvm-project/lld/ELF/Arch/RISCV.cpp`文件,然后将141-148行注释掉,如下所示 ```shell uint32_t RISCV::calcEFlags() const { // If there are only binary input files (from -b binary), use a // value of 0 for the ELF header flags. if (ctx->objectFiles.empty()) return 0; uint32_t target = getEFlags(ctx->objectFiles.front()); for (InputFile *f : ctx->objectFiles) { uint32_t eflags = getEFlags(f); if (eflags & EF_RISCV_RVC) target |= EF_RISCV_RVC; /* if ((eflags & EF_RISCV_FLOAT_ABI) != (target & EF_RISCV_FLOAT_ABI)) error(toString(f) + ": cannot link object files with different floating-point ABI"); if ((eflags & EF_RISCV_RVE) != (target & EF_RISCV_RVE)) error(toString(f) + ": cannot link object files with different EF_RISCV_RVE"); */ } return target; } ``` ## 4、`clang15.0.4`版本不编译`windows`平台 ```shell python3 ./toolchain/llvm-project/llvm-build/build.py --no-build windows ``` ## 5、获取工具链 编译生成的工具链在`out/install/linux-x86_64/clang-dev`里面