]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_back/target/mod.rs
Add support for the Haiku operating system on x86 and x86_64 machines
[rust.git] / src / librustc_back / target / mod.rs
index d48370b23b69d6cb8479f9ea1ce348c78614907c..493466c25e0f5b4b6b9ea2524b2d9cf303c0bccc 100644 (file)
@@ -77,12 +77,12 @@ fn load_specific(target: &str) -> TargetResult {
             match target {
                 $(
                     $triple => {
-                        let mut t = try!($module::target());
+                        let mut t = $module::target()?;
                         t.options.is_builtin = true;
 
                         // round-trip through the JSON parser to ensure at
                         // run-time that the parser works correctly
-                        t = try!(Target::from_json(t.to_json()));
+                        t = Target::from_json(t.to_json())?;
                         debug!("Got builtin target: {:?}", t);
                         Ok(t)
                     },
@@ -165,6 +165,9 @@ fn $module() {
     ("x86_64-unknown-netbsd", x86_64_unknown_netbsd),
     ("x86_64-rumprun-netbsd", x86_64_rumprun_netbsd),
 
+    ("i686_unknown_haiku", i686_unknown_haiku),
+    ("x86_64_unknown_haiku", x86_64_unknown_haiku),
+
     ("x86_64-apple-darwin", x86_64_apple_darwin),
     ("i686-apple-darwin", i686_apple_darwin),
 
@@ -306,9 +309,6 @@ pub struct TargetOptions {
     pub allows_weak_linkage: bool,
     /// Whether the linker support rpaths or not. Defaults to false.
     pub has_rpath: bool,
-    /// Whether to disable linking to compiler-rt. Defaults to false, as LLVM
-    /// will emit references to the functions that compiler-rt provides.
-    pub no_compiler_rt: bool,
     /// Whether to disable linking to the default libraries, typically corresponds
     /// to `-nodefaultlibs`. Defaults to true.
     pub no_default_libraries: bool,
@@ -381,7 +381,6 @@ fn default() -> TargetOptions {
             linker_is_gnu: false,
             allows_weak_linkage: true,
             has_rpath: false,
-            no_compiler_rt: false,
             no_default_libraries: true,
             position_independent_executables: false,
             pre_link_objects_exe: Vec::new(),
@@ -442,12 +441,12 @@ pub fn from_json(obj: Json) -> TargetResult {
         };
 
         let mut base = Target {
-            llvm_target: try!(get_req_field("llvm-target")),
-            target_endian: try!(get_req_field("target-endian")),
-            target_pointer_width: try!(get_req_field("target-pointer-width")),
-            data_layout: try!(get_req_field("data-layout")),
-            arch: try!(get_req_field("arch")),
-            target_os: try!(get_req_field("os")),
+            llvm_target: get_req_field("llvm-target")?,
+            target_endian: get_req_field("target-endian")?,
+            target_pointer_width: get_req_field("target-pointer-width")?,
+            data_layout: get_req_field("data-layout")?,
+            arch: get_req_field("arch")?,
+            target_os: get_req_field("os")?,
             target_env: get_opt_field("env", ""),
             target_vendor: get_opt_field("vendor", "unknown"),
             options: Default::default(),
@@ -524,7 +523,6 @@ macro_rules! key {
         key!(linker_is_gnu, bool);
         key!(allows_weak_linkage, bool);
         key!(has_rpath, bool);
-        key!(no_compiler_rt, bool);
         key!(no_default_libraries, bool);
         key!(position_independent_executables, bool);
         key!(archive_format);
@@ -667,7 +665,6 @@ macro_rules! target_option_val {
         target_option_val!(linker_is_gnu);
         target_option_val!(allows_weak_linkage);
         target_option_val!(has_rpath);
-        target_option_val!(no_compiler_rt);
         target_option_val!(no_default_libraries);
         target_option_val!(position_independent_executables);
         target_option_val!(archive_format);