X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;ds=sidebyside;f=deterministic-build-wrappers%2Frustc;h=947c2345b86a1973f562c46c5be2e71d5bfeb42d;hb=HEAD;hp=6a18b572101a2c72119b6876db86440e05b0d5a6;hpb=e05f70891c1ee75306d62203ec61d272c18504c0;p=ldk-c-bindings diff --git a/deterministic-build-wrappers/rustc b/deterministic-build-wrappers/rustc index 6a18b57..7acc9c4 100755 --- a/deterministic-build-wrappers/rustc +++ b/deterministic-build-wrappers/rustc @@ -7,13 +7,21 @@ # ever (indirectly) depend on multiple versions of the same crate. args=("$@") IS_LIGHTNING=false +SKIP_EMBED_BITCODE=false for ((i=0; i<"${#args[@]}"; ++i)); do case ${args[i]} in --crate-name) - if [ "${args[i+1]}" = "lightning" -o "${args[i+1]}" = "lightning_background_processor" -o "${args[i+1]}" = "lightning_invoice" -o "${args[i+1]}" = "lightning_persister" ]; then + if [ "${args[i+1]}" = "lightning" -o "${args[i+1]}" = "lightning_background_processor" -o "${args[i+1]}" = "lightning_invoice" -o "${args[i+1]}" = "lightning_persister" -o "${args[i+1]}" = "lightning_rapid_gossip_sync" -o "${args[i+1]}" = "lightning_transaction_sync" -o "${args[i+1]}" = "ldk" ]; then IS_LIGHTNING=true fi ;; + --crate-type) + if [ "${args[i+1]}" = "proc-macro" ]; then + # If we're building a proc-macro, rustc incorrectly passes our RUSTFLAGS containing + # embed-bitcode=yes, which we don't want. + SKIP_EMBED_BITCODE=true + fi + ;; esac done for ((i=0; i<"${#args[@]}"; ++i)); do @@ -24,7 +32,16 @@ for ((i=0; i<"${#args[@]}"; ++i)); do args[i]="metadata=42" fi ;; + embed-bitcode=yes) + if [ "$SKIP_EMBED_BITCODE" = "true" ]; then + args[i]="embed-bitcode=no" + fi + ;; + lto) + if [ "$SKIP_EMBED_BITCODE" = "true" ]; then + args[i]="lto=no" + fi + ;; esac done - $LDK_RUSTC_PATH "${args[@]}"