From 6908e4e10df35a660c6adead67749c22b14998f9 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Mon, 28 Mar 2016 09:19:25 -0700 Subject: [PATCH] mk: Add `-C metadata` for compiling crates we ship This should re-enable all external builds of crates with the same name. Right now Cargo doesn't pass `-C metadata` for the top-level library being compiled, so if that library is called `libc`, for example, then it won't be able to link to the standard library which *also* has a `libc` library compiled without `-C metadata`. This can result in naming conflicts which need to be resolved. By passing `-C metadata` to the in-tree crates we ship it should add some extra salt to all symbol names to ensure that they don't collide. --- mk/target.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/mk/target.mk b/mk/target.mk index cdd8abd7fb7..261b9e79aa5 100644 --- a/mk/target.mk +++ b/mk/target.mk @@ -89,6 +89,7 @@ $$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$(4): \ $$(RUSTFLAGS$(1)_$(4)_T_$(2)) \ --out-dir $$(@D) \ -C extra-filename=-$$(CFG_FILENAME_EXTRA) \ + -C metadata=$$(CFG_FILENAME_EXTRA) \ $$< @touch -r $$@.start_time $$@ && rm $$@.start_time $$(call LIST_ALL_OLD_GLOB_MATCHES, \