From 071ee96277845af99bde5e7e15ccbb0cff9be0a7 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Thu, 6 Feb 2014 19:57:09 -0800 Subject: [PATCH] Consolidate codegen-related compiler flags Move them all behind a new -C switch. This migrates some -Z flags and some top-level flags behind this -C codegen option. The -C flag takes values of the form "-C name=value" where the "=value" is optional for some flags. Flags affected: * --llvm-args => -C llvm-args * --passes => -C passes * --ar => -C ar * --linker => -C linker * --link-args => -C link-args * --target-cpu => -C target-cpu * --target-feature => -C target-fature * --android-cross-path => -C android-cross-path * --save-temps => -C save-temps * --no-rpath => -C no-rpath * -Z no-prepopulate => -C no-prepopulate-passes * -Z no-vectorize-loops => -C no-vectorize-loops * -Z no-vectorize-slp => -C no-vectorize-slp * -Z soft-float => -C soft-float * -Z gen-crate-map => -C gen-crate-map * -Z prefer-dynamic => -C prefer-dynamic * -Z no-integrated-as => -C no-integrated-as As a bonus, this also promotes the -Z extra-debug-info flag to a first class -g or --debuginfo flag. * -Z debug-info => removed * -Z extra-debug-info => -g or --debuginfo Closes #9770 Closes #12000 --- Makefile.in | 2 +- man/rustc.1 | 98 +++++++--- mk/platform.mk | 4 +- mk/tests.mk | 2 +- src/compiletest/runtest.rs | 6 +- src/doc/rust.md | 2 +- src/librustc/back/link.rs | 46 ++--- src/librustc/back/lto.rs | 2 +- src/librustc/driver/driver.rs | 109 ++++------- src/librustc/driver/session.rs | 175 +++++++++++------- src/librustc/lib.rs | 28 ++- src/librustc/middle/trans/_match.rs | 4 +- src/librustc/middle/trans/base.rs | 6 +- src/librustc/middle/trans/closure.rs | 2 +- src/librustc/middle/trans/context.rs | 2 +- src/librustc/middle/trans/controlflow.rs | 2 +- src/librustc/middle/trans/debuginfo.rs | 10 +- src/librustdoc/test.rs | 5 +- src/test/compile-fail/issue-10755.rs | 2 +- src/test/compile-fail/issue-11154.rs | 2 +- src/test/debug-info/basic-types-metadata.rs | 2 +- src/test/debug-info/basic-types.rs | 2 +- src/test/debug-info/borrowed-basic.rs | 2 +- src/test/debug-info/borrowed-c-style-enum.rs | 2 +- src/test/debug-info/borrowed-enum.rs | 2 +- src/test/debug-info/borrowed-managed-basic.rs | 2 +- src/test/debug-info/borrowed-struct.rs | 2 +- src/test/debug-info/borrowed-tuple.rs | 2 +- src/test/debug-info/borrowed-unique-basic.rs | 2 +- src/test/debug-info/box.rs | 2 +- src/test/debug-info/boxed-struct.rs | 2 +- src/test/debug-info/boxed-vec.rs | 2 +- .../by-value-non-immediate-argument.rs | 2 +- .../by-value-self-argument-in-trait-impl.rs | 2 +- .../debug-info/c-style-enum-in-composite.rs | 2 +- src/test/debug-info/c-style-enum.rs | 2 +- .../debug-info/closure-in-generic-function.rs | 2 +- .../debug-info/destructured-fn-argument.rs | 2 +- src/test/debug-info/destructured-local.rs | 2 +- src/test/debug-info/evec-in-struct.rs | 2 +- .../debug-info/function-arg-initialization.rs | 2 +- src/test/debug-info/function-arguments.rs | 2 +- ...nction-prologue-stepping-no-split-stack.rs | 2 +- src/test/debug-info/generic-function.rs | 2 +- .../debug-info/generic-functions-nested.rs | 2 +- .../generic-method-on-generic-struct.rs | 2 +- ...eneric-static-method-on-struct-and-enum.rs | 2 +- .../debug-info/generic-struct-style-enum.rs | 2 +- src/test/debug-info/generic-struct.rs | 2 +- ...ric-trait-generic-static-default-method.rs | 2 +- .../debug-info/generic-tuple-style-enum.rs | 2 +- src/test/debug-info/include_string.rs | 2 +- src/test/debug-info/issue11600.rs | 2 +- .../debug-info/lexical-scope-in-for-loop.rs | 2 +- src/test/debug-info/lexical-scope-in-if.rs | 2 +- src/test/debug-info/lexical-scope-in-match.rs | 2 +- .../lexical-scope-in-parameterless-closure.rs | 2 +- .../lexical-scope-in-stack-closure.rs | 2 +- .../lexical-scope-in-unconditional-loop.rs | 2 +- .../lexical-scope-in-unique-closure.rs | 2 +- src/test/debug-info/lexical-scope-in-while.rs | 2 +- .../debug-info/lexical-scope-with-macro.rs | 2 +- .../lexical-scopes-in-block-expression.rs | 2 +- src/test/debug-info/managed-enum.rs | 2 +- .../managed-pointer-within-unique-vec.rs | 2 +- .../managed-pointer-within-unique.rs | 2 +- src/test/debug-info/method-on-enum.rs | 2 +- .../debug-info/method-on-generic-struct.rs | 2 +- src/test/debug-info/method-on-struct.rs | 2 +- src/test/debug-info/method-on-trait.rs | 2 +- src/test/debug-info/method-on-tuple-struct.rs | 2 +- .../multiple-functions-equal-var-names.rs | 2 +- src/test/debug-info/multiple-functions.rs | 2 +- .../name-shadowing-and-scope-nesting.rs | 2 +- src/test/debug-info/nil-enum.rs | 2 +- src/test/debug-info/option-like-enum.rs | 2 +- .../packed-struct-with-destructor.rs | 2 +- src/test/debug-info/packed-struct.rs | 2 +- src/test/debug-info/recursive-enum.rs | 2 +- src/test/debug-info/recursive-struct.rs | 2 +- src/test/debug-info/self-in-default-method.rs | 2 +- .../self-in-generic-default-method.rs | 2 +- src/test/debug-info/shadowed-argument.rs | 2 +- src/test/debug-info/shadowed-variable.rs | 2 +- src/test/debug-info/simple-lexical-scope.rs | 2 +- src/test/debug-info/simple-struct.rs | 2 +- src/test/debug-info/simple-tuple.rs | 2 +- .../static-method-on-struct-and-enum.rs | 2 +- src/test/debug-info/struct-in-enum.rs | 2 +- src/test/debug-info/struct-in-struct.rs | 2 +- src/test/debug-info/struct-style-enum.rs | 2 +- src/test/debug-info/struct-with-destructor.rs | 2 +- .../trait-generic-static-default-method.rs | 2 +- src/test/debug-info/trait-pointers.rs | 2 +- src/test/debug-info/tuple-in-struct.rs | 2 +- src/test/debug-info/tuple-in-tuple.rs | 2 +- src/test/debug-info/tuple-struct.rs | 2 +- src/test/debug-info/tuple-style-enum.rs | 2 +- src/test/debug-info/unique-enum.rs | 2 +- .../var-captured-in-nested-closure.rs | 2 +- .../var-captured-in-sendable-closure.rs | 2 +- .../var-captured-in-stack-closure.rs | 2 +- src/test/debug-info/vec-slices.rs | 2 +- src/test/debug-info/vec.rs | 2 +- .../bootstrap-from-c-with-green/Makefile | 2 +- .../bootstrap-from-c-with-native/Makefile | 2 +- .../c-link-to-rust-staticlib/Makefile | 4 +- src/test/run-make/lto-smoke-c/Makefile | 2 +- src/test/run-make/mixing-deps/Makefile | 2 +- src/test/run-make/prefer-dylib/Makefile | 2 +- src/test/run-make/prune-link-args/Makefile | 2 +- src/test/run-pass/issue-7712.rs | 2 +- 112 files changed, 393 insertions(+), 302 deletions(-) diff --git a/Makefile.in b/Makefile.in index 05b62157de9b5..49e02a63b7dfb 100644 --- a/Makefile.in +++ b/Makefile.in @@ -141,7 +141,7 @@ endif # 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 diff --git a/man/rustc.1 b/man/rustc.1 index 0f84c26df2b02..8dc795cfd3e1b 100644 --- a/man/rustc.1 +++ b/man/rustc.1 @@ -27,18 +27,15 @@ Display this message \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 @@ -48,11 +45,6 @@ Write output to . Ignored if more than one --emit is specified. \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 . Ignored if -o is specified. (default the current directory) @@ -66,9 +58,6 @@ Pretty-print the input instead of compiling; valid types are: normal 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 @@ -80,12 +69,6 @@ Target triple cpu-manufacturer-kernel[-os] to compile for (see 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 @@ -104,9 +87,80 @@ Set lint forbidden \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 @@ -117,8 +171,8 @@ To build a library from a source file: 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" diff --git a/mk/platform.mk b/mk/platform.mk index f400809b616bf..5a69013892c96 100644 --- a/mk/platform.mk +++ b/mk/platform.mk @@ -300,8 +300,8 @@ CFG_PATH_MUNGE_arm-linux-androideabi := true 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- diff --git a/mk/tests.mk b/mk/tests.mk index d2fccbd47cf8b..3fe2f8b69cbf5 100644 --- a/mk/tests.mk +++ b/mk/tests.mk @@ -530,7 +530,7 @@ CTEST_RUSTC_FLAGS := $$(subst --cfg ndebug,,$$(CFG_RUSTC_FLAGS)) # 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 diff --git a/src/compiletest/runtest.rs b/src/compiletest/runtest.rs index 8edd923390af4..f906c0fc4e10f 100644 --- a/src/compiletest/runtest.rs +++ b/src/compiletest/runtest.rs @@ -332,8 +332,8 @@ fn run_debuginfo_test(config: &config, props: &TestProps, testfile: &Path) { 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; } } @@ -1054,7 +1054,7 @@ fn compile_test_and_save_bitcode(config: &config, props: &TestProps, 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); diff --git a/src/doc/rust.md b/src/doc/rust.md index bae8f562af526..725f15f4aaad9 100644 --- a/src/doc/rust.md +++ b/src/doc/rust.md @@ -3761,7 +3761,7 @@ dependencies will be used: 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 diff --git a/src/librustc/back/link.rs b/src/librustc/back/link.rs index 531b8bf903457..d6abc7b6954d3 100644 --- a/src/librustc/back/link.rs +++ b/src/librustc/back/link.rs @@ -111,13 +111,13 @@ pub mod write { 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() } } @@ -130,7 +130,7 @@ pub mod write { 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); }) @@ -142,7 +142,7 @@ pub mod write { 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 @@ -151,7 +151,7 @@ pub mod write { 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, @@ -180,13 +180,13 @@ pub mod write { }; 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)); @@ -208,7 +208,7 @@ pub mod write { // 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| { @@ -220,7 +220,7 @@ pub mod write { 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); }) @@ -353,10 +353,10 @@ pub mod write { // 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 = ~[]; @@ -374,7 +374,7 @@ pub mod write { 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); } @@ -745,7 +745,7 @@ pub fn output_lib_filename(lm: &LinkMeta) -> ~str { } 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 => {} } @@ -763,7 +763,7 @@ pub fn get_cc_prog(sess: Session) -> ~str { } 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 => {} } @@ -773,7 +773,7 @@ pub fn get_ar_prog(sess: Session) -> ~str { 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", @@ -783,7 +783,7 @@ fn get_system_tool(sess: Session, tool: &str) -> ~str { } None => { sess.fatal(format!("need Android NDK path for the '{}' tool \ - (--android-cross-path)", tool)) + (-C android-cross-path)", tool)) } }, _ => tool.to_owned(), @@ -813,7 +813,7 @@ pub fn link_binary(sess: Session, } // 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); @@ -969,7 +969,7 @@ fn link_rlib(sess: Session, // 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); } @@ -1142,7 +1142,7 @@ fn link_args(sess: Session, 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()); } @@ -1163,13 +1163,13 @@ fn link_args(sess: Session, // 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() { @@ -1235,7 +1235,7 @@ fn add_upstream_rust_crates(args: &mut ~[~str], sess: Session, } 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 diff --git a/src/librustc/back/lto.rs b/src/librustc/back/lto.rs index 3c7d804435f2f..b2440dcedbdcb 100644 --- a/src/librustc/back/lto.rs +++ b/src/librustc/back/lto.rs @@ -19,7 +19,7 @@ use std::libc; 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(); diff --git a/src/librustc/driver/driver.rs b/src/librustc/driver/driver.rs index 0d45d5bdbab43..15240897b2aee 100644 --- a/src/librustc/driver/driver.rs +++ b/src/librustc/driver/driver.rs @@ -382,7 +382,7 @@ pub fn phase_4_translate_to_llvm(sess: Session, 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", (), |_| @@ -391,7 +391,7 @@ pub fn phase_5_run_llvm_passes(sess: Session, 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 { @@ -747,7 +747,6 @@ pub fn build_session_options(binary: ~str, 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]; @@ -817,9 +816,6 @@ pub fn build_session_options(binary: ~str, 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 @@ -841,85 +837,77 @@ pub fn build_session_options(binary: ~str, } 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}=)", + 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) -> Session { @@ -1002,15 +990,12 @@ pub fn optgroups() -> ~[getopts::OptGroup] { 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", @@ -1020,13 +1005,6 @@ pub fn optgroups() -> ~[getopts::OptGroup] { optopt("o", "", "Write output to ", "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"), @@ -1041,9 +1019,6 @@ pub fn optgroups() -> ~[getopts::OptGroup] { AST nodes and blocks with IDs)", "TYPE"), optflagopt("", "dep-info", "Output dependency info to 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"), @@ -1051,14 +1026,6 @@ pub fn optgroups() -> ~[getopts::OptGroup] { "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", @@ -1067,6 +1034,8 @@ pub fn optgroups() -> ~[getopts::OptGroup] { "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"), diff --git a/src/librustc/driver/session.rs b/src/librustc/driver/session.rs index dc8598c10d0d0..27b8e68166605 100644 --- a/src/librustc/driver/session.rs +++ b/src/librustc/driver/session.rs @@ -65,17 +65,8 @@ debugging_opts!( 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 @@ -104,26 +95,9 @@ pub fn debugging_opts_map() -> ~[(&'static str, &'static str, u64)] { ("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), ] } @@ -144,24 +118,15 @@ pub struct Options { 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>, - 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 @@ -172,13 +137,12 @@ pub struct Options { 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), /// 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 @@ -329,24 +293,6 @@ impl Session_ { 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) } @@ -381,35 +327,132 @@ pub fn basic_options() -> @Options { 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(sess: Session, opt: Option, msg: || -> ~str) -> T { diagnostic::expect(sess.diagnostic(), opt, msg) diff --git a/src/librustc/lib.rs b/src/librustc/lib.rs index edcefdf659402..1b575e96df6ee 100644 --- a/src/librustc/lib.rs +++ b/src/librustc/lib.rs @@ -168,7 +168,7 @@ Available lint options: 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", @@ -184,7 +184,7 @@ Available lint options: } 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 { @@ -195,6 +195,22 @@ pub fn describe_debug_flags() { } } +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(); @@ -227,7 +243,13 @@ pub fn run_compiler(args: &[~str]) { 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; } diff --git a/src/librustc/middle/trans/_match.rs b/src/librustc/middle/trans/_match.rs index f49b0f1af08b3..8828fd5e01914 100644 --- a/src/librustc/middle/trans/_match.rs +++ b/src/librustc/middle/trans/_match.rs @@ -1371,7 +1371,7 @@ fn insert_lllocals<'a>(bcx: &'a Block<'a>, 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, @@ -2030,7 +2030,7 @@ pub fn store_arg<'a>(mut bcx: &'a Block<'a>, // 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 :(. diff --git a/src/librustc/middle/trans/base.rs b/src/librustc/middle/trans/base.rs index 39e0ca176eb0b..227b2f6e1dc55 100644 --- a/src/librustc/middle/trans/base.rs +++ b/src/librustc/middle/trans/base.rs @@ -568,7 +568,7 @@ pub fn get_res_dtor(ccx: @CrateContext, // 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) @@ -1389,7 +1389,7 @@ fn copy_args_to_allocas<'a>(fcx: &FunctionContext<'a>, 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]); } } @@ -2510,7 +2510,7 @@ pub fn decl_crate_map(sess: session::Session, mapmeta: LinkMeta, 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 { diff --git a/src/librustc/middle/trans/closure.rs b/src/librustc/middle/trans/closure.rs index c9631a72ee7c9..81c671b495246 100644 --- a/src/librustc/middle/trans/closure.rs +++ b/src/librustc/middle/trans/closure.rs @@ -298,7 +298,7 @@ fn load_environment<'a>(bcx: &'a Block<'a>, cdata_ty: ty::t, // 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) diff --git a/src/librustc/middle/trans/context.rs b/src/librustc/middle/trans/context.rs index 95875a0140182..2260ddea3c241 100644 --- a/src/librustc/middle/trans/context.rs +++ b/src/librustc/middle/trans/context.rs @@ -151,7 +151,7 @@ impl CrateContext { 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); diff --git a/src/librustc/middle/trans/controlflow.rs b/src/librustc/middle/trans/controlflow.rs index d361c36fbdacd..c339e8bc64824 100644 --- a/src/librustc/middle/trans/controlflow.rs +++ b/src/librustc/middle/trans/controlflow.rs @@ -56,7 +56,7 @@ pub fn trans_stmt<'a>(cx: &'a Block<'a>, 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); } } diff --git a/src/librustc/middle/trans/debuginfo.rs b/src/librustc/middle/trans/debuginfo.rs index d214a192ed8d4..db8f83b41af8e 100644 --- a/src/librustc/middle/trans/debuginfo.rs +++ b/src/librustc/middle/trans/debuginfo.rs @@ -707,7 +707,7 @@ pub fn create_function_debug_context(cx: &CrateContext, 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), []); } @@ -784,8 +784,8 @@ pub fn create_function_debug_context(cx: &CrateContext, 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); @@ -829,8 +829,8 @@ pub fn create_function_debug_context(cx: &CrateContext, 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() diff --git a/src/librustdoc/test.rs b/src/librustdoc/test.rs index 58c89d6aa4a7c..17ef8732413e6 100644 --- a/src/librustdoc/test.rs +++ b/src/librustdoc/test.rs @@ -105,8 +105,11 @@ fn runtest(test: &str, cratename: &str, libs: HashSet) { 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() }; diff --git a/src/test/compile-fail/issue-10755.rs b/src/test/compile-fail/issue-10755.rs index 91afa62b58c4a..1d8db84ab1393 100644 --- a/src/test/compile-fail/issue-10755.rs +++ b/src/test/compile-fail/issue-10755.rs @@ -8,7 +8,7 @@ // 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() { diff --git a/src/test/compile-fail/issue-11154.rs b/src/test/compile-fail/issue-11154.rs index 47f86e52eaef9..aac5eebaf4af9 100644 --- a/src/test/compile-fail/issue-11154.rs +++ b/src/test/compile-fail/issue-11154.rs @@ -8,7 +8,7 @@ // 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 diff --git a/src/test/debug-info/basic-types-metadata.rs b/src/test/debug-info/basic-types-metadata.rs index a67279254de3a..1c19baa4d8ed8 100644 --- a/src/test/debug-info/basic-types-metadata.rs +++ b/src/test/debug-info/basic-types-metadata.rs @@ -10,7 +10,7 @@ // xfail-android: FIXME(#10381) -// compile-flags:-Z extra-debug-info +// compile-flags:-g // debugger:rbreak zzz // debugger:run // debugger:finish diff --git a/src/test/debug-info/basic-types.rs b/src/test/debug-info/basic-types.rs index b57c359046a68..4a6bacad98f8f 100644 --- a/src/test/debug-info/basic-types.rs +++ b/src/test/debug-info/basic-types.rs @@ -16,7 +16,7 @@ // xfail-android: FIXME(#10381) -// compile-flags:-Z extra-debug-info +// compile-flags:-g // debugger:rbreak zzz // debugger:run // debugger:finish diff --git a/src/test/debug-info/borrowed-basic.rs b/src/test/debug-info/borrowed-basic.rs index 7f130f212e2a6..bf9c70488b083 100644 --- a/src/test/debug-info/borrowed-basic.rs +++ b/src/test/debug-info/borrowed-basic.rs @@ -13,7 +13,7 @@ // 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 diff --git a/src/test/debug-info/borrowed-c-style-enum.rs b/src/test/debug-info/borrowed-c-style-enum.rs index 328e0176a91bf..29f0ea61ca77e 100644 --- a/src/test/debug-info/borrowed-c-style-enum.rs +++ b/src/test/debug-info/borrowed-c-style-enum.rs @@ -10,7 +10,7 @@ // xfail-android: FIXME(#10381) -// compile-flags:-Z extra-debug-info +// compile-flags:-g // debugger:rbreak zzz // debugger:run // debugger:finish diff --git a/src/test/debug-info/borrowed-enum.rs b/src/test/debug-info/borrowed-enum.rs index e6094fdef9fe0..c8e29cfddb036 100644 --- a/src/test/debug-info/borrowed-enum.rs +++ b/src/test/debug-info/borrowed-enum.rs @@ -10,7 +10,7 @@ // xfail-android: FIXME(#10381) -// compile-flags:-Z extra-debug-info +// compile-flags:-g // debugger:rbreak zzz // debugger:run // debugger:finish diff --git a/src/test/debug-info/borrowed-managed-basic.rs b/src/test/debug-info/borrowed-managed-basic.rs index a05face4c5e32..94a584efe94fa 100644 --- a/src/test/debug-info/borrowed-managed-basic.rs +++ b/src/test/debug-info/borrowed-managed-basic.rs @@ -15,7 +15,7 @@ // 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 diff --git a/src/test/debug-info/borrowed-struct.rs b/src/test/debug-info/borrowed-struct.rs index 0bb8b247e597b..367d3b9a6daee 100644 --- a/src/test/debug-info/borrowed-struct.rs +++ b/src/test/debug-info/borrowed-struct.rs @@ -10,7 +10,7 @@ // xfail-android: FIXME(#10381) -// compile-flags:-Z extra-debug-info +// compile-flags:-g // debugger:rbreak zzz // debugger:run // debugger:finish diff --git a/src/test/debug-info/borrowed-tuple.rs b/src/test/debug-info/borrowed-tuple.rs index ac77c05b832e1..2fcb67baecd8c 100644 --- a/src/test/debug-info/borrowed-tuple.rs +++ b/src/test/debug-info/borrowed-tuple.rs @@ -12,7 +12,7 @@ #[feature(managed_boxes)]; -// compile-flags:-Z extra-debug-info +// compile-flags:-g // debugger:rbreak zzz // debugger:run // debugger:finish diff --git a/src/test/debug-info/borrowed-unique-basic.rs b/src/test/debug-info/borrowed-unique-basic.rs index 04973c20799d0..9863258930af1 100644 --- a/src/test/debug-info/borrowed-unique-basic.rs +++ b/src/test/debug-info/borrowed-unique-basic.rs @@ -13,7 +13,7 @@ // 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 diff --git a/src/test/debug-info/box.rs b/src/test/debug-info/box.rs index 304d150d57ef8..b293b9d254523 100644 --- a/src/test/debug-info/box.rs +++ b/src/test/debug-info/box.rs @@ -10,7 +10,7 @@ // xfail-android: FIXME(#10381) -// compile-flags:-Z extra-debug-info +// compile-flags:-g // debugger:set print pretty off // debugger:rbreak zzz // debugger:run diff --git a/src/test/debug-info/boxed-struct.rs b/src/test/debug-info/boxed-struct.rs index ff67d35a9cd2f..21f3c0a99f72d 100644 --- a/src/test/debug-info/boxed-struct.rs +++ b/src/test/debug-info/boxed-struct.rs @@ -10,7 +10,7 @@ // xfail-android: FIXME(#10381) -// compile-flags:-Z extra-debug-info +// compile-flags:-g // debugger:rbreak zzz // debugger:run // debugger:finish diff --git a/src/test/debug-info/boxed-vec.rs b/src/test/debug-info/boxed-vec.rs index 2c0edb783f830..b4ca5dbeabe86 100644 --- a/src/test/debug-info/boxed-vec.rs +++ b/src/test/debug-info/boxed-vec.rs @@ -12,7 +12,7 @@ #[feature(managed_boxes)]; -// compile-flags:-Z extra-debug-info +// compile-flags:-g // debugger:rbreak zzz // debugger:run // debugger:finish diff --git a/src/test/debug-info/by-value-non-immediate-argument.rs b/src/test/debug-info/by-value-non-immediate-argument.rs index abb863f6b9e75..3b1e730ff9e2e 100644 --- a/src/test/debug-info/by-value-non-immediate-argument.rs +++ b/src/test/debug-info/by-value-non-immediate-argument.rs @@ -10,7 +10,7 @@ // xfail-android: FIXME(#10381) -// compile-flags:-Z extra-debug-info +// compile-flags:-g // debugger:rbreak zzz // debugger:run diff --git a/src/test/debug-info/by-value-self-argument-in-trait-impl.rs b/src/test/debug-info/by-value-self-argument-in-trait-impl.rs index d051ab9db93b1..ee9ef7f2f0f28 100644 --- a/src/test/debug-info/by-value-self-argument-in-trait-impl.rs +++ b/src/test/debug-info/by-value-self-argument-in-trait-impl.rs @@ -12,7 +12,7 @@ #[feature(managed_boxes)]; -// compile-flags:-Z extra-debug-info +// compile-flags:-g // debugger:rbreak zzz // debugger:run diff --git a/src/test/debug-info/c-style-enum-in-composite.rs b/src/test/debug-info/c-style-enum-in-composite.rs index 90956a2641352..92168292f93fc 100644 --- a/src/test/debug-info/c-style-enum-in-composite.rs +++ b/src/test/debug-info/c-style-enum-in-composite.rs @@ -10,7 +10,7 @@ // xfail-android: FIXME(#10381) -// compile-flags:-Z extra-debug-info +// compile-flags:-g // debugger:rbreak zzz // debugger:run // debugger:finish diff --git a/src/test/debug-info/c-style-enum.rs b/src/test/debug-info/c-style-enum.rs index f9a1c30103c8e..fc8f752936f4c 100644 --- a/src/test/debug-info/c-style-enum.rs +++ b/src/test/debug-info/c-style-enum.rs @@ -10,7 +10,7 @@ // xfail-android: FIXME(#10381) -// compile-flags:-Z extra-debug-info +// compile-flags:-g // debugger:rbreak zzz // debugger:run // debugger:finish diff --git a/src/test/debug-info/closure-in-generic-function.rs b/src/test/debug-info/closure-in-generic-function.rs index 21c20325e3cdb..b3d2357a63cf1 100644 --- a/src/test/debug-info/closure-in-generic-function.rs +++ b/src/test/debug-info/closure-in-generic-function.rs @@ -10,7 +10,7 @@ // xfail-android: FIXME(#10381) -// compile-flags:-Z extra-debug-info +// compile-flags:-g // debugger:rbreak zzz // debugger:run diff --git a/src/test/debug-info/destructured-fn-argument.rs b/src/test/debug-info/destructured-fn-argument.rs index ed711e2ca0be6..5acc374896448 100644 --- a/src/test/debug-info/destructured-fn-argument.rs +++ b/src/test/debug-info/destructured-fn-argument.rs @@ -10,7 +10,7 @@ // xfail-android: FIXME(#10381) -// compile-flags:-Z extra-debug-info +// compile-flags:-g // debugger:rbreak zzz // debugger:run diff --git a/src/test/debug-info/destructured-local.rs b/src/test/debug-info/destructured-local.rs index 0d415a85172b6..dd1cfb036f571 100644 --- a/src/test/debug-info/destructured-local.rs +++ b/src/test/debug-info/destructured-local.rs @@ -10,7 +10,7 @@ // xfail-android: FIXME(#10381) -// compile-flags:-Z extra-debug-info +// compile-flags:-g // debugger:rbreak zzz // debugger:run // debugger:finish diff --git a/src/test/debug-info/evec-in-struct.rs b/src/test/debug-info/evec-in-struct.rs index a6f0a42bd3065..8ac16bdd2dd93 100644 --- a/src/test/debug-info/evec-in-struct.rs +++ b/src/test/debug-info/evec-in-struct.rs @@ -10,7 +10,7 @@ // xfail-android: FIXME(#10381) -// compile-flags:-Z extra-debug-info +// compile-flags:-g // debugger:set print pretty off // debugger:rbreak zzz // debugger:run diff --git a/src/test/debug-info/function-arg-initialization.rs b/src/test/debug-info/function-arg-initialization.rs index aab302c72c5c0..057d2ac21b506 100644 --- a/src/test/debug-info/function-arg-initialization.rs +++ b/src/test/debug-info/function-arg-initialization.rs @@ -17,7 +17,7 @@ // 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 diff --git a/src/test/debug-info/function-arguments.rs b/src/test/debug-info/function-arguments.rs index 6bac417f54e56..74c59550e0bb2 100644 --- a/src/test/debug-info/function-arguments.rs +++ b/src/test/debug-info/function-arguments.rs @@ -10,7 +10,7 @@ // xfail-android: FIXME(#10381) -// compile-flags:-Z extra-debug-info +// compile-flags:-g // debugger:rbreak zzz // debugger:run // debugger:finish diff --git a/src/test/debug-info/function-prologue-stepping-no-split-stack.rs b/src/test/debug-info/function-prologue-stepping-no-split-stack.rs index da2d4e09fc67f..690d6248ceaab 100644 --- a/src/test/debug-info/function-prologue-stepping-no-split-stack.rs +++ b/src/test/debug-info/function-prologue-stepping-no-split-stack.rs @@ -16,7 +16,7 @@ // 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 diff --git a/src/test/debug-info/generic-function.rs b/src/test/debug-info/generic-function.rs index d76551a212e4e..0741620fd20fc 100644 --- a/src/test/debug-info/generic-function.rs +++ b/src/test/debug-info/generic-function.rs @@ -10,7 +10,7 @@ // xfail-android: FIXME(#10381) -// compile-flags:-Z extra-debug-info +// compile-flags:-g // debugger:rbreak zzz // debugger:run diff --git a/src/test/debug-info/generic-functions-nested.rs b/src/test/debug-info/generic-functions-nested.rs index a54238e981a5b..bb21cb3813219 100644 --- a/src/test/debug-info/generic-functions-nested.rs +++ b/src/test/debug-info/generic-functions-nested.rs @@ -10,7 +10,7 @@ // xfail-android: FIXME(#10381) -// compile-flags:-Z extra-debug-info +// compile-flags:-g // debugger:rbreak zzz // debugger:run diff --git a/src/test/debug-info/generic-method-on-generic-struct.rs b/src/test/debug-info/generic-method-on-generic-struct.rs index f71106cacb161..97607af4cb34b 100644 --- a/src/test/debug-info/generic-method-on-generic-struct.rs +++ b/src/test/debug-info/generic-method-on-generic-struct.rs @@ -10,7 +10,7 @@ // xfail-android: FIXME(#10381) -// compile-flags:-Z extra-debug-info +// compile-flags:-g // debugger:rbreak zzz // debugger:run diff --git a/src/test/debug-info/generic-static-method-on-struct-and-enum.rs b/src/test/debug-info/generic-static-method-on-struct-and-enum.rs index a0551e570c7dd..18f3f3109d5b0 100644 --- a/src/test/debug-info/generic-static-method-on-struct-and-enum.rs +++ b/src/test/debug-info/generic-static-method-on-struct-and-enum.rs @@ -10,7 +10,7 @@ // xfail-android: FIXME(#10381) -// compile-flags:-Z extra-debug-info +// compile-flags:-g // debugger:rbreak zzz // debugger:run diff --git a/src/test/debug-info/generic-struct-style-enum.rs b/src/test/debug-info/generic-struct-style-enum.rs index 5930af1156777..b73566dad9e88 100644 --- a/src/test/debug-info/generic-struct-style-enum.rs +++ b/src/test/debug-info/generic-struct-style-enum.rs @@ -11,7 +11,7 @@ // 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 diff --git a/src/test/debug-info/generic-struct.rs b/src/test/debug-info/generic-struct.rs index 143e2ded19380..cc913ad8c9433 100644 --- a/src/test/debug-info/generic-struct.rs +++ b/src/test/debug-info/generic-struct.rs @@ -10,7 +10,7 @@ // xfail-android: FIXME(#10381) -// compile-flags:-Z extra-debug-info +// compile-flags:-g // debugger:rbreak zzz // debugger:run diff --git a/src/test/debug-info/generic-trait-generic-static-default-method.rs b/src/test/debug-info/generic-trait-generic-static-default-method.rs index 4355b4b98fe22..8a3fe3d1c2ceb 100644 --- a/src/test/debug-info/generic-trait-generic-static-default-method.rs +++ b/src/test/debug-info/generic-trait-generic-static-default-method.rs @@ -10,7 +10,7 @@ // 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 diff --git a/src/test/debug-info/generic-tuple-style-enum.rs b/src/test/debug-info/generic-tuple-style-enum.rs index 0a737ffe0732c..497351ac51f16 100644 --- a/src/test/debug-info/generic-tuple-style-enum.rs +++ b/src/test/debug-info/generic-tuple-style-enum.rs @@ -11,7 +11,7 @@ // 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 diff --git a/src/test/debug-info/include_string.rs b/src/test/debug-info/include_string.rs index 74064bb57822d..4d9fbe083eabc 100644 --- a/src/test/debug-info/include_string.rs +++ b/src/test/debug-info/include_string.rs @@ -10,7 +10,7 @@ // xfail-android: FIXME(#10381) -// compile-flags:-Z extra-debug-info +// compile-flags:-g // debugger:rbreak zzz // debugger:run // debugger:finish diff --git a/src/test/debug-info/issue11600.rs b/src/test/debug-info/issue11600.rs index 00e240d147c4b..30bbfd72c36ce 100644 --- a/src/test/debug-info/issue11600.rs +++ b/src/test/debug-info/issue11600.rs @@ -19,7 +19,7 @@ fn main() { // 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(); diff --git a/src/test/debug-info/lexical-scope-in-for-loop.rs b/src/test/debug-info/lexical-scope-in-for-loop.rs index 04ccc59250d0b..a426a8e3f6ca8 100644 --- a/src/test/debug-info/lexical-scope-in-for-loop.rs +++ b/src/test/debug-info/lexical-scope-in-for-loop.rs @@ -11,7 +11,7 @@ // xfail-win32 // xfail-android: FIXME(#10381) -// compile-flags:-Z extra-debug-info +// compile-flags:-g // debugger:rbreak zzz // debugger:run diff --git a/src/test/debug-info/lexical-scope-in-if.rs b/src/test/debug-info/lexical-scope-in-if.rs index 4cc58229ad0e2..7020293a3ef32 100644 --- a/src/test/debug-info/lexical-scope-in-if.rs +++ b/src/test/debug-info/lexical-scope-in-if.rs @@ -11,7 +11,7 @@ // xfail-win32 // xfail-android: FIXME(#10381) -// compile-flags:-Z extra-debug-info +// compile-flags:-g // debugger:rbreak zzz // debugger:run diff --git a/src/test/debug-info/lexical-scope-in-match.rs b/src/test/debug-info/lexical-scope-in-match.rs index 7cb68e9890d29..ffdd88cfa5950 100644 --- a/src/test/debug-info/lexical-scope-in-match.rs +++ b/src/test/debug-info/lexical-scope-in-match.rs @@ -11,7 +11,7 @@ // xfail-win32 // xfail-android: FIXME(#10381) -// compile-flags:-Z extra-debug-info +// compile-flags:-g // debugger:rbreak zzz // debugger:run diff --git a/src/test/debug-info/lexical-scope-in-parameterless-closure.rs b/src/test/debug-info/lexical-scope-in-parameterless-closure.rs index fbbb66f29048d..d9f16e00f97a3 100644 --- a/src/test/debug-info/lexical-scope-in-parameterless-closure.rs +++ b/src/test/debug-info/lexical-scope-in-parameterless-closure.rs @@ -10,7 +10,7 @@ // 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. diff --git a/src/test/debug-info/lexical-scope-in-stack-closure.rs b/src/test/debug-info/lexical-scope-in-stack-closure.rs index f052448c146a6..611b71b5c254d 100644 --- a/src/test/debug-info/lexical-scope-in-stack-closure.rs +++ b/src/test/debug-info/lexical-scope-in-stack-closure.rs @@ -10,7 +10,7 @@ // xfail-android: FIXME(#10381) -// compile-flags:-Z extra-debug-info +// compile-flags:-g // debugger:rbreak zzz // debugger:run diff --git a/src/test/debug-info/lexical-scope-in-unconditional-loop.rs b/src/test/debug-info/lexical-scope-in-unconditional-loop.rs index fa750d247b169..33138f4cc2b17 100644 --- a/src/test/debug-info/lexical-scope-in-unconditional-loop.rs +++ b/src/test/debug-info/lexical-scope-in-unconditional-loop.rs @@ -10,7 +10,7 @@ // xfail-android: FIXME(#10381) -// compile-flags:-Z extra-debug-info +// compile-flags:-g // debugger:rbreak zzz // debugger:run diff --git a/src/test/debug-info/lexical-scope-in-unique-closure.rs b/src/test/debug-info/lexical-scope-in-unique-closure.rs index 2c732f9f8501f..7173529bc518f 100644 --- a/src/test/debug-info/lexical-scope-in-unique-closure.rs +++ b/src/test/debug-info/lexical-scope-in-unique-closure.rs @@ -10,7 +10,7 @@ // xfail-android: FIXME(#10381) -// compile-flags:-Z extra-debug-info +// compile-flags:-g // debugger:rbreak zzz // debugger:run diff --git a/src/test/debug-info/lexical-scope-in-while.rs b/src/test/debug-info/lexical-scope-in-while.rs index f89f677291a08..43e8d61b0bbd8 100644 --- a/src/test/debug-info/lexical-scope-in-while.rs +++ b/src/test/debug-info/lexical-scope-in-while.rs @@ -10,7 +10,7 @@ // xfail-android: FIXME(#10381) -// compile-flags:-Z extra-debug-info +// compile-flags:-g // debugger:rbreak zzz // debugger:run diff --git a/src/test/debug-info/lexical-scope-with-macro.rs b/src/test/debug-info/lexical-scope-with-macro.rs index d97fdf6608924..bd52e2ba65dbf 100644 --- a/src/test/debug-info/lexical-scope-with-macro.rs +++ b/src/test/debug-info/lexical-scope-with-macro.rs @@ -10,7 +10,7 @@ // xfail-android: FIXME(#10381) -// compile-flags:-Z extra-debug-info +// compile-flags:-g // debugger:rbreak zzz // debugger:run diff --git a/src/test/debug-info/lexical-scopes-in-block-expression.rs b/src/test/debug-info/lexical-scopes-in-block-expression.rs index 1eb03e95f8f84..4a10f09177ba1 100644 --- a/src/test/debug-info/lexical-scopes-in-block-expression.rs +++ b/src/test/debug-info/lexical-scopes-in-block-expression.rs @@ -11,7 +11,7 @@ // xfail-win32 // xfail-android: FIXME(#10381) -// compile-flags:-Z extra-debug-info +// compile-flags:-g // debugger:rbreak zzz // debugger:run diff --git a/src/test/debug-info/managed-enum.rs b/src/test/debug-info/managed-enum.rs index ef94fd3e331f4..b5e2ddb895986 100644 --- a/src/test/debug-info/managed-enum.rs +++ b/src/test/debug-info/managed-enum.rs @@ -10,7 +10,7 @@ // xfail-android: FIXME(#10381) -// compile-flags:-Z extra-debug-info +// compile-flags:-g // debugger:rbreak zzz // debugger:run // debugger:finish diff --git a/src/test/debug-info/managed-pointer-within-unique-vec.rs b/src/test/debug-info/managed-pointer-within-unique-vec.rs index 8eed28170c57d..2345857e39209 100644 --- a/src/test/debug-info/managed-pointer-within-unique-vec.rs +++ b/src/test/debug-info/managed-pointer-within-unique-vec.rs @@ -12,7 +12,7 @@ #[feature(managed_boxes)]; -// compile-flags:-Z extra-debug-info +// compile-flags:-g // debugger:rbreak zzz // debugger:run // debugger:finish diff --git a/src/test/debug-info/managed-pointer-within-unique.rs b/src/test/debug-info/managed-pointer-within-unique.rs index 4afc8b235edb6..5f35e712d7cd6 100644 --- a/src/test/debug-info/managed-pointer-within-unique.rs +++ b/src/test/debug-info/managed-pointer-within-unique.rs @@ -12,7 +12,7 @@ #[feature(managed_boxes)]; -// compile-flags:-Z extra-debug-info +// compile-flags:-g // debugger:set print pretty off // debugger:rbreak zzz // debugger:run diff --git a/src/test/debug-info/method-on-enum.rs b/src/test/debug-info/method-on-enum.rs index 79594c5d3895d..e0ff04ed0bcab 100644 --- a/src/test/debug-info/method-on-enum.rs +++ b/src/test/debug-info/method-on-enum.rs @@ -10,7 +10,7 @@ // xfail-android: FIXME(#10381) -// compile-flags:-Z extra-debug-info +// compile-flags:-g // debugger:rbreak zzz // debugger:run diff --git a/src/test/debug-info/method-on-generic-struct.rs b/src/test/debug-info/method-on-generic-struct.rs index fc78aba707fe5..a9179ed395fba 100644 --- a/src/test/debug-info/method-on-generic-struct.rs +++ b/src/test/debug-info/method-on-generic-struct.rs @@ -10,7 +10,7 @@ // xfail-android: FIXME(#10381) -// compile-flags:-Z extra-debug-info +// compile-flags:-g // debugger:rbreak zzz // debugger:run diff --git a/src/test/debug-info/method-on-struct.rs b/src/test/debug-info/method-on-struct.rs index 035ebf9caebd3..ca7f472f9777c 100644 --- a/src/test/debug-info/method-on-struct.rs +++ b/src/test/debug-info/method-on-struct.rs @@ -10,7 +10,7 @@ // xfail-android: FIXME(#10381) -// compile-flags:-Z extra-debug-info +// compile-flags:-g // debugger:rbreak zzz // debugger:run diff --git a/src/test/debug-info/method-on-trait.rs b/src/test/debug-info/method-on-trait.rs index 7cd5a845cba14..5b7c8b8562323 100644 --- a/src/test/debug-info/method-on-trait.rs +++ b/src/test/debug-info/method-on-trait.rs @@ -10,7 +10,7 @@ // xfail-android: FIXME(#10381) -// compile-flags:-Z extra-debug-info +// compile-flags:-g // debugger:rbreak zzz // debugger:run diff --git a/src/test/debug-info/method-on-tuple-struct.rs b/src/test/debug-info/method-on-tuple-struct.rs index 029a5cd4c913a..ac2991171c655 100644 --- a/src/test/debug-info/method-on-tuple-struct.rs +++ b/src/test/debug-info/method-on-tuple-struct.rs @@ -10,7 +10,7 @@ // xfail-android: FIXME(#10381) -// compile-flags:-Z extra-debug-info +// compile-flags:-g // debugger:rbreak zzz // debugger:run diff --git a/src/test/debug-info/multiple-functions-equal-var-names.rs b/src/test/debug-info/multiple-functions-equal-var-names.rs index 29a7de4a3169c..e6b16adc3862b 100644 --- a/src/test/debug-info/multiple-functions-equal-var-names.rs +++ b/src/test/debug-info/multiple-functions-equal-var-names.rs @@ -10,7 +10,7 @@ // xfail-android: FIXME(#10381) -// compile-flags:-Z extra-debug-info +// compile-flags:-g // debugger:rbreak zzz // debugger:run // debugger:finish diff --git a/src/test/debug-info/multiple-functions.rs b/src/test/debug-info/multiple-functions.rs index f5abe6e249d71..dc22296baad60 100644 --- a/src/test/debug-info/multiple-functions.rs +++ b/src/test/debug-info/multiple-functions.rs @@ -10,7 +10,7 @@ // xfail-android: FIXME(#10381) -// compile-flags:-Z extra-debug-info +// compile-flags:-g // debugger:rbreak zzz // debugger:run // debugger:finish diff --git a/src/test/debug-info/name-shadowing-and-scope-nesting.rs b/src/test/debug-info/name-shadowing-and-scope-nesting.rs index e8c7812eb0957..db154ff599c87 100644 --- a/src/test/debug-info/name-shadowing-and-scope-nesting.rs +++ b/src/test/debug-info/name-shadowing-and-scope-nesting.rs @@ -10,7 +10,7 @@ // xfail-android: FIXME(#10381) -// compile-flags:-Z extra-debug-info +// compile-flags:-g // debugger:rbreak zzz // debugger:run diff --git a/src/test/debug-info/nil-enum.rs b/src/test/debug-info/nil-enum.rs index fc114a79ad65b..3fa596285c6b9 100644 --- a/src/test/debug-info/nil-enum.rs +++ b/src/test/debug-info/nil-enum.rs @@ -10,7 +10,7 @@ // xfail-android: FIXME(#10381) -// compile-flags:-Z extra-debug-info +// compile-flags:-g // debugger:rbreak zzz // debugger:run // debugger:finish diff --git a/src/test/debug-info/option-like-enum.rs b/src/test/debug-info/option-like-enum.rs index c263d1155093e..a634eba285092 100644 --- a/src/test/debug-info/option-like-enum.rs +++ b/src/test/debug-info/option-like-enum.rs @@ -10,7 +10,7 @@ // xfail-android: FIXME(#10381) -// compile-flags:-Z extra-debug-info +// compile-flags:-g // debugger:rbreak zzz // debugger:run // debugger:finish diff --git a/src/test/debug-info/packed-struct-with-destructor.rs b/src/test/debug-info/packed-struct-with-destructor.rs index 5e6480fa8c560..59b65e1119c92 100644 --- a/src/test/debug-info/packed-struct-with-destructor.rs +++ b/src/test/debug-info/packed-struct-with-destructor.rs @@ -11,7 +11,7 @@ // 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 diff --git a/src/test/debug-info/packed-struct.rs b/src/test/debug-info/packed-struct.rs index 795b9d275dd78..0d3883f1102e2 100644 --- a/src/test/debug-info/packed-struct.rs +++ b/src/test/debug-info/packed-struct.rs @@ -11,7 +11,7 @@ // 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 diff --git a/src/test/debug-info/recursive-enum.rs b/src/test/debug-info/recursive-enum.rs index 4bdc9994c439f..0e3205838de5d 100644 --- a/src/test/debug-info/recursive-enum.rs +++ b/src/test/debug-info/recursive-enum.rs @@ -10,7 +10,7 @@ // 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 diff --git a/src/test/debug-info/recursive-struct.rs b/src/test/debug-info/recursive-struct.rs index cf693d7e35623..4119549010c55 100644 --- a/src/test/debug-info/recursive-struct.rs +++ b/src/test/debug-info/recursive-struct.rs @@ -12,7 +12,7 @@ #[feature(managed_boxes)]; -// compile-flags:-Z extra-debug-info +// compile-flags:-g // debugger:set print pretty off // debugger:rbreak zzz // debugger:run diff --git a/src/test/debug-info/self-in-default-method.rs b/src/test/debug-info/self-in-default-method.rs index 9f0b0ea84142d..e2e9766a4b52d 100644 --- a/src/test/debug-info/self-in-default-method.rs +++ b/src/test/debug-info/self-in-default-method.rs @@ -10,7 +10,7 @@ // xfail-android: FIXME(#10381) -// compile-flags:-Z extra-debug-info +// compile-flags:-g // debugger:rbreak zzz // debugger:run diff --git a/src/test/debug-info/self-in-generic-default-method.rs b/src/test/debug-info/self-in-generic-default-method.rs index 5ae88b3d0ce38..bc2570f1a371a 100644 --- a/src/test/debug-info/self-in-generic-default-method.rs +++ b/src/test/debug-info/self-in-generic-default-method.rs @@ -10,7 +10,7 @@ // xfail-android: FIXME(#10381) -// compile-flags:-Z extra-debug-info +// compile-flags:-g // debugger:rbreak zzz // debugger:run diff --git a/src/test/debug-info/shadowed-argument.rs b/src/test/debug-info/shadowed-argument.rs index 7bd77d22a2f7c..85e917c091c49 100644 --- a/src/test/debug-info/shadowed-argument.rs +++ b/src/test/debug-info/shadowed-argument.rs @@ -10,7 +10,7 @@ // xfail-android: FIXME(#10381) -// compile-flags:-Z extra-debug-info +// compile-flags:-g // debugger:rbreak zzz // debugger:run diff --git a/src/test/debug-info/shadowed-variable.rs b/src/test/debug-info/shadowed-variable.rs index 9055487aaa712..b21e59283ad4d 100644 --- a/src/test/debug-info/shadowed-variable.rs +++ b/src/test/debug-info/shadowed-variable.rs @@ -10,7 +10,7 @@ // xfail-android: FIXME(#10381) -// compile-flags:-Z extra-debug-info +// compile-flags:-g // debugger:rbreak zzz // debugger:run diff --git a/src/test/debug-info/simple-lexical-scope.rs b/src/test/debug-info/simple-lexical-scope.rs index 6d79d4d813ffa..9b4fa3c5c2a97 100644 --- a/src/test/debug-info/simple-lexical-scope.rs +++ b/src/test/debug-info/simple-lexical-scope.rs @@ -10,7 +10,7 @@ // xfail-android: FIXME(#10381) -// compile-flags:-Z extra-debug-info +// compile-flags:-g // debugger:rbreak zzz // debugger:run diff --git a/src/test/debug-info/simple-struct.rs b/src/test/debug-info/simple-struct.rs index 8d50149a2844d..3bc6ce70a7178 100644 --- a/src/test/debug-info/simple-struct.rs +++ b/src/test/debug-info/simple-struct.rs @@ -10,7 +10,7 @@ // xfail-android: FIXME(#10381) -// compile-flags:-Z extra-debug-info +// compile-flags:-g // debugger:set print pretty off // debugger:rbreak zzz // debugger:run diff --git a/src/test/debug-info/simple-tuple.rs b/src/test/debug-info/simple-tuple.rs index 71685c8068200..e99a4234df0e1 100644 --- a/src/test/debug-info/simple-tuple.rs +++ b/src/test/debug-info/simple-tuple.rs @@ -10,7 +10,7 @@ // xfail-android: FIXME(#10381) -// compile-flags:-Z extra-debug-info +// compile-flags:-g // debugger:set print pretty off // debugger:rbreak zzz // debugger:run diff --git a/src/test/debug-info/static-method-on-struct-and-enum.rs b/src/test/debug-info/static-method-on-struct-and-enum.rs index b56f6267a8d5c..fd94faeb7c217 100644 --- a/src/test/debug-info/static-method-on-struct-and-enum.rs +++ b/src/test/debug-info/static-method-on-struct-and-enum.rs @@ -10,7 +10,7 @@ // xfail-android: FIXME(#10381) -// compile-flags:-Z extra-debug-info +// compile-flags:-g // debugger:rbreak zzz // debugger:run diff --git a/src/test/debug-info/struct-in-enum.rs b/src/test/debug-info/struct-in-enum.rs index b706ad1c38cc4..01a8233a96e87 100644 --- a/src/test/debug-info/struct-in-enum.rs +++ b/src/test/debug-info/struct-in-enum.rs @@ -11,7 +11,7 @@ // 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 diff --git a/src/test/debug-info/struct-in-struct.rs b/src/test/debug-info/struct-in-struct.rs index d46d0b1cd887e..7040448cb35ca 100644 --- a/src/test/debug-info/struct-in-struct.rs +++ b/src/test/debug-info/struct-in-struct.rs @@ -10,7 +10,7 @@ // xfail-android: FIXME(#10381) -// compile-flags:-Z extra-debug-info +// compile-flags:-g // debugger:set print pretty off // debugger:rbreak zzz // debugger:run diff --git a/src/test/debug-info/struct-style-enum.rs b/src/test/debug-info/struct-style-enum.rs index d7804da78941a..a5c1d0e81c6d2 100644 --- a/src/test/debug-info/struct-style-enum.rs +++ b/src/test/debug-info/struct-style-enum.rs @@ -11,7 +11,7 @@ // 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 diff --git a/src/test/debug-info/struct-with-destructor.rs b/src/test/debug-info/struct-with-destructor.rs index febd60614687d..bae094cefd781 100644 --- a/src/test/debug-info/struct-with-destructor.rs +++ b/src/test/debug-info/struct-with-destructor.rs @@ -10,7 +10,7 @@ // xfail-android: FIXME(#10381) -// compile-flags:-Z extra-debug-info +// compile-flags:-g // debugger:rbreak zzz // debugger:run // debugger:finish diff --git a/src/test/debug-info/trait-generic-static-default-method.rs b/src/test/debug-info/trait-generic-static-default-method.rs index 05258d5358684..429f2e77deb5d 100644 --- a/src/test/debug-info/trait-generic-static-default-method.rs +++ b/src/test/debug-info/trait-generic-static-default-method.rs @@ -10,7 +10,7 @@ // 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 diff --git a/src/test/debug-info/trait-pointers.rs b/src/test/debug-info/trait-pointers.rs index de46e1aea5822..ef34c50bbf7b2 100644 --- a/src/test/debug-info/trait-pointers.rs +++ b/src/test/debug-info/trait-pointers.rs @@ -10,7 +10,7 @@ // xfail-android: FIXME(#10381) -// compile-flags:-Z extra-debug-info +// compile-flags:-g // debugger:run #[allow(unused_variable)]; diff --git a/src/test/debug-info/tuple-in-struct.rs b/src/test/debug-info/tuple-in-struct.rs index b60f21fe6ce8c..81b0348bed0f4 100644 --- a/src/test/debug-info/tuple-in-struct.rs +++ b/src/test/debug-info/tuple-in-struct.rs @@ -10,7 +10,7 @@ // xfail-android: FIXME(#10381) -// compile-flags:-Z extra-debug-info +// compile-flags:-g // debugger:set print pretty off // debugger:rbreak zzz // debugger:run diff --git a/src/test/debug-info/tuple-in-tuple.rs b/src/test/debug-info/tuple-in-tuple.rs index 76475109382c6..19c331079b909 100644 --- a/src/test/debug-info/tuple-in-tuple.rs +++ b/src/test/debug-info/tuple-in-tuple.rs @@ -10,7 +10,7 @@ // xfail-android: FIXME(#10381) -// compile-flags:-Z extra-debug-info +// compile-flags:-g // debugger:set print pretty off // debugger:rbreak zzz // debugger:run diff --git a/src/test/debug-info/tuple-struct.rs b/src/test/debug-info/tuple-struct.rs index 2d571ef41607a..1993fe91b733c 100644 --- a/src/test/debug-info/tuple-struct.rs +++ b/src/test/debug-info/tuple-struct.rs @@ -10,7 +10,7 @@ // xfail-android: FIXME(#10381) -// compile-flags:-Z extra-debug-info +// compile-flags:-g // debugger:set print pretty off // debugger:rbreak zzz // debugger:run diff --git a/src/test/debug-info/tuple-style-enum.rs b/src/test/debug-info/tuple-style-enum.rs index c9d577a24917e..fb90fe5c138de 100644 --- a/src/test/debug-info/tuple-style-enum.rs +++ b/src/test/debug-info/tuple-style-enum.rs @@ -11,7 +11,7 @@ // 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 diff --git a/src/test/debug-info/unique-enum.rs b/src/test/debug-info/unique-enum.rs index 647a6e55f9857..f0383b97dd0f7 100644 --- a/src/test/debug-info/unique-enum.rs +++ b/src/test/debug-info/unique-enum.rs @@ -10,7 +10,7 @@ // xfail-android: FIXME(#10381) -// compile-flags:-Z extra-debug-info +// compile-flags:-g // debugger:rbreak zzz // debugger:run // debugger:finish diff --git a/src/test/debug-info/var-captured-in-nested-closure.rs b/src/test/debug-info/var-captured-in-nested-closure.rs index 1032356689f30..dc586afaa2425 100644 --- a/src/test/debug-info/var-captured-in-nested-closure.rs +++ b/src/test/debug-info/var-captured-in-nested-closure.rs @@ -11,7 +11,7 @@ // xfail-win32: FIXME #10474 // xfail-android: FIXME(#10381) -// compile-flags:-Z extra-debug-info +// compile-flags:-g // debugger:rbreak zzz // debugger:run // debugger:finish diff --git a/src/test/debug-info/var-captured-in-sendable-closure.rs b/src/test/debug-info/var-captured-in-sendable-closure.rs index 82ef467925a3a..e9b8dc4662515 100644 --- a/src/test/debug-info/var-captured-in-sendable-closure.rs +++ b/src/test/debug-info/var-captured-in-sendable-closure.rs @@ -10,7 +10,7 @@ // xfail-android: FIXME(#10381) -// compile-flags:-Z extra-debug-info +// compile-flags:-g // debugger:rbreak zzz // debugger:run // debugger:finish diff --git a/src/test/debug-info/var-captured-in-stack-closure.rs b/src/test/debug-info/var-captured-in-stack-closure.rs index 53287a8511bce..092f7ee443e15 100644 --- a/src/test/debug-info/var-captured-in-stack-closure.rs +++ b/src/test/debug-info/var-captured-in-stack-closure.rs @@ -10,7 +10,7 @@ // xfail-android: FIXME(#10381) -// compile-flags:-Z extra-debug-info +// compile-flags:-g // debugger:rbreak zzz // debugger:run // debugger:finish diff --git a/src/test/debug-info/vec-slices.rs b/src/test/debug-info/vec-slices.rs index 635608604b133..00e0e0fa78310 100644 --- a/src/test/debug-info/vec-slices.rs +++ b/src/test/debug-info/vec-slices.rs @@ -10,7 +10,7 @@ // xfail-android: FIXME(#10381) -// compile-flags:-Z extra-debug-info +// compile-flags:-g // debugger:set print pretty off // debugger:rbreak zzz // debugger:run diff --git a/src/test/debug-info/vec.rs b/src/test/debug-info/vec.rs index b1224d14dc474..6806e2f2b3d5b 100644 --- a/src/test/debug-info/vec.rs +++ b/src/test/debug-info/vec.rs @@ -10,7 +10,7 @@ // xfail-android: FIXME(#10381) -// compile-flags:-Z extra-debug-info +// compile-flags:-g // debugger:set print pretty off // debugger:rbreak zzz // debugger:run diff --git a/src/test/run-make/bootstrap-from-c-with-green/Makefile b/src/test/run-make/bootstrap-from-c-with-green/Makefile index 7f466573da730..9a198977aa384 100644 --- a/src/test/run-make/bootstrap-from-c-with-green/Makefile +++ b/src/test/run-make/bootstrap-from-c-with-green/Makefile @@ -1,7 +1,7 @@ -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) diff --git a/src/test/run-make/bootstrap-from-c-with-native/Makefile b/src/test/run-make/bootstrap-from-c-with-native/Makefile index 7f466573da730..9a198977aa384 100644 --- a/src/test/run-make/bootstrap-from-c-with-native/Makefile +++ b/src/test/run-make/bootstrap-from-c-with-native/Makefile @@ -1,7 +1,7 @@ -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) diff --git a/src/test/run-make/c-link-to-rust-staticlib/Makefile b/src/test/run-make/c-link-to-rust-staticlib/Makefile index a81f19d6eb36b..6fa5369015bbb 100644 --- a/src/test/run-make/c-link-to-rust-staticlib/Makefile +++ b/src/test/run-make/c-link-to-rust-staticlib/Makefile @@ -5,9 +5,9 @@ ifneq ($(shell uname),Darwin) 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) diff --git a/src/test/run-make/lto-smoke-c/Makefile b/src/test/run-make/lto-smoke-c/Makefile index a491fda7dc232..af120c9baebba 100644 --- a/src/test/run-make/lto-smoke-c/Makefile +++ b/src/test/run-make/lto-smoke-c/Makefile @@ -5,7 +5,7 @@ ifneq ($(shell uname),Darwin) 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) diff --git a/src/test/run-make/mixing-deps/Makefile b/src/test/run-make/mixing-deps/Makefile index 9ab2abca72952..76106ada14487 100644 --- a/src/test/run-make/mixing-deps/Makefile +++ b/src/test/run-make/mixing-deps/Makefile @@ -2,6 +2,6 @@ all: $(RUSTC) both.rs - $(RUSTC) dylib.rs -Z prefer-dynamic + $(RUSTC) dylib.rs -C prefer-dynamic $(RUSTC) prog.rs $(call RUN,prog) diff --git a/src/test/run-make/prefer-dylib/Makefile b/src/test/run-make/prefer-dylib/Makefile index 6fb7434e68ab3..38759b2f52490 100644 --- a/src/test/run-make/prefer-dylib/Makefile +++ b/src/test/run-make/prefer-dylib/Makefile @@ -2,7 +2,7 @@ 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) diff --git a/src/test/run-make/prune-link-args/Makefile b/src/test/run-make/prune-link-args/Makefile index 53699e0dd984a..ea7fa06f5ef19 100644 --- a/src/test/run-make/prune-link-args/Makefile +++ b/src/test/run-make/prune-link-args/Makefile @@ -1,6 +1,6 @@ -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 diff --git a/src/test/run-pass/issue-7712.rs b/src/test/run-pass/issue-7712.rs index fa7d68cf921fd..f91112416e372 100644 --- a/src/test/run-pass/issue-7712.rs +++ b/src/test/run-pass/issue-7712.rs @@ -8,7 +8,7 @@ // 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) {