Help! Libc dynamic library problem

Libc dynamic library problem:

rustc -C prefer-dynamic -C linker="aarch64-linux-gnu-gccc" --target=aarch64-unknown-linux-musl -C link-args="--sysroot=/tmp/sysroots/aarch64-linux-gun-elf/ -Wl,-Bdynamic -lc -lulibs -lsrv_fs -lsrv_net -lgcc -Wl,--dynamic-linker=/lib/" -C target-feature=crt-static

It builds sucessfully,but runs failed.

It looks like is dynamically linked, but the function"calloc"(which is a member of libc) is statically linked. This caused libc to fail to call calloc during loading. How to solve this problem?

ps:There are both libc.a and in the compilation environment. Could rust links only, without libc.a linked ?

What happens when you use the -C target-feature=-crt-static (notice the leading - before crt-static) instead?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.