about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorPang, Baoshan <Baoshan.Pang@windriver.com>2020-08-07 16:55:15 -0700
committerPang, Baoshan <Baoshan.Pang@windriver.com>2020-08-25 12:09:39 -0700
commit079baafdf1fc90805373ff2ef7d57eea3a7f15ce (patch)
tree781738862112e135045051f97e4bbbb290a88521 /src
parente15510ca33ea15c893b78710101c962b11459963 (diff)
downloadrust-079baafdf1fc90805373ff2ef7d57eea3a7f15ce.tar.gz
rust-079baafdf1fc90805373ff2ef7d57eea3a7f15ce.zip
For VxWorks:
fix building errors
use wr-c++ as linker
Diffstat (limited to 'src')
-rw-r--r--src/bootstrap/cc_detect.rs3
-rw-r--r--src/bootstrap/lib.rs4
2 files changed, 6 insertions, 1 deletions
diff --git a/src/bootstrap/cc_detect.rs b/src/bootstrap/cc_detect.rs
index 7ff00d85dd2..d50e4cf5269 100644
--- a/src/bootstrap/cc_detect.rs
+++ b/src/bootstrap/cc_detect.rs
@@ -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);
         }
diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs
index 77820ef87e3..c93df8d5149 100644
--- a/src/bootstrap/lib.rs
+++ b/src/bootstrap/lib.rs
@@ -857,6 +857,10 @@ impl Build {
         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")