devel/cargo: add MODCARGO_WANTLIB variable

Introduce MODCARGO_WANTLIB variable to be used by port using std library from
Rust.

Rust std uses libc and libpthread for standard operations, and uses
libc++abi/libgcc for unwinding.

Unwinding is done differently depending the MACHINE_ARCH:
 - sparc64 is using libgcc (static lib)
 - others are using c++abi (shared lib)

MODCARGO_WANTLIB takes care of that details.

ok sthen@
This commit is contained in:
semarie 2022-11-01 12:36:38 +00:00
parent 2ac76f7f45
commit 49325f855b

View File

@ -23,6 +23,19 @@ MODCARGO_VENDOR_DIR ?= ${WRKSRC}/modcargo-crates
# Default path for cargo manifest.
MODCARGO_CARGOTOML ?= ${WRKSRC}/Cargo.toml
# WANTLIB for Rust compiled code
# it should be kept in sync with lang/rust code
# - c/pthread : all syscalls
# - c++abi / libgcc.a : unwind
MODCARGO_WANTLIB = c pthread
.if "${MARCHINE_ARCH}" != "sparc64"
MODCARGO_WANTLIB += c++abi
.else
# libgcc.a is static
MODCARGO_WANTLIB +=
.endif
# Define MASTER_SITES_CRATESIO for crates.io
MASTER_SITES_CRATESIO = https://crates.io/api/v1/crates/