From d8746c8c90238267e4b6a8b985528188a31f6142 Mon Sep 17 00:00:00 2001 From: Alexandre Janniaux Date: Wed, 26 Feb 2025 16:44:24 +0100 Subject: [PATCH] libtool_cargo: fix frameworks being emitted to dependencies libtool doesn't handle frameworks as dependencies, and only support them as linker argument (ie. -Wl,-framework arguments). Remove them from the link to prevent the linkage failure. This also means that they must be provided manually in the makefile afterwards... --- modules/libtool_cargo.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/libtool_cargo.sh b/modules/libtool_cargo.sh index 77bc4f3720..e9e45de21e 100755 --- a/modules/libtool_cargo.sh +++ b/modules/libtool_cargo.sh @@ -52,7 +52,11 @@ LT_CONVENIENCE=$2 $CARGO_RUSTC_CMD --manifest-path="$MODULE_PROJECT_DIR/Cargo.toml" -- ${CFGS} # "Build" the project a second time and fetch the native-static-libs to link with -NATIVE_STATIC_LIBS=$($CARGO_RUSTC_CMD --manifest-path="$MODULE_PROJECT_DIR/Cargo.toml" --quiet -- ${CFGS} --print native-static-libs 2>&1 | grep "native-static-libs" | sed "s/note: native-static-libs://" | sed "s/-lvlccore//") +NATIVE_STATIC_LIBS=$($CARGO_RUSTC_CMD --manifest-path="$MODULE_PROJECT_DIR/Cargo.toml" --quiet -- ${CFGS} --print native-static-libs 2>&1 \ + | grep "native-static-libs" \ + | sed "s/note: native-static-libs://" \ + | sed "s/-lvlccore//" \ + | sed 's/-framework [^ ]*//g') STATIC_LIB_NAME=$(echo $LT_CONVENIENCE | sed "s/\.la/\.a/") STATIC_LIB_DEP=$(echo $LT_CONVENIENCE | sed "s/\.la/\.d/")