# worry about the distribution of one file (with its native dynamic
# dependencies)
RUSTFLAGS_STAGE0 += -Z prefer-dynamic
-RUSTFLAGS_STAGE1 += -Z prefer-dynamic
+RUSTFLAGS_STAGE1 += -C prefer-dynamic
# platform-specific auto-configuration
include $(CFG_SRC_DIR)mk/platform.mk
\fB\-L\fR PATH
Add a directory to the library search path
.TP
-\fB\-\-linker\fR LINKER
-Program to use for linking instead of the default
-.TP
-\fB\-\-link-args\fR FLAGS
-A space-separated list of flags passed to the linker
-.TP
\fB\-\-ls\fR
List the symbols defined by a library crate
.TP
\fB\-\-no\-trans\fR
Run all passes except translation; no output
.TP
+\fB\-g\fR, \fB\-\-debuginfo\fR
+Emit DWARF debug information into object files generated.
+.TP
\fB\-O\fR
Equivalent to \fI\-\-opt\-level=2\fR
.TP
\fB\-\-opt\-level\fR LEVEL
Optimize with possible levels 0-3
.TP
-\fB\-\-passes\fR NAMES
-Comma- or space-separated list of optimization passes. Overrides
-the default passes for the optimization level. A value of 'list'
-will list the available passes.
-.TP
\fB\-\-out\-dir\fR DIR
Write output to compiler-chosen filename in <dir>. Ignored if -o is specified.
(default the current directory)
expanded, with type annotations), or identified (fully parenthesized,
AST nodes and blocks with IDs)
.TP
-\fB\-\-save\-temps\fR
-Write intermediate files (.bc, .opt.bc, .o) in addition to normal output
-.TP
\fB\-\-sysroot\fR PATH
Override the system root
.TP
http://sources.redhat.com/autobook/autobook/autobook_17.html
for details)
.TP
-\fB\-\-target-feature\fR TRIPLE
-Target-specific attributes (see llc -mattr=help for details)
-.TP
-\fB\-\-android-cross-path\fR PATH
-The path to the Android NDK
-.TP
\fB\-W\fR help
Print 'lint' options and default settings
.TP
\fB\-Z\fR FLAG
Set internal debugging options. Use "-Z help" to print available options.
.TP
+\fB\-C\fR FLAG[=VAL], \fB\-\-codegen\fR FLAG[=VAL]
+Set a codegen-related flag to the value specifie.d Use "-C help" to print
+available flags. See CODEGEN OPTIONS below
+.TP
\fB\-v\fR, \fB\-\-version\fR
Print version info and exit
+.SH CODEGEN OPTIONS
+
+.TP
+\fBar\fR=/path/to/ar
+Path to the archive utility to use when assembling archives.
+.TP
+\fBlinker\fR=/path/to/cc
+Path to the linker utility to use when linking libraries, executables, and
+objects.
+.TP
+\fBlink-args\fR='-flag1 -flag2'
+A space-separated list of extra arguments to pass to the linker when the linker
+is invoked.
+.TP
+\fBtarget-cpu\fR=help
+Selects a target processor. If the value is 'help', then a list of available
+cpus is printed.
+.TP
+\fBtarget-feature\fR='+feature1 -feature2'
+A space-separated list of features to enable or disable for the target. A
+preceding '+' enables a feature while a preceding '-' disables it. Available
+features can be discovered through target-cpu=help.
+.TP
+\fBpasses\fR=list
+A space-separated list of extra LLVM passes to run. A value of 'list' will
+cause rustc to print all known passes and exit. The passes specified are
+appended at the end of the normal pass manager.
+.TP
+\fBllvm-args\fR='-arg1 -arg2'
+A space-separted list of argument to pass through to LLVM.
+.TP
+\fBsave-temps\fR
+If specified, the compiler will save more files (.bc, .o, .no-opt.bc) generated
+throughout compilation in the output directory.
+.TP
+\fBandroid-cross-path\fR=path/to/ndk/bin
+Directory to find the Android NDK cross-compilation tools
+.TP
+\fBno-rpath\fR
+If specified, then the rpath value for dynamic libraries will not be set in
+either dynamic library or executable outputs.
+.TP
+\fBno-prepopulate-passes\fR
+Suppresses pre-population of the LLVM pass manager that is run over the module.
+.TP
+\fBno-vectorize-loops\fR
+Suppresses running the loop vectorization LLVM pass, regardless of optimization
+level.
+.TP
+\fBno-vectorize-slp\fR
+Suppresses running the LLVM SLP vectorization pass, regardless of optimization
+level.
+.TP
+\fBsoft-float\fR
+Generates software floating point library calls instead of hardware
+instructions.
+.TP
+\fBgen-crate-map\fR
+Forces generate of a toplevel crate map. May be required for logging to work
+when rust is embedded into another application.
+.TP
+\fBprefer-dynamic\fR
+Prefers dynamic linking to static linking.
+.TP
+\fBno-integrated-as\fR
+Force usage of an external assembler rather than LLVM's integrated one.
+
.SH "EXAMPLES"
To build an executable from a source file with a main function:
$ rustc -o hello hello.rs
To build either with a crate (.rs) file:
$ rustc hello.rs
-To build an executable with debug info (experimental):
- $ rustc -Z debug-info -o hello hello.rs
+To build an executable with debug info:
+ $ rustc -g -o hello hello.rs
.SH "SEE ALSO"
CFG_LDPATH_arm-linux-androideabi :=
CFG_RUN_arm-linux-androideabi=
CFG_RUN_TARG_arm-linux-androideabi=
-RUSTC_FLAGS_arm-linux-androideabi :=--android-cross-path=$(CFG_ANDROID_CROSS_PATH)
-RUSTC_CROSS_FLAGS_arm-linux-androideabi :=--android-cross-path=$(CFG_ANDROID_CROSS_PATH)
+RUSTC_FLAGS_arm-linux-androideabi :=-C android-cross-path=$(CFG_ANDROID_CROSS_PATH)
+RUSTC_CROSS_FLAGS_arm-linux-androideabi :=-C android-cross-path=$(CFG_ANDROID_CROSS_PATH)
# arm-unknown-linux-gnueabihf configuration
CROSS_PREFIX_arm-unknown-linux-gnueabihf=arm-linux-gnueabihf-
# There's no need our entire test suite to take up gigabytes of space on disk
# including copies of libstd/libextra all over the place
-CTEST_RUSTC_FLAGS := $$(CTEST_RUSTC_FLAGS) -Z prefer-dynamic
+CTEST_RUSTC_FLAGS := $$(CTEST_RUSTC_FLAGS) -C prefer-dynamic
# The tests can not be optimized while the rest of the compiler is optimized, so
# filter out the optimization (if any) from rustc and then figure out if we need
let args = split_maybe_args(&config.rustcflags);
let mut tool_path:~str = ~"";
for arg in args.iter() {
- if arg.contains("--android-cross-path=") {
- tool_path = arg.replace("--android-cross-path=","");
+ if arg.contains("android-cross-path=") {
+ tool_path = arg.replace("android-cross-path=","");
break;
}
}
let aux_dir = aux_output_dir_name(config, testfile);
// FIXME (#9639): This needs to handle non-utf8 paths
let link_args = ~[~"-L", aux_dir.as_str().unwrap().to_owned()];
- let llvm_args = ~[~"--emit=obj", ~"--crate-type=lib", ~"--save-temps"];
+ let llvm_args = ~[~"--emit=obj", ~"--crate-type=lib", ~"-C", ~"save-temps"];
let args = make_compile_args(config, props,
link_args + llvm_args,
|a, b| ThisFile(make_o_name(a, b)), testfile);
with the above limitations in dynamic and static libraries, it is required
for all upstream dependencies to be in the same format. The next question is
whether to prefer a dynamic or a static format. The compiler currently favors
- static linking over dynamic linking, but this can be inverted with the `-Z
+ static linking over dynamic linking, but this can be inverted with the `-C
prefer-dynamic` flag to the compiler.
What this means is that first the compiler will attempt to find all upstream
fn target_feature<'a>(sess: &'a Session) -> &'a str {
match sess.targ_cfg.os {
abi::OsAndroid => {
- if "" == sess.opts.target_feature {
+ if "" == sess.opts.cg.target_feature {
"+v7"
} else {
- sess.opts.target_feature.as_slice()
+ sess.opts.cg.target_feature.as_slice()
}
}
- _ => sess.opts.target_feature.as_slice()
+ _ => sess.opts.cg.target_feature.as_slice()
}
}
unsafe {
configure_llvm(sess);
- if sess.opts.save_temps {
+ if sess.opts.cg.save_temps {
output.with_extension("no-opt.bc").with_c_str(|buf| {
llvm::LLVMWriteBitcodeToFile(llmod, buf);
})
session::Default => lib::llvm::CodeGenLevelDefault,
session::Aggressive => lib::llvm::CodeGenLevelAggressive,
};
- let use_softfp = sess.opts.debugging_opts & session::USE_SOFTFP != 0;
+ let use_softfp = sess.opts.cg.soft_float;
// FIXME: #11906: Omitting frame pointers breaks retrieving the value of a parameter.
// FIXME: #11954: mac64 unwinding may not work with fp elim
sess.targ_cfg.arch == abi::X86_64);
let tm = sess.targ_cfg.target_strs.target_triple.with_c_str(|T| {
- sess.opts.target_cpu.with_c_str(|CPU| {
+ sess.opts.cg.target_cpu.with_c_str(|CPU| {
target_feature(&sess).with_c_str(|Features| {
llvm::LLVMRustCreateTargetMachine(
T, CPU, Features,
};
if !sess.no_verify() { assert!(addpass("verify")); }
- if !sess.no_prepopulate_passes() {
+ if !sess.opts.cg.no_prepopulate_passes {
llvm::LLVMRustAddAnalysisPasses(tm, fpm, llmod);
llvm::LLVMRustAddAnalysisPasses(tm, mpm, llmod);
populate_llvm_passes(fpm, mpm, llmod, OptLevel);
}
- for pass in sess.opts.custom_passes.iter() {
+ for pass in sess.opts.cg.passes.iter() {
pass.with_c_str(|s| {
if !llvm::LLVMRustAddPass(mpm, s) {
sess.warn(format!("unknown pass {}, ignoring", *pass));
// emitting an rlib. Whenever an rlib is created, the bytecode is
// inserted into the archive in order to allow LTO against it.
let crate_types = sess.crate_types.borrow();
- if sess.opts.save_temps ||
+ if sess.opts.cg.save_temps ||
(crate_types.get().contains(&session::CrateTypeRlib) &&
sess.opts.output_types.contains(&OutputTypeExe)) {
output.temp_path(OutputTypeBitcode).with_c_str(|buf| {
time(sess.time_passes(), "all lto passes", (), |()|
lto::run(sess, llmod, tm, trans.reachable));
- if sess.opts.save_temps {
+ if sess.opts.cg.save_temps {
output.with_extension("lto.bc").with_c_str(|buf| {
llvm::LLVMWriteBitcodeToFile(llmod, buf);
})
// Copy what clang does by turning on loop vectorization at O2 and
// slp vectorization at O3
- let vectorize_loop = !sess.no_vectorize_loops() &&
+ let vectorize_loop = !sess.opts.cg.no_vectorize_loops &&
(sess.opts.optimize == session::Default ||
sess.opts.optimize == session::Aggressive);
- let vectorize_slp = !sess.no_vectorize_slp() &&
+ let vectorize_slp = !sess.opts.cg.no_vectorize_slp &&
sess.opts.optimize == session::Aggressive;
let mut llvm_c_strs = ~[];
if sess.time_llvm_passes() { add("-time-passes"); }
if sess.print_llvm_passes() { add("-debug-pass=Structure"); }
- for arg in sess.opts.llvm_args.iter() {
+ for arg in sess.opts.cg.llvm_args.iter() {
add(*arg);
}
}
pub fn get_cc_prog(sess: Session) -> ~str {
- match sess.opts.linker {
+ match sess.opts.cg.linker {
Some(ref linker) => return linker.to_owned(),
None => {}
}
}
pub fn get_ar_prog(sess: Session) -> ~str {
- match sess.opts.ar {
+ match sess.opts.cg.ar {
Some(ref ar) => return ar.to_owned(),
None => {}
}
fn get_system_tool(sess: Session, tool: &str) -> ~str {
match sess.targ_cfg.os {
- abi::OsAndroid => match sess.opts.android_cross_path {
+ abi::OsAndroid => match sess.opts.cg.android_cross_path {
Some(ref path) => {
let tool_str = match tool {
"cc" => "gcc",
}
None => {
sess.fatal(format!("need Android NDK path for the '{}' tool \
- (--android-cross-path)", tool))
+ (-C android-cross-path)", tool))
}
},
_ => tool.to_owned(),
}
// Remove the temporary object file and metadata if we aren't saving temps
- if !sess.opts.save_temps {
+ if !sess.opts.cg.save_temps {
let obj_filename = outputs.temp_path(OutputTypeObject);
if !sess.opts.output_types.contains(&OutputTypeObject) {
remove(sess, &obj_filename);
// into the archive.
let bc = obj_filename.with_extension("bc");
a.add_file(&bc, false);
- if !sess.opts.save_temps &&
+ if !sess.opts.cg.save_temps &&
!sess.opts.output_types.contains(&OutputTypeBitcode) {
remove(sess, &bc);
}
args.push(~"-dynamiclib");
args.push(~"-Wl,-dylib");
// FIXME (#9639): This needs to handle non-utf8 paths
- if !sess.opts.no_rpath {
+ if !sess.opts.cg.no_rpath {
args.push(~"-Wl,-install_name,@rpath/" +
out_filename.filename_str().unwrap());
}
// FIXME (#2397): At some point we want to rpath our guesses as to
// where extern libraries might live, based on the
// addl_lib_search_paths
- if !sess.opts.no_rpath {
+ if !sess.opts.cg.no_rpath {
args.push_all(rpath::get_rpath_flags(sess, out_filename));
}
// Finally add all the linker arguments provided on the command line along
// with any #[link_args] attributes found inside the crate
- args.push_all(sess.opts.linker_args);
+ args.push_all(sess.opts.cg.link_args);
let used_link_args = sess.cstore.get_used_link_args();
let used_link_args = used_link_args.borrow();
for arg in used_link_args.get().iter() {
}
let cstore = sess.cstore;
- if !dylib && !sess.prefer_dynamic() {
+ if !dylib && !sess.opts.cg.prefer_dynamic {
// With an executable, things get a little interesting. As a limitation
// of the current implementation, we require that everything must be
// static or everything must be dynamic. The reasons for this are a
pub fn run(sess: session::Session, llmod: ModuleRef,
tm: TargetMachineRef, reachable: &[~str]) {
- if sess.prefer_dynamic() {
+ if sess.opts.cg.prefer_dynamic {
sess.err("cannot prefer dynamic linking when performing LTO");
sess.note("only 'staticlib' and 'bin' outputs are supported with LTO");
sess.abort_if_errors();
pub fn phase_5_run_llvm_passes(sess: Session,
trans: &CrateTranslation,
outputs: &OutputFilenames) {
- if sess.no_integrated_as() {
+ if sess.opts.cg.no_integrated_as {
let output_type = link::OutputTypeAssembly;
time(sess.time_passes(), "LLVM passes", (), |_|
link::write::run_assembler(sess, outputs);
// Remove assembly source, unless --save-temps was specified
- if !sess.opts.save_temps {
+ if !sess.opts.cg.save_temps {
fs::unlink(&outputs.temp_path(link::OutputTypeAssembly)).unwrap();
}
} else {
let parse_only = matches.opt_present("parse-only");
let no_trans = matches.opt_present("no-trans");
let no_analysis = matches.opt_present("no-analysis");
- let no_rpath = matches.opt_present("no-rpath");
let lint_levels = [lint::allow, lint::warn,
lint::deny, lint::forbid];
let sysroot_opt = matches.opt_str("sysroot").map(|m| @Path::new(m));
let target = matches.opt_str("target").unwrap_or(host_triple());
- let target_cpu = matches.opt_str("target-cpu").unwrap_or(~"generic");
- let target_feature = matches.opt_str("target-feature").unwrap_or(~"");
- let save_temps = matches.opt_present("save-temps");
let opt_level = {
if (debugging_opts & session::NO_OPT) != 0 {
No
} else { No }
};
let gc = debugging_opts & session::GC != 0;
- let extra_debuginfo = debugging_opts & session::EXTRA_DEBUG_INFO != 0;
- let debuginfo = debugging_opts & session::DEBUG_INFO != 0 ||
- extra_debuginfo;
+ let debuginfo = matches.opt_present("g") || matches.opt_present("debuginfo");
let addl_lib_search_paths = matches.opt_strs("L").map(|s| {
Path::new(s.as_slice())
}).move_iter().collect();
- let ar = matches.opt_str("ar");
- let linker = matches.opt_str("linker");
- let linker_args = matches.opt_strs("link-args").flat_map( |a| {
- a.split(' ').filter_map(|arg| {
- if arg.is_empty() {
- None
- } else {
- Some(arg.to_owned())
- }
- }).collect()
- });
let cfg = parse_cfgspecs(matches.opt_strs("cfg"));
let test = matches.opt_present("test");
- let android_cross_path = matches.opt_str("android-cross-path");
let write_dependency_info = (matches.opt_present("dep-info"),
matches.opt_str("dep-info").map(|p| Path::new(p)));
- let custom_passes = match matches.opt_str("passes") {
- None => ~[],
- Some(s) => {
- s.split(|c: char| c == ' ' || c == ',').map(|s| {
- s.trim().to_owned()
- }).collect()
- }
- };
- let llvm_args = match matches.opt_str("llvm-args") {
- None => ~[],
- Some(s) => {
- s.split(|c: char| c == ' ' || c == ',').map(|s| {
- s.trim().to_owned()
- }).collect()
- }
- };
let print_metas = (matches.opt_present("crate-id"),
matches.opt_present("crate-name"),
matches.opt_present("crate-file-name"));
+ let cg = build_codegen_options(matches);
let sopts = @session::Options {
crate_types: crate_types,
gc: gc,
optimize: opt_level,
- custom_passes: custom_passes,
- llvm_args: llvm_args,
debuginfo: debuginfo,
- extra_debuginfo: extra_debuginfo,
lint_opts: lint_opts,
- save_temps: save_temps,
output_types: output_types,
addl_lib_search_paths: @RefCell::new(addl_lib_search_paths),
- ar: ar,
- linker: linker,
- linker_args: linker_args,
maybe_sysroot: sysroot_opt,
target_triple: target,
- target_cpu: target_cpu,
- target_feature: target_feature,
cfg: cfg,
binary: binary,
test: test,
parse_only: parse_only,
no_trans: no_trans,
no_analysis: no_analysis,
- no_rpath: no_rpath,
debugging_opts: debugging_opts,
- android_cross_path: android_cross_path,
write_dependency_info: write_dependency_info,
print_metas: print_metas,
+ cg: cg,
};
return sopts;
}
+pub fn build_codegen_options(matches: &getopts::Matches)
+ -> session::CodegenOptions
+{
+ let mut cg = session::basic_codegen_options();
+ for option in matches.opt_strs("C").move_iter() {
+ let mut iter = option.splitn('=', 1);
+ let key = iter.next().unwrap();
+ let value = iter.next();
+ let option_to_lookup = key.replace("-", "_");
+ let mut found = false;
+ for &(candidate, setter, _) in session::CG_OPTIONS.iter() {
+ if option_to_lookup.as_slice() != candidate { continue }
+ if !setter(&mut cg, value) {
+ match value {
+ Some(..) => early_error(format!("codegen option `{}` takes \
+ no value", key)),
+ None => early_error(format!("codegen option `{0}` requires \
+ a value (-C {0}=<value>)",
+ key))
+ }
+ }
+ found = true;
+ break;
+ }
+ if !found {
+ early_error(format!("unknown codegen option: `{}`", key));
+ }
+ }
+ return cg;
+}
+
pub fn build_session(sopts: @session::Options,
local_crate_source_file: Option<Path>)
-> Session {
optmulti("", "emit", "Comma separated list of types of output for the compiler
to emit",
"[asm|bc|ir|obj|link]"),
- optopt("", "linker", "Program to use for linking instead of the default.", "LINKER"),
- optopt("", "ar", "Program to use for managing archives instead of the default.", "AR"),
optflag("", "crate-id", "Output the crate id and exit"),
optflag("", "crate-name", "Output the crate name and exit"),
optflag("", "crate-file-name", "Output the file(s) that would be written if compilation \
continued and exit"),
- optmulti("", "link-args", "FLAGS is a space-separated list of flags
- passed to the linker", "FLAGS"),
optflag("", "ls", "List the symbols defined by a library crate"),
+ optflag("g", "debuginfo", "Emit DWARF debug info to the objects created"),
optflag("", "no-trans",
"Run all passes except translation; no output"),
optflag("", "no-analysis",
optopt("o", "", "Write output to <filename>", "FILENAME"),
optopt("", "opt-level",
"Optimize with possible levels 0-3", "LEVEL"),
- optopt("", "passes", "Comma or space separated list of pass names to use. \
- Appends to the default list of passes to run for the \
- specified current optimization level. A value of \
- \"list\" will list all of the available passes", "NAMES"),
- optopt("", "llvm-args", "A list of arguments to pass to llvm, comma \
- separated", "ARGS"),
- optflag("", "no-rpath", "Disables setting the rpath in libs/exes"),
optopt( "", "out-dir",
"Write output to compiler-chosen filename
in <dir>", "DIR"),
AST nodes and blocks with IDs)", "TYPE"),
optflagopt("", "dep-info",
"Output dependency info to <filename> after compiling", "FILENAME"),
- optflag("", "save-temps",
- "Write intermediate files (.bc, .opt.bc, .o)
- in addition to normal output"),
optopt("", "sysroot",
"Override the system root", "PATH"),
optflag("", "test", "Build a test harness"),
"Target triple cpu-manufacturer-kernel[-os]
to compile for (see chapter 3.4 of http://www.sourceware.org/autobook/
for details)", "TRIPLE"),
- optopt("", "target-cpu",
- "Select target processor (llc -mcpu=help
- for details)", "CPU"),
- optopt("", "target-feature",
- "Target specific attributes (llc -mattr=help
- for details)", "FEATURE"),
- optopt("", "android-cross-path",
- "The path to the Android NDK", "PATH"),
optmulti("W", "warn",
"Set lint warnings", "OPT"),
optmulti("A", "allow",
"Set lint denied", "OPT"),
optmulti("F", "forbid",
"Set lint forbidden", "OPT"),
+ optmulti("C", "codegen",
+ "Set a codegen option", "OPT[=VALUE]"),
optmulti("Z", "", "Set internal debugging options", "FLAG"),
optflag( "v", "version",
"Print version info and exit"),
META_STATS,
NO_OPT,
GC,
- DEBUG_INFO,
- EXTRA_DEBUG_INFO,
PRINT_LINK_ARGS,
PRINT_LLVM_PASSES,
- NO_VECTORIZE_LOOPS,
- NO_VECTORIZE_SLP,
- NO_PREPOPULATE_PASSES,
- USE_SOFTFP,
- GEN_CRATE_MAP,
- PREFER_DYNAMIC,
- NO_INTEGRATED_AS,
LTO
]
0
("print-link-args", "Print the arguments passed to the linker",
PRINT_LINK_ARGS),
("gc", "Garbage collect shared data (experimental)", GC),
- ("extra-debug-info", "Extra debugging info (experimental)",
- EXTRA_DEBUG_INFO),
- ("debug-info", "Produce debug info (experimental)", DEBUG_INFO),
("print-llvm-passes",
"Prints the llvm optimization passes being run",
PRINT_LLVM_PASSES),
- ("no-prepopulate-passes",
- "Don't pre-populate the pass managers with a list of passes, only use \
- the passes from --passes",
- NO_PREPOPULATE_PASSES),
- ("no-vectorize-loops",
- "Don't run the loop vectorization optimization passes",
- NO_VECTORIZE_LOOPS),
- ("no-vectorize-slp", "Don't run LLVM's SLP vectorization passes",
- NO_VECTORIZE_SLP),
- ("soft-float", "Generate software floating point library calls", USE_SOFTFP),
- ("gen-crate-map", "Force generation of a toplevel crate map", GEN_CRATE_MAP),
- ("prefer-dynamic", "Prefer dynamic linking to static linking", PREFER_DYNAMIC),
- ("no-integrated-as",
- "Use external assembler rather than LLVM's integrated one", NO_INTEGRATED_AS),
("lto", "Perform LLVM link-time optimizations", LTO),
]
}
gc: bool,
optimize: OptLevel,
- custom_passes: ~[~str],
- llvm_args: ~[~str],
debuginfo: bool,
- extra_debuginfo: bool,
lint_opts: ~[(lint::Lint, lint::level)],
- save_temps: bool,
output_types: ~[back::link::OutputType],
// This was mutable for rustpkg, which updates search paths based on the
// parsed code. It remains mutable in case its replacements wants to use
// this.
addl_lib_search_paths: @RefCell<HashSet<Path>>,
- ar: Option<~str>,
- linker: Option<~str>,
- linker_args: ~[~str],
maybe_sysroot: Option<@Path>,
target_triple: ~str,
- target_cpu: ~str,
- target_feature: ~str,
// User-specified cfg meta items. The compiler itself will add additional
// items to the crate config, and during parsing the entire crate config
// will be added to the crate AST node. This should not be used for
parse_only: bool,
no_trans: bool,
no_analysis: bool,
- no_rpath: bool,
debugging_opts: u64,
- android_cross_path: Option<~str>,
/// Whether to write dependency files. It's (enabled, optional filename).
write_dependency_info: (bool, Option<Path>),
/// Crate id-related things to maybe print. It's (crate_id, crate_name, crate_file_name).
print_metas: (bool, bool, bool),
+ cg: CodegenOptions,
}
// The type of entry function, so
pub fn print_llvm_passes(&self) -> bool {
self.debugging_opt(PRINT_LLVM_PASSES)
}
- pub fn no_prepopulate_passes(&self) -> bool {
- self.debugging_opt(NO_PREPOPULATE_PASSES)
- }
- pub fn no_vectorize_loops(&self) -> bool {
- self.debugging_opt(NO_VECTORIZE_LOOPS)
- }
- pub fn no_vectorize_slp(&self) -> bool {
- self.debugging_opt(NO_VECTORIZE_SLP)
- }
- pub fn gen_crate_map(&self) -> bool {
- self.debugging_opt(GEN_CRATE_MAP)
- }
- pub fn prefer_dynamic(&self) -> bool {
- self.debugging_opt(PREFER_DYNAMIC)
- }
- pub fn no_integrated_as(&self) -> bool {
- self.debugging_opt(NO_INTEGRATED_AS)
- }
pub fn lto(&self) -> bool {
self.debugging_opt(LTO)
}
crate_types: ~[],
gc: false,
optimize: No,
- custom_passes: ~[],
- llvm_args: ~[],
debuginfo: false,
- extra_debuginfo: false,
lint_opts: ~[],
- save_temps: false,
output_types: ~[],
addl_lib_search_paths: @RefCell::new(HashSet::new()),
- ar: None,
- linker: None,
- linker_args: ~[],
maybe_sysroot: None,
target_triple: host_triple(),
- target_cpu: ~"generic",
- target_feature: ~"",
cfg: ~[],
binary: ~"rustc",
test: false,
parse_only: false,
no_trans: false,
no_analysis: false,
- no_rpath: false,
debugging_opts: 0,
- android_cross_path: None,
write_dependency_info: (false, None),
print_metas: (false, false, false),
+ cg: basic_codegen_options(),
}
}
+/// Declare a macro that will define all CodegenOptions fields and parsers all
+/// at once. The goal of this macro is to define an interface that can be
+/// programmatically used by the option parser in order to initialize the struct
+/// without hardcoding field names all over the place.
+///
+/// The goal is to invoke this macro once with the correct fields, and then this
+/// macro generates all necessary code. The main gotcha of this macro is the
+/// cgsetters module which is a bunch of generated code to parse an option into
+/// its respective field in the struct. There are a few hand-written parsers for
+/// parsing specific types of values in this module.
+macro_rules! cgoptions(
+ ($($opt:ident : $t:ty = ($init:expr, $parse:ident, $desc:expr)),* ,) =>
+(
+ #[deriving(Clone)]
+ pub struct CodegenOptions { $($opt: $t),* }
+
+ pub fn basic_codegen_options() -> CodegenOptions {
+ CodegenOptions { $($opt: $init),* }
+ }
+
+ pub type CodegenSetter = fn(&mut CodegenOptions, v: Option<&str>) -> bool;
+ pub static CG_OPTIONS: &'static [(&'static str, CodegenSetter,
+ &'static str)] =
+ &[ $( (stringify!($opt), cgsetters::$opt, $desc) ),* ];
+
+ mod cgsetters {
+ use super::CodegenOptions;
+
+ $(
+ pub fn $opt(cg: &mut CodegenOptions, v: Option<&str>) -> bool {
+ $parse(&mut cg.$opt, v)
+ }
+ )*
+
+ fn parse_bool(slot: &mut bool, v: Option<&str>) -> bool {
+ match v {
+ Some(..) => false,
+ None => { *slot = true; true }
+ }
+ }
+
+ fn parse_opt_string(slot: &mut Option<~str>, v: Option<&str>) -> bool {
+ match v {
+ Some(s) => { *slot = Some(s.to_owned()); true },
+ None => false,
+ }
+ }
+
+ fn parse_string(slot: &mut ~str, v: Option<&str>) -> bool {
+ match v {
+ Some(s) => { *slot = s.to_owned(); true },
+ None => false,
+ }
+ }
+
+ fn parse_list(slot: &mut ~[~str], v: Option<&str>) -> bool {
+ match v {
+ Some(s) => {
+ for s in s.words() {
+ slot.push(s.to_owned());
+ }
+ true
+ },
+ None => false,
+ }
+ }
+
+ }
+) )
+
+cgoptions!(
+ ar: Option<~str> = (None, parse_opt_string,
+ "tool to assemble archives with"),
+ linker: Option<~str> = (None, parse_opt_string,
+ "system linker to link outputs with"),
+ link_args: ~[~str] = (~[], parse_list,
+ "extra arguments to pass to the linker (space separated)"),
+ target_cpu: ~str = (~"generic", parse_string,
+ "select target processor (llc -mcpu=help for details)"),
+ target_feature: ~str = (~"", parse_string,
+ "target specific attributes (llc -mattr=help for details)"),
+ passes: ~[~str] = (~[], parse_list,
+ "a list of extra LLVM passes to run (space separated)"),
+ llvm_args: ~[~str] = (~[], parse_list,
+ "a list of arguments to pass to llvm (space separated)"),
+ save_temps: bool = (false, parse_bool,
+ "save all temporary output files during compilation"),
+ android_cross_path: Option<~str> = (None, parse_opt_string,
+ "the path to the Android NDK"),
+ no_rpath: bool = (false, parse_bool,
+ "disables setting the rpath in libs/exes"),
+ no_prepopulate_passes: bool = (false, parse_bool,
+ "don't pre-populate the pass manager with a list of passes"),
+ no_vectorize_loops: bool = (false, parse_bool,
+ "don't run the loop vectorization optimization passes"),
+ no_vectorize_slp: bool = (false, parse_bool,
+ "don't run LLVM's SLP vectorization pass"),
+ soft_float: bool = (false, parse_bool,
+ "generate software floating point library calls"),
+ gen_crate_map: bool = (false, parse_bool,
+ "force generation of a toplevel crate map"),
+ prefer_dynamic: bool = (false, parse_bool,
+ "prefer dynamic linking to static linking"),
+ no_integrated_as: bool = (false, parse_bool,
+ "use an external assembler rather than LLVM's integrated one"),
+)
+
// Seems out of place, but it uses session, so I'm putting it here
pub fn expect<T:Clone>(sess: Session, opt: Option<T>, msg: || -> ~str) -> T {
diagnostic::expect(sess.diagnostic(), opt, msg)
fn padded(max: uint, s: &str) -> ~str {
" ".repeat(max - s.len()) + s
}
- println!("{}", "\nAvailable lint checks:\n"); // FIXME: #9970
+ println!("\nAvailable lint checks:\n");
println!(" {} {:7.7s} {}",
padded(max_key, "name"), "default", "meaning");
println!(" {} {:7.7s} {}\n",
}
pub fn describe_debug_flags() {
- println!("{}", "\nAvailable debug options:\n"); // FIXME: #9970
+ println!("\nAvailable debug options:\n");
let r = session::debugging_opts_map();
for tuple in r.iter() {
match *tuple {
}
}
+pub fn describe_codegen_flags() {
+ println!("\nAvailable codegen options:\n");
+ let mut cg = session::basic_codegen_options();
+ for &(name, parser, desc) in session::CG_OPTIONS.iter() {
+ // we invoke the parser function on `None` to see if this option needs
+ // an argument or not.
+ let (width, extra) = if parser(&mut cg, None) {
+ (25, "")
+ } else {
+ (21, "=val")
+ };
+ println!(" -C {:>width$s}{} -- {}", name.replace("_", "-"),
+ extra, desc, width=width);
+ }
+}
+
pub fn run_compiler(args: &[~str]) {
let mut args = args.to_owned();
let binary = args.shift().unwrap();
return;
}
- if matches.opt_str("passes") == Some(~"list") {
+ let cg_flags = matches.opt_strs("C");
+ if cg_flags.iter().any(|x| x == &~"help") {
+ describe_codegen_flags();
+ return;
+ }
+
+ if cg_flags.contains(&~"passes=list") {
unsafe { lib::llvm::llvm::LLVMRustPrintPasses(); }
return;
}
llmap.get().insert(binding_info.id, datum);
}
- if bcx.sess().opts.extra_debuginfo {
+ if bcx.sess().opts.debuginfo {
debuginfo::create_match_binding_metadata(bcx,
ident,
binding_info.id,
// like `x: T`
let arg_ty = node_id_type(bcx, pat.id);
if type_of::arg_is_indirect(bcx.ccx(), arg_ty)
- && !bcx.ccx().sess.opts.extra_debuginfo {
+ && !bcx.ccx().sess.opts.debuginfo {
// Don't copy an indirect argument to an alloca, the caller
// already put it in a temporary alloca and gave it up, unless
// we emit extra-debug-info, which requires local allocas :(.
// Structural comparison: a rather involved form of glue.
pub fn maybe_name_value(cx: &CrateContext, v: ValueRef, s: &str) {
- if cx.sess.opts.save_temps {
+ if cx.sess.opts.cg.save_temps {
s.with_c_str(|buf| {
unsafe {
llvm::LLVMSetValueName(v, buf)
bcx = _match::store_arg(bcx, args[i].pat, arg_datum, arg_scope_id);
- if fcx.ccx.sess.opts.extra_debuginfo {
+ if fcx.ccx.sess.opts.debuginfo {
debuginfo::create_argument_metadata(bcx, &args[i]);
}
}
let mut n_subcrates = 1;
let cstore = sess.cstore;
while cstore.have_crate_data(n_subcrates) { n_subcrates += 1; }
- let is_top = !sess.building_library.get() || sess.gen_crate_map();
+ let is_top = !sess.building_library.get() || sess.opts.cg.gen_crate_map;
let sym_name = if is_top {
~"_rust_crate_map_toplevel"
} else {
// Store the pointer to closure data in an alloca for debug info because that's what the
// llvm.dbg.declare intrinsic expects
- let env_pointer_alloca = if bcx.ccx().sess.opts.extra_debuginfo {
+ let env_pointer_alloca = if bcx.ccx().sess.opts.debuginfo {
let alloc = alloc_ty(bcx, ty::mk_mut_ptr(bcx.tcx(), cdata_ty), "__debuginfo_env_ptr");
Store(bcx, llcdata, alloc);
Some(alloc)
let tn = TypeNames::new();
let mut intrinsics = base::declare_intrinsics(llmod);
- if sess.opts.extra_debuginfo {
+ if sess.opts.debuginfo {
base::declare_dbg_intrinsics(llmod, &mut intrinsics);
}
let int_type = Type::int(targ_cfg.arch);
match d.node {
ast::DeclLocal(ref local) => {
bcx = init_local(bcx, *local);
- if cx.sess().opts.extra_debuginfo {
+ if cx.sess().opts.debuginfo {
debuginfo::create_local_var_metadata(bcx, *local);
}
}
fn_decl: &ast::FnDecl,
param_substs: Option<@param_substs>,
error_span: Span) -> DIArray {
- if !cx.sess.opts.extra_debuginfo {
+ if !cx.sess.opts.debuginfo {
return create_DIArray(DIB(cx), []);
}
name_to_append_suffix_to.push_str(",");
}
- // Only create type information if extra_debuginfo is enabled
- if cx.sess.opts.extra_debuginfo {
+ // Only create type information if debuginfo is enabled
+ if cx.sess.opts.debuginfo {
let actual_self_type_metadata = type_metadata(cx,
actual_self_type,
codemap::DUMMY_SP);
name_to_append_suffix_to.push_str(",");
}
- // Again, only create type information if extra_debuginfo is enabled
- if cx.sess.opts.extra_debuginfo {
+ // Again, only create type information if debuginfo is enabled
+ if cx.sess.opts.debuginfo {
let actual_type_metadata = type_metadata(cx, actual_type, codemap::DUMMY_SP);
let param_metadata_string = token::get_ident(ident.name);
let param_metadata = param_metadata_string.get()
maybe_sysroot: Some(@os::self_exe_path().unwrap().dir_path()),
addl_lib_search_paths: @RefCell::new(libs),
crate_types: ~[session::CrateTypeExecutable],
- debugging_opts: session::PREFER_DYNAMIC,
output_types: ~[link::OutputTypeExe],
+ cg: session::CodegenOptions {
+ prefer_dynamic: true,
+ .. session::basic_codegen_options()
+ },
.. (*session::basic_options()).clone()
};
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// compile-flags: --linker=llllll
+// compile-flags: -C linker=llllll
// error-pattern: the linker `llllll`
fn main() {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// compile-flags: -Z lto -Z prefer-dynamic
+// compile-flags: -Z lto -C prefer-dynamic
// error-pattern: cannot prefer dynamic linking
// xfail-android: FIXME(#10381)
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:rbreak zzz
// debugger:run
// debugger:finish
// xfail-android: FIXME(#10381)
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:rbreak zzz
// debugger:run
// debugger:finish
// Gdb doesn't know about UTF-32 character encoding and will print a rust char as only
// its numerical value.
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:rbreak zzz
// debugger:run
// debugger:finish
// xfail-android: FIXME(#10381)
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:rbreak zzz
// debugger:run
// debugger:finish
// xfail-android: FIXME(#10381)
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:rbreak zzz
// debugger:run
// debugger:finish
// Gdb doesn't know about UTF-32 character encoding and will print a rust char as only
// its numerical value.
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:rbreak zzz
// debugger:run
// debugger:finish
// xfail-android: FIXME(#10381)
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:rbreak zzz
// debugger:run
// debugger:finish
#[feature(managed_boxes)];
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:rbreak zzz
// debugger:run
// debugger:finish
// Gdb doesn't know about UTF-32 character encoding and will print a rust char as only
// its numerical value.
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:rbreak zzz
// debugger:run
// debugger:finish
// xfail-android: FIXME(#10381)
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:set print pretty off
// debugger:rbreak zzz
// debugger:run
// xfail-android: FIXME(#10381)
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:rbreak zzz
// debugger:run
// debugger:finish
#[feature(managed_boxes)];
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:rbreak zzz
// debugger:run
// debugger:finish
// xfail-android: FIXME(#10381)
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:rbreak zzz
// debugger:run
#[feature(managed_boxes)];
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:rbreak zzz
// debugger:run
// xfail-android: FIXME(#10381)
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:rbreak zzz
// debugger:run
// debugger:finish
// xfail-android: FIXME(#10381)
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:rbreak zzz
// debugger:run
// debugger:finish
// xfail-android: FIXME(#10381)
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:rbreak zzz
// debugger:run
// xfail-android: FIXME(#10381)
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:rbreak zzz
// debugger:run
// xfail-android: FIXME(#10381)
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:rbreak zzz
// debugger:run
// debugger:finish
// xfail-android: FIXME(#10381)
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:set print pretty off
// debugger:rbreak zzz
// debugger:run
// before the arguments have been properly loaded when setting the breakpoint via the function name.
// Therefore the setup here sets them using line numbers (so be careful when changing this file).
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:set print pretty off
// debugger:break function-arg-initialization.rs:139
// debugger:break function-arg-initialization.rs:154
// xfail-android: FIXME(#10381)
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:rbreak zzz
// debugger:run
// debugger:finish
// consequence, and as opposed to regular Rust functions, we can set the breakpoints via the
// function name (and don't have to fall back on using line numbers).
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:set print pretty off
// debugger:rbreak immediate_args
// debugger:rbreak binding
// xfail-android: FIXME(#10381)
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:rbreak zzz
// debugger:run
// xfail-android: FIXME(#10381)
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:rbreak zzz
// debugger:run
// xfail-android: FIXME(#10381)
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:rbreak zzz
// debugger:run
// xfail-android: FIXME(#10381)
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:rbreak zzz
// debugger:run
// xfail-tidy-linelength
// xfail-android: FIXME(#10381)
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:set print union on
// debugger:rbreak zzz
// debugger:run
// xfail-android: FIXME(#10381)
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:rbreak zzz
// debugger:run
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:rbreak zzz
// debugger:run
// xfail-tidy-linelength
// xfail-android: FIXME(#10381)
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:set print union on
// debugger:rbreak zzz
// debugger:run
// xfail-android: FIXME(#10381)
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:rbreak zzz
// debugger:run
// debugger:finish
// This test case checks whether compile unit names are set correctly, so that the correct default
// source file can be found.
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:list
// check:1[...]fn main() {
// check:2[...]let args : ~[~str] = ::std::os::args();
// xfail-win32
// xfail-android: FIXME(#10381)
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:rbreak zzz
// debugger:run
// xfail-win32
// xfail-android: FIXME(#10381)
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:rbreak zzz
// debugger:run
// xfail-win32
// xfail-android: FIXME(#10381)
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:rbreak zzz
// debugger:run
// xfail-android: FIXME(#10381)
-// compile-flags:-Z debug-info
+// compile-flags:-g
// debugger:run
// Nothing to do here really, just make sure it compiles. See issue #8513.
// xfail-android: FIXME(#10381)
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:rbreak zzz
// debugger:run
// xfail-android: FIXME(#10381)
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:rbreak zzz
// debugger:run
// xfail-android: FIXME(#10381)
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:rbreak zzz
// debugger:run
// xfail-android: FIXME(#10381)
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:rbreak zzz
// debugger:run
// xfail-android: FIXME(#10381)
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:rbreak zzz
// debugger:run
// xfail-win32
// xfail-android: FIXME(#10381)
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:rbreak zzz
// debugger:run
// xfail-android: FIXME(#10381)
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:rbreak zzz
// debugger:run
// debugger:finish
#[feature(managed_boxes)];
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:rbreak zzz
// debugger:run
// debugger:finish
#[feature(managed_boxes)];
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:set print pretty off
// debugger:rbreak zzz
// debugger:run
// xfail-android: FIXME(#10381)
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:rbreak zzz
// debugger:run
// xfail-android: FIXME(#10381)
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:rbreak zzz
// debugger:run
// xfail-android: FIXME(#10381)
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:rbreak zzz
// debugger:run
// xfail-android: FIXME(#10381)
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:rbreak zzz
// debugger:run
// xfail-android: FIXME(#10381)
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:rbreak zzz
// debugger:run
// xfail-android: FIXME(#10381)
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:rbreak zzz
// debugger:run
// debugger:finish
// xfail-android: FIXME(#10381)
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:rbreak zzz
// debugger:run
// debugger:finish
// xfail-android: FIXME(#10381)
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:rbreak zzz
// debugger:run
// xfail-android: FIXME(#10381)
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:rbreak zzz
// debugger:run
// debugger:finish
// xfail-android: FIXME(#10381)
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:rbreak zzz
// debugger:run
// debugger:finish
// xfail-tidy-linelength
// xfail-android: FIXME(#10381)
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:set print pretty off
// debugger:rbreak zzz
// debugger:run
// xfail-tidy-linelength
// xfail-android: FIXME(#10381)
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:set print pretty off
// debugger:rbreak zzz
// debugger:run
// xfail-android: FIXME(#10381)
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:run
// Test whether compiling a recursive enum definition crashes debug info generation. The test case
#[feature(managed_boxes)];
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:set print pretty off
// debugger:rbreak zzz
// debugger:run
// xfail-android: FIXME(#10381)
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:rbreak zzz
// debugger:run
// xfail-android: FIXME(#10381)
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:rbreak zzz
// debugger:run
// xfail-android: FIXME(#10381)
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:rbreak zzz
// debugger:run
// xfail-android: FIXME(#10381)
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:rbreak zzz
// debugger:run
// xfail-android: FIXME(#10381)
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:rbreak zzz
// debugger:run
// xfail-android: FIXME(#10381)
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:set print pretty off
// debugger:rbreak zzz
// debugger:run
// xfail-android: FIXME(#10381)
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:set print pretty off
// debugger:rbreak zzz
// debugger:run
// xfail-android: FIXME(#10381)
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:rbreak zzz
// debugger:run
// xfail-tidy-linelength
// xfail-android: FIXME(#10381)
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:set print union on
// debugger:rbreak zzz
// debugger:run
// xfail-android: FIXME(#10381)
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:set print pretty off
// debugger:rbreak zzz
// debugger:run
// xfail-tidy-linelength
// xfail-android: FIXME(#10381)
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:set print union on
// debugger:rbreak zzz
// debugger:run
// xfail-android: FIXME(#10381)
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:rbreak zzz
// debugger:run
// debugger:finish
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:rbreak zzz
// debugger:run
// xfail-android: FIXME(#10381)
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:run
#[allow(unused_variable)];
// xfail-android: FIXME(#10381)
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:set print pretty off
// debugger:rbreak zzz
// debugger:run
// xfail-android: FIXME(#10381)
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:set print pretty off
// debugger:rbreak zzz
// debugger:run
// xfail-android: FIXME(#10381)
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:set print pretty off
// debugger:rbreak zzz
// debugger:run
// xfail-tidy-linelength
// xfail-android: FIXME(#10381)
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:set print union on
// debugger:rbreak zzz
// debugger:run
// xfail-android: FIXME(#10381)
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:rbreak zzz
// debugger:run
// debugger:finish
// xfail-win32: FIXME #10474
// xfail-android: FIXME(#10381)
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:rbreak zzz
// debugger:run
// debugger:finish
// xfail-android: FIXME(#10381)
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:rbreak zzz
// debugger:run
// debugger:finish
// xfail-android: FIXME(#10381)
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:rbreak zzz
// debugger:run
// debugger:finish
// xfail-android: FIXME(#10381)
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:set print pretty off
// debugger:rbreak zzz
// debugger:run
// xfail-android: FIXME(#10381)
-// compile-flags:-Z extra-debug-info
+// compile-flags:-g
// debugger:set print pretty off
// debugger:rbreak zzz
// debugger:run
-include ../tools.mk
all:
- $(RUSTC) lib.rs -Z gen-crate-map
+ $(RUSTC) lib.rs -C gen-crate-map
ln -nsf $(call DYLIB,boot-*) $(call DYLIB,boot)
$(CC) main.c -o $(call RUN,main) -lboot -Wl,-rpath,$(TMPDIR)
$(call RUN,main)
-include ../tools.mk
all:
- $(RUSTC) lib.rs -Z gen-crate-map
+ $(RUSTC) lib.rs -C gen-crate-map
ln -nsf $(call DYLIB,boot-*) $(call DYLIB,boot)
$(CC) main.c -o $(call RUN,main) -lboot -Wl,-rpath,$(TMPDIR)
$(call RUN,main)
endif
all:
- $(RUSTC) foo.rs -Z gen-crate-map
+ $(RUSTC) foo.rs -C gen-crate-map
ln -s $(call STATICLIB,foo-*) $(call STATICLIB,foo)
- $(CC) bar.c -lfoo -o $(call RUN,bar) $(EXTRAFLAGS) -lstdc++
+ $(CC) bar.c -lfoo -o $(call RUN,bar) $(EXTRAFLAGS) -lstdc++
$(call RUN,bar)
rm $(call STATICLIB,foo*)
$(call RUN,bar)
endif
all:
- $(RUSTC) foo.rs -Z gen-crate-map -Z lto
+ $(RUSTC) foo.rs -C gen-crate-map -Z lto
ln -s $(call STATICLIB,foo-*) $(call STATICLIB,foo)
$(CC) bar.c -lfoo -o $(call RUN,bar) $(EXTRAFLAGS) -lstdc++
$(call RUN,bar)
all:
$(RUSTC) both.rs
- $(RUSTC) dylib.rs -Z prefer-dynamic
+ $(RUSTC) dylib.rs -C prefer-dynamic
$(RUSTC) prog.rs
$(call RUN,prog)
all:
$(RUSTC) bar.rs --crate-type=dylib --crate-type=rlib
- $(RUSTC) foo.rs -Z prefer-dynamic
+ $(RUSTC) foo.rs -C prefer-dynamic
$(call RUN,foo)
rm $(TMPDIR)/*bar*
$(call FAILS,foo)
-include ../tools.mk
# Notice the space in the end, this emulates the output of pkg-config
-RUSTC_FLAGS = --link-args "-lc "
+RUSTC_FLAGS = -C link-args="-lc "
all:
$(RUSTC) $(RUSTC_FLAGS) empty.rs
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// compile-flags:-Z debug-info
+// compile-flags:-g
pub trait TraitWithDefaultMethod {
fn method(self) {