Skip to content

Commit 9fa4d50

Browse files
committed
---
yaml --- r: 3675 b: refs/heads/master c: 77c708c h: refs/heads/master i: 3673: b568dee 3671: 381cd8f v: v3
1 parent 199c8ab commit 9fa4d50

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

[refs]

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: b13527735e5977d544eff498469cda9d9c4511de
2+
refs/heads/master: 77c708cdbfbe150b33b38b0691f6ed74a7bb73cb

trunk/src/comp/driver/rustc.rs

+7-8
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,7 @@ fn build_target_config() -> @session::config {
283283
fn build_session_options(str binary, getopts::match match, str binary_dir) ->
284284
@session::options {
285285
auto library = opt_present(match, "lib");
286+
auto static = opt_present(match, "static");
286287
auto library_search_paths = [binary_dir + "/lib"];
287288
library_search_paths += getopts::opt_strs(match, "L");
288289
auto output_type =
@@ -332,6 +333,7 @@ fn build_session_options(str binary, getopts::match match, str binary_dir) ->
332333
auto test = opt_present(match, "test");
333334
let @session::options sopts =
334335
@rec(library=library,
336+
static=static,
335337
optimize=opt_level,
336338
debuginfo=debuginfo,
337339
verify=verify,
@@ -455,13 +457,10 @@ fn main(vec[str] args) {
455457

456458
saved_out_filename = ofile;
457459
auto temp_filename;
458-
alt (sopts.output_type) {
459-
case (link::output_type_exe) {
460-
// FIXME: what about --lib?
461-
462-
temp_filename = ofile + ".o";
463-
}
464-
case (_) { temp_filename = ofile; }
460+
if (sopts.output_type == link::output_type_exe && !sopts.static) {
461+
temp_filename = ofile + ".o";
462+
} else {
463+
temp_filename = ofile;
465464
}
466465
compile_input(sess, cfg, ifile, temp_filename);
467466
}
@@ -471,7 +470,7 @@ fn main(vec[str] args) {
471470
// gcc to link the object file with some libs
472471
//
473472
// TODO: Factor this out of main.
474-
if (sopts.output_type != link::output_type_exe) {
473+
if (sopts.output_type != link::output_type_exe || sopts.static) {
475474
ret;
476475
}
477476

trunk/src/comp/driver/session.rs

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ type config =
2424

2525
type options =
2626
rec(bool library,
27+
bool static,
2728
uint optimize,
2829
bool debuginfo,
2930
bool verify,

0 commit comments

Comments
 (0)