From 1a3381b096a779bcd3885ef63d91c43109dc562a Mon Sep 17 00:00:00 2001 From: "wangyongchao.bj" Date: Mon, 21 Feb 2022 14:45:29 +0800 Subject: [PATCH] docs: Developer-Guide build a custom Kata agent with musl The Developer-Guide.md build a custom kata agent with `x86_64-unknown-linux-musl`. The `musl` should be changed by the system arch. The system arch is aarch64, ppc64le and s390x, the musl should be changed. When the arch is ppc64le or s390x, the musl should be replaced by the gnu. Fixes: #3731 Signed-off-by: wangyongchao.bj --- docs/Developer-Guide.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/Developer-Guide.md b/docs/Developer-Guide.md index f4ec4ff7ba..8435c23da6 100644 --- a/docs/Developer-Guide.md +++ b/docs/Developer-Guide.md @@ -212,11 +212,13 @@ $ sudo systemctl restart systemd-journald > > - You should only do this step if you are testing with the latest version of the agent. -The rust-agent is built with a static linked `musl.` To configure this: +The agent is built with a statically linked `musl.` The default `libc` used is `musl`, but on `ppc64le` and `s390x`, `gnu` should be used. To configure this: ``` -rustup target add x86_64-unknown-linux-musl -sudo ln -s /usr/bin/g++ /bin/musl-g++ +$ export ARCH=$(uname -m) +$ if [ "$ARCH" = "ppc64le" -o "$ARCH" = "s390x" ]; then export LIBC=gnu; else export LIBC=musl; fi +$ [ ${ARCH} == "ppc64le" ] && export ARCH=powerpc64le +$ rustup target add ${ARCH}-unknown-linux-${LIBC} ``` To build the agent: