Skip to content

Commit b568dee

Browse files
committed
---
yaml --- r: 3673 b: refs/heads/master c: 6d6c4c2 h: refs/heads/master i: 3671: 381cd8f v: v3
1 parent fb070a9 commit b568dee

File tree

8 files changed

+23
-21
lines changed

8 files changed

+23
-21
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 16f82dce1c1c2a9f42a1a5e2c4e3345f07ee5c2d
2+
refs/heads/master: 6d6c4c2a7699778cb641cf96f4b08f7fc4402840

trunk/mk/stage1.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ stage1/lib/$(CFG_STDLIB): $(STDLIB_CRATE) $(STDLIB_INPUTS) \
22
stage1/rustc$(X) stage0/lib/$(CFG_STDLIB) stage1/intrinsics.bc \
33
stage1/glue.o $(LREQ) $(MKFILES)
44
@$(call E, compile_and_link: $@)
5-
$(STAGE1) --shared -o $@ $<
5+
$(STAGE1) --lib -o $@ $<
66

77
stage1/lib/glue.o: stage1/rustc$(X) stage0/lib/$(CFG_STDLIB) \
88
stage1/intrinsics.bc $(LREQ) $(MKFILES)

trunk/mk/stage2.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ stage2/lib/$(CFG_STDLIB): $(STDLIB_CRATE) $(STDLIB_INPUTS) \
22
stage2/rustc$(X) stage1/lib/$(CFG_STDLIB) stage2/intrinsics.bc \
33
stage2/glue.o $(LREQ) $(MKFILES)
44
@$(call E, compile_and_link: $@)
5-
$(STAGE2) --shared -o $@ $<
5+
$(STAGE2) --lib -o $@ $<
66

77
stage2/lib/glue.o: stage2/rustc$(X) stage1/lib/$(CFG_STDLIB) \
88
stage2/intrinsics.bc rustllvm/$(CFG_RUSTLLVM) rt/$(CFG_RUNTIME)

trunk/mk/stage3.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ stage3/lib/$(CFG_STDLIB): $(STDLIB_CRATE) $(STDLIB_INPUTS) \
22
stage3/rustc$(X) stage2/lib/$(CFG_STDLIB) stage3/intrinsics.bc \
33
stage3/glue.o $(LREQ) $(MKFILES)
44
@$(call E, compile_and_link: $@)
5-
$(STAGE3) --shared -o $@ $<
5+
$(STAGE3) --lib -o $@ $<
66

77
stage3/lib/glue.o: stage3/rustc$(X) stage2/lib/$(CFG_STDLIB) \
88
stage3/intrinsics.bc rustllvm/$(CFG_RUSTLLVM) rt/$(CFG_RUNTIME)

trunk/src/comp/back/link.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ fn build_link_meta(&session::session sess, &ast::crate c,
348348
}
349349

350350
fn warn_missing(&session::session sess, str name, str default) {
351-
if (!sess.get_opts().shared) { ret; }
351+
if (!sess.get_opts().library) { ret; }
352352
sess.warn(#fmt("missing crate link meta '%s', using '%s' as default",
353353
name, default));
354354
}

trunk/src/comp/driver/rustc.rs

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,8 @@ options:
213213
214214
-o <filename> write output to <filename>
215215
--glue generate glue.bc file
216-
--shared compile a shared-library crate
216+
--lib compile a library crate
217+
--static use or produce static libraries
217218
--pretty [type] pretty-print the input instead of compiling
218219
--ls list the symbols defined by a crate file
219220
-L <path> add a directory to the library search path
@@ -281,7 +282,7 @@ fn build_target_config() -> @session::config {
281282

282283
fn build_session_options(str binary, getopts::match match, str binary_dir) ->
283284
@session::options {
284-
auto shared = opt_present(match, "shared");
285+
auto library = opt_present(match, "lib");
285286
auto library_search_paths = [binary_dir + "/lib"];
286287
library_search_paths += getopts::opt_strs(match, "L");
287288
auto output_type =
@@ -330,7 +331,7 @@ fn build_session_options(str binary, getopts::match match, str binary_dir) ->
330331
auto cfg = parse_cfgspecs(getopts::opt_strs(match, "cfg"));
331332
auto test = opt_present(match, "test");
332333
let @session::options sopts =
333-
@rec(shared=shared,
334+
@rec(library=library,
334335
optimize=opt_level,
335336
debuginfo=debuginfo,
336337
verify=verify,
@@ -369,11 +370,12 @@ fn main(vec[str] args) {
369370
[optflag("h"), optflag("help"), optflag("v"), optflag("version"),
370371
optflag("glue"), optflag("emit-llvm"), optflagopt("pretty"),
371372
optflag("ls"), optflag("parse-only"), optflag("O"),
372-
optopt("OptLevel"), optflag("shared"), optmulti("L"), optflag("S"),
373+
optopt("OptLevel"), optmulti("L"), optflag("S"),
373374
optflag("c"), optopt("o"), optflag("g"), optflag("save-temps"),
374375
optopt("sysroot"), optflag("stats"), optflag("time-passes"),
375376
optflag("time-llvm-passes"), optflag("no-typestate"),
376-
optflag("noverify"), optmulti("cfg"), optflag("test")];
377+
optflag("noverify"), optmulti("cfg"), optflag("test"),
378+
optflag("lib"), optflag("static")];
377379
auto binary = vec::shift[str](args);
378380
auto binary_dir = fs::dirname(binary);
379381
auto match =
@@ -455,7 +457,7 @@ fn main(vec[str] args) {
455457
auto temp_filename;
456458
alt (sopts.output_type) {
457459
case (link::output_type_exe) {
458-
// FIXME: what about shared?
460+
// FIXME: what about --lib?
459461

460462
temp_filename = ofile + ".o";
461463
}
@@ -479,13 +481,13 @@ fn main(vec[str] args) {
479481
let vec[str] gcc_args =
480482
[stage, "-Lrt", "-lrustrt", glu, "-m32", "-o",
481483
saved_out_filename, saved_out_filename + ".o"];
482-
auto shared_cmd;
484+
auto lib_cmd;
483485

484486
auto os = sess.get_targ_cfg().os;
485487
if (os == session::os_macos) {
486-
shared_cmd = "-dynamiclib";
488+
lib_cmd = "-dynamiclib";
487489
} else {
488-
shared_cmd = "-shared";
490+
lib_cmd = "-shared";
489491
}
490492

491493
// Converts a library file name into a gcc -l argument
@@ -527,8 +529,8 @@ fn main(vec[str] args) {
527529
gcc_args += ["-l" + l];
528530
}
529531

530-
if (sopts.shared) {
531-
gcc_args += [shared_cmd];
532+
if (sopts.library) {
533+
gcc_args += [lib_cmd];
532534
} else {
533535
// FIXME: why do we hardcode -lm?
534536
gcc_args += ["-lm", main];

trunk/src/comp/driver/session.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ type config =
2323
ty_mach float_type);
2424

2525
type options =
26-
rec(bool shared,
26+
rec(bool library,
2727
uint optimize,
2828
bool debuginfo,
2929
bool verify,

trunk/src/comp/middle/trans.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8701,7 +8701,7 @@ fn decl_fn_and_pair_full(&@crate_ctxt ccx, &span sp, &vec[str] path, str flav,
87018701
}
87028702
}
87038703
let bool is_main =
8704-
str::eq(vec::top(path), "main") && !ccx.sess.get_opts().shared;
8704+
str::eq(vec::top(path), "main") && !ccx.sess.get_opts().library;
87058705
// Declare the function itself.
87068706

87078707
let str s =
@@ -8745,7 +8745,7 @@ fn register_fn_pair(&@crate_ctxt cx, str ps, TypeRef llfnty, ValueRef llfn,
87458745
// FIXME: We should also hide the unexported pairs in crates.
87468746

87478747
auto gvar =
8748-
create_fn_pair(cx, ps, llfnty, llfn, cx.sess.get_opts().shared);
8748+
create_fn_pair(cx, ps, llfnty, llfn, cx.sess.get_opts().library);
87498749
cx.item_ids.insert(id, llfn);
87508750
cx.item_symbols.insert(id, ps);
87518751
cx.fn_pairs.insert(id, gvar);
@@ -9219,7 +9219,7 @@ fn create_crate_map(&@crate_ctxt ccx) -> ValueRef {
92199219
}
92209220
vec::push[ValueRef](subcrates, C_int(0));
92219221
auto mapname;
9222-
if (ccx.sess.get_opts().shared) {
9222+
if (ccx.sess.get_opts().library) {
92239223
mapname = ccx.link_meta.name;
92249224
} else { mapname = "toplevel"; }
92259225
auto sym_name = "_rust_crate_map_" + mapname;
@@ -9235,7 +9235,7 @@ fn create_crate_map(&@crate_ctxt ccx) -> ValueRef {
92359235
}
92369236

92379237
fn write_metadata(&@trans::crate_ctxt cx, &@ast::crate crate) {
9238-
if (!cx.sess.get_opts().shared) { ret; }
9238+
if (!cx.sess.get_opts().library) { ret; }
92399239
auto llmeta = C_postr(metadata::encoder::encode_metadata(cx, crate));
92409240
auto llconst = trans::C_struct([llmeta]);
92419241
auto llglobal =

0 commit comments

Comments
 (0)