Bug 1418598 - Make cargo-linker properly handle quoted strings in MOZ_CARGO_WRAP_LD and MOZ_CARGO_WRAP_LDFLAGS. r?build draft
authorMike Hommey <mh+mozilla@glandium.org>
Sat, 18 Nov 2017 20:24:12 +0900
changeset 700149 8ed0fd8bbaa098ffed549a48c8b57c803b589b57
parent 700148 d4753dc14b2ab9c42123b6d60a68106df40f45cd
child 740787 8b6a3c5c4c84b7bbd32b72734b804f60d3523e95
push id89742
push userbmo:mh+mozilla@glandium.org
push dateSat, 18 Nov 2017 11:25:34 +0000
reviewersbuild
bugs1418598
milestone59.0a1
Bug 1418598 - Make cargo-linker properly handle quoted strings in MOZ_CARGO_WRAP_LD and MOZ_CARGO_WRAP_LDFLAGS. r?build
build/cargo-linker
--- a/build/cargo-linker
+++ b/build/cargo-linker
@@ -11,10 +11,12 @@
 # we do *not* quote either MOZ_CARGO_WRAP variable:
 #
 # * MOZ_CARGO_WRAP_LD is equivalent to CC on Unix-y platforms, and CC
 #   frequently has additional arguments in addition to the compiler
 #   itself.
 # * MOZ_CARGO_WRAP_LDFLAGS contains space-separated arguments to pass,
 #   and not quoting it ensures that either of those arguments is passed
 #   as a separate argument to the actual LD.
+#
+# $@ is doubly quoted for the eval. See bug 1418598.
 
-${MOZ_CARGO_WRAP_LD} ${MOZ_CARGO_WRAP_LDFLAGS} "$@"
+eval ${MOZ_CARGO_WRAP_LD} ${MOZ_CARGO_WRAP_LDFLAGS} '"$@"'