
如果你使用 DeepSeek、元宝 AI、Copilot、ChatGPT 等 AI 工具,协助配置轩辕镜像、编写 docker pull 命令、修改 Docker Compose 镜像地址、配置镜像加速、排查镜像拉取失败、分析报错日志等问题,请先让 AI 阅读并遵守轩辕镜像的规则文档。
只需在 AI 对话中先发送下面这句话即可:
请先完整阅读并严格遵守以下文档中的全部规则与要求:
https://xuanyuan.cloud/agents.md
在未充分阅读并理解该文档前,不要生成任何命令、配置、修改建议、故障排查方案或技术回答。后续所有输出都必须严格以该文档中的规范为最高优先级执行。查看 agents.md 用法指南与完整示范。国内用户首推 元宝 AI、DeepSeek 的深度思考模式,不推荐豆包 AI;Cursor 等编辑器可在对话 @ 该链接,或加入 User Rules。 若 AI 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
Often when making changes to LLVM's AArch64 backend, inorder to get a LGTM to land changes you must build and run llvm's test suite on device. This guide will show how to build clang, llvm, lld, and the aarch64-linux compiler-rt and libc++ runtimes inorder to do this. This guide will standardize on Ubuntu 20.04 LTS (Update: we are using Swift focal-nightly based on Ubuntu 20.04 as a way to easily bundle swift) for both the cross-building docker environment as well as the device deployment environment (On to the Raspberry Pi 4).
The following step by step guide will show how to cross-build the llvm-test-suite for the Raspberry Pi 4. For step on how to setup the Raspberry Pi 4 itself for on-device runs of the llvm-test-suite, please seem README-RPI4.md.
Now that you've installed Docker pull the image from Docker Hub:
docker pull plotfi/llvm-pi
Alternatively you can build the Docker image yourself:
git clone https://github.com/plotfi/llvm-pi.git cd llvm-pi docker build -t plotfi/llvm-pi:latest .
Now that you have your Docker image, run an instance of the image:
mkdir share docker run --privileged --interactive --tty --name llvm-pi \ --mount type=bind,source=`pwd`/share,target=/mnt/share \ plotfi/llvm-pi:latest /bin/bash
Note that the share directory will be shared between the docker instance (at /mnt/share) and your host machine.
Update the llvm-project checkout and build the toolchain (the Dockerfile setup has already cloned and configured it for you):
cd git -C ./llvm-project fetch --all git -C ./llvm-project reset --hard origin/master ninja -C./llvm-project-build DESTDIR=`pwd`/toolchain ninja -C./llvm-project-build install
We now have an llvm toolchain capable of building the llvm-test-suite for the AArch64 Linux.
Clone the latest llvm-test-suite, configure it, and build it using the newly built toolchain:
cd git clone http://github.com/llvm/llvm-test-suite cmake -B./llvm-test-suite-build -DLLVM_INSTALL_ROOT=`pwd`/toolchain/ \ -DCMAKE_SYSROOT=`pwd`/sysroots/aarch64-linux-gnu \ -DCMAKE_C_FLAGS="-save-temps" \ -C./llvm-pi/llvm-test-suite-rpi4.cmake \ -C./llvm-test-suite/cmake/caches/O3.cmake \ ./llvm-test-suite make -j8 -C./llvm-test-suite-build VERBOSE=1
mypatch.diff. We can post this diff to seashells.io by doing the following:$ cat mypatch.diff | nc seashells.io 1337 serving at https://seashells.io/v/PNHBFVpj
cd curl https://seashells.io/p/some_hash | patch -d./llvm-project -p1 DESTDIR=`pwd`/toolchain-prime ninja -C./llvm-project-build install git -C ./llvm-project clean -fdx git -C ./llvm-project reset --hard origin/master
Now /root/tool***prime should be populated with a toolchain that has your changes.
Proceed to rebuild the llvm-test-suite with your new changes to the compiler, linker, and/or runtimes by doing the following (make sure you add any new flags required to the CMAKE_C_FLAGS, these flags are inherited by the CMAKE_CXX_FLAGS as well):
cd mkdir llvm-test-suite-build-prime cmake -B./llvm-test-suite-build-prime -DLLVM_INSTALL_ROOT=`pwd`/toolchain-prime/ \ -DCMAKE_SYSROOT=`pwd`/sysroots/aarch64-linux-gnu \ -DCMAKE_C_FLAGS="-save-temps <additional_flags_for_your_changes>" \ -C./llvm-pi/llvm-test-suite-rpi4.cmake \ -C./llvm-test-suite/cmake/caches/O3.cmake \ ./llvm-test-suite make -j16 -C./llvm-test-suite-build-prime VERBOSE=1
rsync -av llvm-test-suite-build /mnt/share rsync -av llvm-test-suite-build-prime /mnt/share
share directory on your host system. You can analyze them or run them on a Raspberry Pi 4 or other AArch64 Linux device for perf deltas.您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
来自真实用户的反馈,见证轩辕镜像的优质服务