From 7dfc4e0219de92ea2097b28e9bd54d2bf97a39c6 Mon Sep 17 00:00:00 2001 From: Penny Zheng Date: Thu, 9 Jan 2020 11:08:23 +0800 Subject: [PATCH] linker: `no such file` linking error on AArch64 When using default cc linker, we will have segfault. Debugging with `rust-gdb`, the specific error is as follows: src/string/memcpy.c: No such file or directory. Only changing linker with `aarch64-linux-musl-gcc`, the `rust-agent` could be totally statically linked and run successfully. Fixes: #107 Signed-off-by: Penny Zheng --- src/agent/.cargo/config | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/agent/.cargo/config b/src/agent/.cargo/config index e2c49b02fd..7a843e5d72 100644 --- a/src/agent/.cargo/config +++ b/src/agent/.cargo/config @@ -4,6 +4,10 @@ ## [target.aarch64-unknown-linux-musl] +## Only setting linker with `aarch64-linux-musl-gcc`, the +## `rust-agent` could be totally statically linked. +linker = "aarch64-linux-musl-gcc" + ## The __addtf3, __subtf3 and __multf3 symbols are used by aarch64-musl, ## but are not provided by rust compiler-builtins. ## For now, the only functional workaround accepted by rust communities