X-Git-Url: http://git.bitcoin.ninja/index.cgi?p=ldk-c-bindings;a=blobdiff_plain;f=deterministic-build-wrappers%2Fclang-lto-link-osx;fp=deterministic-build-wrappers%2Fclang-lto-link-osx;h=ae566d11c95f0746a4f4866edb95f4115d35c1ff;hp=0000000000000000000000000000000000000000;hb=7d662efb2be378b9eb3b44e981f176949dd37b43;hpb=53c4ecd80b6d3f65a9fbafccc894c0f0f9177899 diff --git a/deterministic-build-wrappers/clang-lto-link-osx b/deterministic-build-wrappers/clang-lto-link-osx new file mode 100755 index 0000000..ae566d1 --- /dev/null +++ b/deterministic-build-wrappers/clang-lto-link-osx @@ -0,0 +1,15 @@ +#!/bin/sh +# We want to use rustc's -C linker-plugin-lto, but it passes several arguments +# that are not understood by OSX clang/ld64.lld. Specifically, it passes +# -plugin-opt* arguments to set optimization levels, which are not supported. +# Thus, we intercept the call here, strip the unsupported arguments, and pass +# -flto and -O3. +args=("$@") +for ((i=0; i<"${#args[@]}"; ++i)); do + case ${args[i]} in + -Wl,-plugin-opt*) + args[i]="" + ;; + esac +done +$LDK_CLANG_PATH -flto -O3 -Wl,-O3 "${args[@]}"