diff --git a/src/bootstrap/src/core/build_steps/llvm.rs b/src/bootstrap/src/core/build_steps/llvm.rs index 24f6cf965bf43..13809b35ecd52 100644 --- a/src/bootstrap/src/core/build_steps/llvm.rs +++ b/src/bootstrap/src/core/build_steps/llvm.rs @@ -1212,6 +1212,9 @@ impl Step for Lld { // `$ORIGIN` would otherwise be expanded when the `LdFlags` are passed verbatim to // cmake. ldflags.push_all("-Wl,-rpath,'$ORIGIN/../../../'"); + } else { + // CMake defaults to building executables with rpath enabled. + cfg.define("CMAKE_SKIP_RPATH", "ON"); } configure_cmake(builder, target, &mut cfg, true, ldflags, &[]);