mirror of
https://github.com/rust-lang/rust.git
synced 2026-06-01 14:10:03 +03:00
For VxWorks:
fix building errors use wr-c++ as linker
This commit is contained in:
@@ -132,7 +132,8 @@ pub fn find(build: &mut Build) {
|
||||
false
|
||||
};
|
||||
|
||||
if cxx_configured {
|
||||
// for VxWorks, record CXX compiler which will be used in lib.rs:linker()
|
||||
if cxx_configured || target.contains("vxworks") {
|
||||
let compiler = cfg.get_compiler();
|
||||
build.cxx.insert(target, compiler);
|
||||
}
|
||||
|
||||
@@ -857,6 +857,10 @@ fn linker(&self, target: TargetSelection, can_use_lld: bool) -> Option<&Path> {
|
||||
if let Some(linker) = self.config.target_config.get(&target).and_then(|c| c.linker.as_ref())
|
||||
{
|
||||
Some(linker)
|
||||
} else if target.contains("vxworks") {
|
||||
// need to use CXX compiler as linker to resolve the exception functions
|
||||
// that are only existed in CXX libraries
|
||||
Some(self.cxx[&target].path())
|
||||
} else if target != self.config.build
|
||||
&& util::use_host_linker(target)
|
||||
&& !target.contains("msvc")
|
||||
|
||||
Reference in New Issue
Block a user