Permalink
Browse files

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
  • Loading branch information...
1 parent 2780d9d commit 071ee96277845af99bde5e7e15ccbb0cff9be0a7 @alexcrichton alexcrichton committed Feb 7, 2014
Showing with 393 additions and 302 deletions.
  1. +1 −1 Makefile.in
  2. +76 −22 man/rustc.1
  3. +2 −2 mk/platform.mk
  4. +1 −1 mk/tests.mk
  5. +3 −3 src/compiletest/runtest.rs
  6. +1 −1 src/doc/rust.md
  7. +23 −23 src/librustc/back/link.rs
  8. +1 −1 src/librustc/back/lto.rs
  9. +39 −70 src/librustc/driver/driver.rs
  10. +109 −66 src/librustc/driver/session.rs
  11. +25 −3 src/librustc/lib.rs
  12. +2 −2 src/librustc/middle/trans/_match.rs
  13. +3 −3 src/librustc/middle/trans/base.rs
  14. +1 −1 src/librustc/middle/trans/closure.rs
  15. +1 −1 src/librustc/middle/trans/context.rs
  16. +1 −1 src/librustc/middle/trans/controlflow.rs
  17. +5 −5 src/librustc/middle/trans/debuginfo.rs
  18. +4 −1 src/librustdoc/test.rs
  19. +1 −1 src/test/compile-fail/issue-10755.rs
  20. +1 −1 src/test/compile-fail/issue-11154.rs
  21. +1 −1 src/test/debug-info/basic-types-metadata.rs
  22. +1 −1 src/test/debug-info/basic-types.rs
  23. +1 −1 src/test/debug-info/borrowed-basic.rs
  24. +1 −1 src/test/debug-info/borrowed-c-style-enum.rs
  25. +1 −1 src/test/debug-info/borrowed-enum.rs
  26. +1 −1 src/test/debug-info/borrowed-managed-basic.rs
  27. +1 −1 src/test/debug-info/borrowed-struct.rs
  28. +1 −1 src/test/debug-info/borrowed-tuple.rs
  29. +1 −1 src/test/debug-info/borrowed-unique-basic.rs
  30. +1 −1 src/test/debug-info/box.rs
  31. +1 −1 src/test/debug-info/boxed-struct.rs
  32. +1 −1 src/test/debug-info/boxed-vec.rs
  33. +1 −1 src/test/debug-info/by-value-non-immediate-argument.rs
  34. +1 −1 src/test/debug-info/by-value-self-argument-in-trait-impl.rs
  35. +1 −1 src/test/debug-info/c-style-enum-in-composite.rs
  36. +1 −1 src/test/debug-info/c-style-enum.rs
  37. +1 −1 src/test/debug-info/closure-in-generic-function.rs
  38. +1 −1 src/test/debug-info/destructured-fn-argument.rs
  39. +1 −1 src/test/debug-info/destructured-local.rs
  40. +1 −1 src/test/debug-info/evec-in-struct.rs
  41. +1 −1 src/test/debug-info/function-arg-initialization.rs
  42. +1 −1 src/test/debug-info/function-arguments.rs
  43. +1 −1 src/test/debug-info/function-prologue-stepping-no-split-stack.rs
  44. +1 −1 src/test/debug-info/generic-function.rs
  45. +1 −1 src/test/debug-info/generic-functions-nested.rs
  46. +1 −1 src/test/debug-info/generic-method-on-generic-struct.rs
  47. +1 −1 src/test/debug-info/generic-static-method-on-struct-and-enum.rs
  48. +1 −1 src/test/debug-info/generic-struct-style-enum.rs
  49. +1 −1 src/test/debug-info/generic-struct.rs
  50. +1 −1 src/test/debug-info/generic-trait-generic-static-default-method.rs
  51. +1 −1 src/test/debug-info/generic-tuple-style-enum.rs
  52. +1 −1 src/test/debug-info/include_string.rs
  53. +1 −1 src/test/debug-info/issue11600.rs
  54. +1 −1 src/test/debug-info/lexical-scope-in-for-loop.rs
  55. +1 −1 src/test/debug-info/lexical-scope-in-if.rs
  56. +1 −1 src/test/debug-info/lexical-scope-in-match.rs
  57. +1 −1 src/test/debug-info/lexical-scope-in-parameterless-closure.rs
  58. +1 −1 src/test/debug-info/lexical-scope-in-stack-closure.rs
  59. +1 −1 src/test/debug-info/lexical-scope-in-unconditional-loop.rs
  60. +1 −1 src/test/debug-info/lexical-scope-in-unique-closure.rs
  61. +1 −1 src/test/debug-info/lexical-scope-in-while.rs
  62. +1 −1 src/test/debug-info/lexical-scope-with-macro.rs
  63. +1 −1 src/test/debug-info/lexical-scopes-in-block-expression.rs
  64. +1 −1 src/test/debug-info/managed-enum.rs
  65. +1 −1 src/test/debug-info/managed-pointer-within-unique-vec.rs
  66. +1 −1 src/test/debug-info/managed-pointer-within-unique.rs
  67. +1 −1 src/test/debug-info/method-on-enum.rs
  68. +1 −1 src/test/debug-info/method-on-generic-struct.rs
  69. +1 −1 src/test/debug-info/method-on-struct.rs
  70. +1 −1 src/test/debug-info/method-on-trait.rs
  71. +1 −1 src/test/debug-info/method-on-tuple-struct.rs
  72. +1 −1 src/test/debug-info/multiple-functions-equal-var-names.rs
  73. +1 −1 src/test/debug-info/multiple-functions.rs
  74. +1 −1 src/test/debug-info/name-shadowing-and-scope-nesting.rs
  75. +1 −1 src/test/debug-info/nil-enum.rs
  76. +1 −1 src/test/debug-info/option-like-enum.rs
  77. +1 −1 src/test/debug-info/packed-struct-with-destructor.rs
  78. +1 −1 src/test/debug-info/packed-struct.rs
  79. +1 −1 src/test/debug-info/recursive-enum.rs
  80. +1 −1 src/test/debug-info/recursive-struct.rs
  81. +1 −1 src/test/debug-info/self-in-default-method.rs
  82. +1 −1 src/test/debug-info/self-in-generic-default-method.rs
  83. +1 −1 src/test/debug-info/shadowed-argument.rs
  84. +1 −1 src/test/debug-info/shadowed-variable.rs
  85. +1 −1 src/test/debug-info/simple-lexical-scope.rs
  86. +1 −1 src/test/debug-info/simple-struct.rs
  87. +1 −1 src/test/debug-info/simple-tuple.rs
  88. +1 −1 src/test/debug-info/static-method-on-struct-and-enum.rs
  89. +1 −1 src/test/debug-info/struct-in-enum.rs
  90. +1 −1 src/test/debug-info/struct-in-struct.rs
  91. +1 −1 src/test/debug-info/struct-style-enum.rs
  92. +1 −1 src/test/debug-info/struct-with-destructor.rs
  93. +1 −1 src/test/debug-info/trait-generic-static-default-method.rs
  94. +1 −1 src/test/debug-info/trait-pointers.rs
  95. +1 −1 src/test/debug-info/tuple-in-struct.rs
  96. +1 −1 src/test/debug-info/tuple-in-tuple.rs
  97. +1 −1 src/test/debug-info/tuple-struct.rs
  98. +1 −1 src/test/debug-info/tuple-style-enum.rs
  99. +1 −1 src/test/debug-info/unique-enum.rs
  100. +1 −1 src/test/debug-info/var-captured-in-nested-closure.rs
  101. +1 −1 src/test/debug-info/var-captured-in-sendable-closure.rs
  102. +1 −1 src/test/debug-info/var-captured-in-stack-closure.rs
  103. +1 −1 src/test/debug-info/vec-slices.rs
  104. +1 −1 src/test/debug-info/vec.rs
  105. +1 −1 src/test/run-make/bootstrap-from-c-with-green/Makefile
  106. +1 −1 src/test/run-make/bootstrap-from-c-with-native/Makefile
  107. +2 −2 src/test/run-make/c-link-to-rust-staticlib/Makefile
  108. +1 −1 src/test/run-make/lto-smoke-c/Makefile
  109. +1 −1 src/test/run-make/mixing-deps/Makefile
  110. +1 −1 src/test/run-make/prefer-dylib/Makefile
  111. +1 −1 src/test/run-make/prune-link-args/Makefile
  112. +1 −1 src/test/run-pass/issue-7712.rs
View
@@ -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
View
@@ -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 <filename>. 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 <dir>. 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"
View
@@ -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-
View
@@ -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
@@ -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);
View
@@ -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
View
@@ -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
Oops, something went wrong.

5 comments on commit 071ee96

Contributor

bors replied Feb 10, 2014

saw approval from cmr
at alexcrichton/rust@071ee96

Contributor

bors replied Feb 10, 2014

merging alexcrichton/rust/codegen-opts = 071ee96 into auto

Contributor

bors replied Feb 10, 2014

alexcrichton/rust/codegen-opts = 071ee96 merged ok, testing candidate = d440a56

Contributor

bors replied Feb 10, 2014

fast-forwarding master to auto = d440a56

Please sign in to comment.