Skip to content

Commit c0cd60e

Browse files
committed
---
yaml --- r: 131579 b: refs/heads/dist-snap c: df4ea9c h: refs/heads/master i: 131577: 26a9acd 131575: 26d6ed3 v: v3
1 parent 0573400 commit c0cd60e

File tree

6 files changed

+20
-21
lines changed

6 files changed

+20
-21
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: 457a3c991d79b971be07fce75f9d0c12848fb37c
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/dist-snap: e44c2b9bbcb3ca7a7ca9e987b6727fd011f7b91a
9+
refs/heads/dist-snap: df4ea9c39a355e4cff425cca7d58e7758cb3461c
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/mk/main.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
CFG_RELEASE_NUM=0.11.0
1717
CFG_RELEASE_LABEL=
1818

19+
CFG_FILENAME_EXTRA=4e7c5e5c
20+
1921
ifndef CFG_ENABLE_NIGHTLY
2022
# This is the normal version string
2123
CFG_RELEASE=$(CFG_RELEASE_NUM)$(CFG_RELEASE_LABEL)

branches/dist-snap/mk/target.mk

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,13 @@ $(foreach host,$(CFG_HOST), \
4444
$(foreach crate,$(CRATES), \
4545
$(eval $(call RUST_CRATE_FULLDEPS,$(stage),$(target),$(host),$(crate)))))))
4646

47+
# NOTE: after a stage0 snap this should be just EXTRA_FILENAME, not with a stage
48+
# bound
49+
EXTRA_FILENAME_0 =
50+
EXTRA_FILENAME_1 = -C extra-filename=-$(CFG_FILENAME_EXTRA)
51+
EXTRA_FILENAME_2 = -C extra-filename=-$(CFG_FILENAME_EXTRA)
52+
EXTRA_FILENAME_3 = -C extra-filename=-$(CFG_FILENAME_EXTRA)
53+
4754
# RUST_TARGET_STAGE_N template: This defines how target artifacts are built
4855
# for all stage/target architecture combinations. This is one giant rule which
4956
# works as follows:
@@ -85,7 +92,9 @@ $$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$(4): \
8592
-L "$$(LLVM_LIBDIR_$(2))" \
8693
-L "$$(dir $$(LLVM_STDCPP_LOCATION_$(2)))" \
8794
$$(RUSTFLAGS_$(4)) \
88-
--out-dir $$(@D) $$<
95+
--out-dir $$(@D) \
96+
$$(EXTRA_FILENAME_$(1)) \
97+
$$<
8998
@touch $$@
9099
$$(call LIST_ALL_OLD_GLOB_MATCHES,\
91100
$$(dir $$@)$$(call CFG_LIB_GLOB_$(2),$(4)))

branches/dist-snap/src/librustc/back/link.rs

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -588,18 +588,6 @@ pub fn find_crate_name(sess: Option<&Session>,
588588
}), None)
589589
}
590590

591-
pub fn crate_name_hash(sess: &Session, crate_name: &str) -> String {
592-
// This calculates CMH as defined above. Note that we don't use the path of
593-
// the crate id in the hash because lookups are only done by (name/vers),
594-
// not by path.
595-
let mut s = Sha256::new();
596-
s.input_str(crate_name);
597-
for meta in sess.crate_metadata.borrow().iter() {
598-
s.input_str(meta.as_slice());
599-
}
600-
truncated_hash_result(&mut s).as_slice().slice_to(8).to_string()
601-
}
602-
603591
pub fn build_link_meta(krate: &ast::Crate, name: String) -> LinkMeta {
604592
let r = LinkMeta {
605593
crate_name: name,
@@ -880,7 +868,7 @@ pub fn filename_for_input(sess: &Session,
880868
crate_type: config::CrateType,
881869
name: &str,
882870
out_filename: &Path) -> Path {
883-
let libname = format!("{}-{}", name, crate_name_hash(sess, name));
871+
let libname = format!("{}{}", name, sess.opts.cg.extra_filename);
884872
match crate_type {
885873
config::CrateTypeRlib => {
886874
out_filename.with_filename(format!("lib{}.rlib", libname))

branches/dist-snap/src/librustc/driver/config.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,8 @@ cgoptions!(
320320
"choose the relocation model to use (llc -relocation-model for details)"),
321321
metadata: Vec<String> = (Vec::new(), parse_list,
322322
"metadata to mangle symbol names with"),
323+
extra_filename: String = ("".to_string(), parse_string,
324+
"extra data to put in each output filename"),
323325
)
324326

325327
pub fn build_codegen_options(matches: &getopts::Matches) -> CodegenOptions

branches/dist-snap/src/librustc/driver/driver.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -903,13 +903,11 @@ pub fn build_output_filenames(input: &Input,
903903
None => Path::new(".")
904904
};
905905

906-
let mut stem = input.filestem();
907-
908906
// If a crate name is present, we use it as the link name
909-
match attr::find_crate_name(attrs) {
910-
None => {}
911-
Some(name) => stem = name.get().to_string(),
912-
}
907+
let stem = match attr::find_crate_name(attrs) {
908+
None => input.filestem(),
909+
Some(name) => name.get().to_string(),
910+
};
913911
OutputFilenames {
914912
out_directory: dirpath,
915913
out_filestem: stem,

0 commit comments

Comments
 (0)