From 636a849bf20105ba4c316c2cc44cca391cb11d84 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Tue, 19 Jun 2012 12:36:24 -0700 Subject: [PATCH] rustc: Add a temporary option to not link to the runtime --- src/rustc/back/link.rs | 6 ++++-- src/rustc/driver/session.rs | 8 ++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/rustc/back/link.rs b/src/rustc/back/link.rs index 4eccfa80247..facb0bcda31 100644 --- a/src/rustc/back/link.rs +++ b/src/rustc/back/link.rs @@ -631,8 +631,10 @@ fn link_binary(sess: session, } } - // Always want the runtime linked in - cc_args += ["-lrustrt"]; + if !sess.debugging_opt(session::no_rt) { + // Always want the runtime linked in + cc_args += ["-lrustrt"]; + } // On linux librt and libdl are an indirect dependencies via rustrt, // and binutils 2.22+ won't add them automatically diff --git a/src/rustc/driver/session.rs b/src/rustc/driver/session.rs index ef37c2bea51..def4c7d9a83 100644 --- a/src/rustc/driver/session.rs +++ b/src/rustc/driver/session.rs @@ -32,6 +32,9 @@ const stats: uint = 16u; const no_asm_comments: uint = 32u; const no_verify: uint = 64u; const trace: uint = 128u; +// FIXME: This exists to transition to a Rust crate runtime +// It should be removed +const no_rt: uint = 256u; fn debugging_opts_map() -> [(str, str, uint)] { [("ppregions", "prettyprint regions with \ @@ -43,7 +46,9 @@ fn debugging_opts_map() -> [(str, str, uint)] { ("stats", "gather trans statistics", stats), ("no-asm-comments", "omit comments when using -S", no_asm_comments), ("no-verify", "skip LLVM verification", no_verify), - ("trace", "emit trace logs", trace)] + ("trace", "emit trace logs", trace), + ("no-rt", "do not link to the runtime", no_rt) + ] } type options = @@ -64,7 +69,6 @@ type options = test: bool, parse_only: bool, no_trans: bool, - debugging_opts: uint, };