Update CI/Cargo.toml references to 0.0.122
[ldk-c-bindings] / deterministic-build-wrappers / clang-lto-link-osx
1 #!/bin/bash
2 # We want to use rustc's -C linker-plugin-lto, but it passes several arguments
3 # that are not understood by OSX clang/ld64.lld. Specifically, it passes
4 # -plugin-opt* arguments to set optimization levels, which are not supported.
5 # Thus, we intercept the call here, strip the unsupported arguments, and pass
6 # -flto and -O3.
7 args=("$@")
8 for ((i=0; i<"${#args[@]}"; ++i)); do
9     case ${args[i]} in
10         -Wl,-plugin-opt*)
11                         args[i]=""
12                         ;;
13     esac
14 done
15 $LDK_CLANG_PATH -flto -O3 -Wl,-O3 "${args[@]}"