diff --git a/configure b/configure index 59aa6ece6b2..135bdcd3782 100755 --- a/configure +++ b/configure @@ -418,7 +418,7 @@ opt ccache 0 "invoke gcc/clang via ccache to reuse object files between builds" opt local-rust 0 "use an installed rustc rather than downloading a snapshot" opt inject-std-version 1 "inject the current compiler version of libstd into programs" opt llvm-static-stdcpp 0 "statically link to libstdc++ for LLVM" -opt rpath 1 "build rpaths into rustc itself" +opt rpath 0 "build rpaths into rustc itself" opt nightly 0 "build nightly packages" opt verify-install 1 "verify installed binaries work" opt jemalloc 1 "build liballoc with jemalloc" diff --git a/man/rustc.1 b/man/rustc.1 index df65cf7bb37..2484960cac6 100644 --- a/man/rustc.1 +++ b/man/rustc.1 @@ -138,8 +138,8 @@ A space-separated list of arguments to pass through to LLVM. If specified, the compiler will save more files (.bc, .o, .no-opt.bc) generated throughout compilation in the output directory. .TP -\fBno-rpath\fR -If specified, then the rpath value for dynamic libraries will not be set in +\fBrpath\fR +If specified, then the rpath value for dynamic libraries will be set in either dynamic library or executable outputs. .TP \fBno-prepopulate-passes\fR diff --git a/mk/main.mk b/mk/main.mk index c01410a591b..7400b39c968 100644 --- a/mk/main.mk +++ b/mk/main.mk @@ -122,8 +122,8 @@ endif ifdef TRACE CFG_RUSTC_FLAGS += -Z trace endif -ifdef CFG_DISABLE_RPATH -CFG_RUSTC_FLAGS += -C no-rpath +ifdef CFG_ENABLE_RPATH +CFG_RUSTC_FLAGS += -C rpath endif # The executables crated during this compilation process have no need to include diff --git a/src/librustc/back/link.rs b/src/librustc/back/link.rs index 4f915342ee0..e2264088b4a 100644 --- a/src/librustc/back/link.rs +++ b/src/librustc/back/link.rs @@ -1363,7 +1363,7 @@ fn link_args(cmd: &mut Command, if sess.targ_cfg.os == abi::OsMacos { cmd.args(["-dynamiclib", "-Wl,-dylib"]); - if !sess.opts.cg.no_rpath { + if sess.opts.cg.rpath { let mut v = Vec::from_slice("-Wl,-install_name,@rpath/".as_bytes()); v.push_all(out_filename.filename().unwrap()); cmd.arg(v.as_slice()); @@ -1382,7 +1382,7 @@ fn link_args(cmd: &mut Command, // 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.cg.no_rpath { + if sess.opts.cg.rpath { cmd.args(rpath::get_rpath_flags(sess, out_filename).as_slice()); } diff --git a/src/librustc/driver/config.rs b/src/librustc/driver/config.rs index e91dfd9587b..9daaa2792eb 100644 --- a/src/librustc/driver/config.rs +++ b/src/librustc/driver/config.rs @@ -306,8 +306,8 @@ cgoptions!( "a list of arguments to pass to llvm (space separated)"), save_temps: bool = (false, parse_bool, "save all temporary output files during compilation"), - no_rpath: bool = (false, parse_bool, - "disables setting the rpath in libs/exes"), + rpath: bool = (false, parse_bool, + "set rpath values 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,