From a42c0257c7ed05558f685a77db0de08379feeef8 Mon Sep 17 00:00:00 2001 From: Marco A L Barbosa Date: Tue, 18 Apr 2017 13:40:00 -0300 Subject: [PATCH 01/17] Add bootstrap support for android --- src/bootstrap/bootstrap.py | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py index 2e33b4511949d..e27f4091b1914 100644 --- a/src/bootstrap/bootstrap.py +++ b/src/bootstrap/bootstrap.py @@ -415,7 +415,11 @@ def build_triple(self): # The goal here is to come up with the same triple as LLVM would, # at least for the subset of platforms we're willing to target. if ostype == 'Linux': - ostype = 'unknown-linux-gnu' + os = subprocess.check_output(['uname', '-o']).strip().decode(default_encoding) + if os == 'Android': + ostype = 'linux-android' + else: + ostype = 'unknown-linux-gnu' elif ostype == 'FreeBSD': ostype = 'unknown-freebsd' elif ostype == 'DragonFly': @@ -472,15 +476,21 @@ def build_triple(self): cputype = 'i686' elif cputype in {'xscale', 'arm'}: cputype = 'arm' + if ostype == 'linux-android': + ostype = 'linux-androideabi' elif cputype == 'armv6l': cputype = 'arm' - ostype += 'eabihf' + if ostype == 'linux-android': + ostype = 'linux-androideabi' + else: + ostype += 'eabihf' elif cputype in {'armv7l', 'armv8l'}: cputype = 'armv7' - ostype += 'eabihf' - elif cputype == 'aarch64': - cputype = 'aarch64' - elif cputype == 'arm64': + if ostype == 'linux-android': + ostype = 'linux-androideabi' + else: + ostype += 'eabihf' + elif cputype in {'aarch64', 'arm64'}: cputype = 'aarch64' elif cputype == 'mips': if sys.byteorder == 'big': From e1afddc29c7a056f855c0523e598c3bda42f4aea Mon Sep 17 00:00:00 2001 From: Jessica Hamilton Date: Sat, 22 Apr 2017 13:47:36 +1200 Subject: [PATCH 02/17] Haiku: fix initial platform support --- src/librustc_back/target/haiku_base.rs | 3 ++- src/librustc_data_structures/flock.rs | 1 + src/libunwind/build.rs | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/librustc_back/target/haiku_base.rs b/src/librustc_back/target/haiku_base.rs index bfdc9faaa8a73..8e7f463563c38 100644 --- a/src/librustc_back/target/haiku_base.rs +++ b/src/librustc_back/target/haiku_base.rs @@ -16,9 +16,10 @@ pub fn opts() -> TargetOptions { linker: "cc".to_string(), dynamic_linking: true, executables: true, - has_rpath: true, + has_rpath: false, target_family: Some("unix".to_string()), linker_is_gnu: true, + no_integrated_as: true, .. Default::default() } } diff --git a/src/librustc_data_structures/flock.rs b/src/librustc_data_structures/flock.rs index 26417e3ba7cd1..32f0fd4199776 100644 --- a/src/librustc_data_structures/flock.rs +++ b/src/librustc_data_structures/flock.rs @@ -113,6 +113,7 @@ mod imp { pub l_sysid: libc::c_int, } + pub const F_RDLCK: libc::c_short = 0x0040; pub const F_UNLCK: libc::c_short = 0x0200; pub const F_WRLCK: libc::c_short = 0x0400; pub const F_SETLK: libc::c_int = 0x0080; diff --git a/src/libunwind/build.rs b/src/libunwind/build.rs index 9b8099d55a024..be9aa6c5d40ba 100644 --- a/src/libunwind/build.rs +++ b/src/libunwind/build.rs @@ -39,5 +39,7 @@ fn main() { println!("cargo:rustc-link-lib=static-nobundle=pthread"); } else if target.contains("fuchsia") { println!("cargo:rustc-link-lib=unwind"); + } else if target.contains("haiku") { + println!("cargo:rustc-link-lib=gcc_s"); } } From f8c6436173f9ccbe79eaf021161f26b601eef026 Mon Sep 17 00:00:00 2001 From: Scott McMurray Date: Sun, 23 Apr 2017 21:47:09 -0700 Subject: [PATCH 03/17] Step::replace_one should put a one, not a zero (Issue #41492) Turns out all six of these impls are incorrect. --- src/libcore/iter/range.rs | 12 ++++++------ src/libcore/tests/iter.rs | 38 ++++++++++++++++++++++++++++++++++++++ src/libcore/tests/lib.rs | 2 ++ 3 files changed, 46 insertions(+), 6 deletions(-) diff --git a/src/libcore/iter/range.rs b/src/libcore/iter/range.rs index 687c477f19e4c..bd831d638c0c4 100644 --- a/src/libcore/iter/range.rs +++ b/src/libcore/iter/range.rs @@ -86,12 +86,12 @@ macro_rules! step_impl_unsigned { #[inline] fn replace_one(&mut self) -> Self { - mem::replace(self, 0) + mem::replace(self, 1) } #[inline] fn replace_zero(&mut self) -> Self { - mem::replace(self, 1) + mem::replace(self, 0) } #[inline] @@ -157,12 +157,12 @@ macro_rules! step_impl_signed { #[inline] fn replace_one(&mut self) -> Self { - mem::replace(self, 0) + mem::replace(self, 1) } #[inline] fn replace_zero(&mut self) -> Self { - mem::replace(self, 1) + mem::replace(self, 0) } #[inline] @@ -206,12 +206,12 @@ macro_rules! step_impl_no_between { #[inline] fn replace_one(&mut self) -> Self { - mem::replace(self, 0) + mem::replace(self, 1) } #[inline] fn replace_zero(&mut self) -> Self { - mem::replace(self, 1) + mem::replace(self, 0) } #[inline] diff --git a/src/libcore/tests/iter.rs b/src/libcore/tests/iter.rs index 08442f9bcbff5..001fa304cd08f 100644 --- a/src/libcore/tests/iter.rs +++ b/src/libcore/tests/iter.rs @@ -1082,3 +1082,41 @@ fn test_chain_fold() { assert_eq!(&[2, 3, 1, 2, 0], &result[..]); } +#[test] +fn test_step_replace_unsigned() { + let mut x = 4u32; + let y = x.replace_zero(); + assert_eq!(x, 0); + assert_eq!(y, 4); + + x = 5; + let y = x.replace_one(); + assert_eq!(x, 1); + assert_eq!(y, 5); +} + +#[test] +fn test_step_replace_signed() { + let mut x = 4i32; + let y = x.replace_zero(); + assert_eq!(x, 0); + assert_eq!(y, 4); + + x = 5; + let y = x.replace_one(); + assert_eq!(x, 1); + assert_eq!(y, 5); +} + +#[test] +fn test_step_replace_no_between() { + let mut x = 4u128; + let y = x.replace_zero(); + assert_eq!(x, 0); + assert_eq!(y, 4); + + x = 5; + let y = x.replace_one(); + assert_eq!(x, 1); + assert_eq!(y, 5); +} \ No newline at end of file diff --git a/src/libcore/tests/lib.rs b/src/libcore/tests/lib.rs index 528ab3bc84523..f0c46a6f194d5 100644 --- a/src/libcore/tests/lib.rs +++ b/src/libcore/tests/lib.rs @@ -20,6 +20,7 @@ #![feature(fixed_size_array)] #![feature(flt2dec)] #![feature(fmt_internals)] +#![feature(i128_type)] #![feature(iter_rfind)] #![feature(libc)] #![feature(nonzero)] @@ -30,6 +31,7 @@ #![feature(sort_internals)] #![feature(sort_unstable)] #![feature(step_by)] +#![feature(step_trait)] #![feature(test)] #![feature(try_from)] #![feature(unicode)] From e4825290223f39647bf2782b9d4ef5f00554c7ee Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Thu, 8 Dec 2016 16:12:38 -0800 Subject: [PATCH 04/17] Fix invalid module suggestion --- src/libsyntax/parse/parser.rs | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 1baf0d1b54ce1..dd32b40554b5d 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -5363,26 +5363,33 @@ impl<'a> Parser<'a> { } let mut err = self.diagnostic().struct_span_err(id_sp, "cannot declare a new module at this location"); - let this_module = match self.directory.path.file_name() { - Some(file_name) => file_name.to_str().unwrap().to_owned(), - None => self.root_module_name.as_ref().unwrap().clone(), - }; - err.span_note(id_sp, - &format!("maybe move this module `{0}` to its own directory \ - via `{0}{1}mod.rs`", - this_module, - path::MAIN_SEPARATOR)); + if id_sp != syntax_pos::DUMMY_SP { + let full_path = self.sess.codemap().span_to_filename(id_sp); + let path = Path::new(&full_path); + let filename = path.file_stem().unwrap(); + let parent = path.parent().unwrap_or(Path::new("")) + .to_str().unwrap_or("").to_owned(); + let path = format!("{}/{}", + if parent.len() == 0 { "." } else { &parent }, + filename.to_str().unwrap_or("")); + err.span_note(id_sp, + &format!("maybe move this module `{0}` to its own directory \ + via `{0}{1}mod.rs`", + path, + path::MAIN_SEPARATOR)); + } if paths.path_exists { err.span_note(id_sp, &format!("... or maybe `use` the module `{}` instead \ of possibly redeclaring it", paths.name)); - Err(err) - } else { - Err(err) } + Err(err) } else { - paths.result.map_err(|err| self.span_fatal_err(id_sp, err)) + match paths.result { + Ok(succ) => Ok(succ), + Err(err) => Err(self.span_fatal_err(id_sp, &err.err_msg, &err.help_msg)), + } } } From bd880bc6bf62a223664467d4df2b056a9122b7e7 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Tue, 3 Jan 2017 12:19:13 +0100 Subject: [PATCH 05/17] Add tests for module suggestions --- src/libsyntax/parse/parser.rs | 43 ++++++++++++------- src/test/compile-fail/auxiliary/foo/bar.rs | 11 +++++ src/test/compile-fail/auxiliary/foo/mod.rs | 11 +++++ .../invalid-module-declaration.rs | 20 +++++++++ 4 files changed, 70 insertions(+), 15 deletions(-) create mode 100644 src/test/compile-fail/auxiliary/foo/bar.rs create mode 100644 src/test/compile-fail/auxiliary/foo/mod.rs create mode 100644 src/test/compile-fail/invalid-module-declaration.rs diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index dd32b40554b5d..ac72d21ec4271 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -58,8 +58,11 @@ use symbol::{Symbol, keywords}; use util::ThinVec; use std::collections::HashSet; -use std::{cmp, mem, slice}; -use std::path::{self, Path, PathBuf}; +use std::env; +use std::mem; +use std::path::{Path, PathBuf}; +use std::rc::Rc; +use std::slice; bitflags! { flags Restrictions: u8 { @@ -5364,19 +5367,29 @@ impl<'a> Parser<'a> { let mut err = self.diagnostic().struct_span_err(id_sp, "cannot declare a new module at this location"); if id_sp != syntax_pos::DUMMY_SP { - let full_path = self.sess.codemap().span_to_filename(id_sp); - let path = Path::new(&full_path); - let filename = path.file_stem().unwrap(); - let parent = path.parent().unwrap_or(Path::new("")) - .to_str().unwrap_or("").to_owned(); - let path = format!("{}/{}", - if parent.len() == 0 { "." } else { &parent }, - filename.to_str().unwrap_or("")); - err.span_note(id_sp, - &format!("maybe move this module `{0}` to its own directory \ - via `{0}{1}mod.rs`", - path, - path::MAIN_SEPARATOR)); + let mut src_path = PathBuf::from(self.sess.codemap().span_to_filename(id_sp)); + if let Some(stem) = src_path.clone().file_stem() { + let mut dest_path = src_path.clone(); + dest_path.set_file_name(stem); + dest_path.push("mod.rs"); + if let Ok(cur_dir) = env::current_dir() { + let tmp = if let (Ok(src_path), Ok(dest_path)) = + (Path::new(&src_path).strip_prefix(&cur_dir), + Path::new(&dest_path).strip_prefix(&cur_dir)) { + Some((src_path.to_path_buf(), dest_path.to_path_buf())) + } else { + None + }; + if let Some(tmp) = tmp { + src_path = tmp.0; + dest_path = tmp.1; + } + } + err.span_note(id_sp, + &format!("maybe move this module `{}` to its own \ + directory via `{}`", src_path.to_string_lossy(), + dest_path.to_string_lossy())); + } } if paths.path_exists { err.span_note(id_sp, diff --git a/src/test/compile-fail/auxiliary/foo/bar.rs b/src/test/compile-fail/auxiliary/foo/bar.rs new file mode 100644 index 0000000000000..4b6b4f5ebf82f --- /dev/null +++ b/src/test/compile-fail/auxiliary/foo/bar.rs @@ -0,0 +1,11 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +pub mod baz; diff --git a/src/test/compile-fail/auxiliary/foo/mod.rs b/src/test/compile-fail/auxiliary/foo/mod.rs new file mode 100644 index 0000000000000..6d77fb60a35de --- /dev/null +++ b/src/test/compile-fail/auxiliary/foo/mod.rs @@ -0,0 +1,11 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +pub mod bar; diff --git a/src/test/compile-fail/invalid-module-declaration.rs b/src/test/compile-fail/invalid-module-declaration.rs new file mode 100644 index 0000000000000..658fa0a65c47f --- /dev/null +++ b/src/test/compile-fail/invalid-module-declaration.rs @@ -0,0 +1,20 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// ignore-tidy-linelength + +// error-pattern: cannot declare a new module at this location +// error-pattern: maybe move this module `src/test/compile-fail/auxiliary/foo/bar.rs` to its own directory via `src/test/compile-fail/auxiliary/foo/bar/mod.rs` + +mod auxiliary { + mod foo; +} + +fn main() {} From b10c04472bf0969d123aa4461a7f0a1a255ac660 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Sat, 25 Feb 2017 17:08:46 +0100 Subject: [PATCH 06/17] Remove strip prefix --- src/libsyntax/parse/parser.rs | 18 ++---------------- .../compile-fail/invalid-module-declaration.rs | 2 +- 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index ac72d21ec4271..9df791c1c124e 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -58,7 +58,6 @@ use symbol::{Symbol, keywords}; use util::ThinVec; use std::collections::HashSet; -use std::env; use std::mem; use std::path::{Path, PathBuf}; use std::rc::Rc; @@ -5367,24 +5366,11 @@ impl<'a> Parser<'a> { let mut err = self.diagnostic().struct_span_err(id_sp, "cannot declare a new module at this location"); if id_sp != syntax_pos::DUMMY_SP { - let mut src_path = PathBuf::from(self.sess.codemap().span_to_filename(id_sp)); + let src_path = PathBuf::from(self.sess.codemap().span_to_filename(id_sp)); if let Some(stem) = src_path.clone().file_stem() { let mut dest_path = src_path.clone(); dest_path.set_file_name(stem); dest_path.push("mod.rs"); - if let Ok(cur_dir) = env::current_dir() { - let tmp = if let (Ok(src_path), Ok(dest_path)) = - (Path::new(&src_path).strip_prefix(&cur_dir), - Path::new(&dest_path).strip_prefix(&cur_dir)) { - Some((src_path.to_path_buf(), dest_path.to_path_buf())) - } else { - None - }; - if let Some(tmp) = tmp { - src_path = tmp.0; - dest_path = tmp.1; - } - } err.span_note(id_sp, &format!("maybe move this module `{}` to its own \ directory via `{}`", src_path.to_string_lossy(), @@ -5401,7 +5387,7 @@ impl<'a> Parser<'a> { } else { match paths.result { Ok(succ) => Ok(succ), - Err(err) => Err(self.span_fatal_err(id_sp, &err.err_msg, &err.help_msg)), + Err(err) => Err(self.span_fatal_err(id_sp, err)), } } } diff --git a/src/test/compile-fail/invalid-module-declaration.rs b/src/test/compile-fail/invalid-module-declaration.rs index 658fa0a65c47f..c15cfb8cc8e22 100644 --- a/src/test/compile-fail/invalid-module-declaration.rs +++ b/src/test/compile-fail/invalid-module-declaration.rs @@ -11,7 +11,7 @@ // ignore-tidy-linelength // error-pattern: cannot declare a new module at this location -// error-pattern: maybe move this module `src/test/compile-fail/auxiliary/foo/bar.rs` to its own directory via `src/test/compile-fail/auxiliary/foo/bar/mod.rs` +// error-pattern: maybe move this module mod auxiliary { mod foo; From 0d63f13378f8d8625a439ecbb36b3f97d0d2263d Mon Sep 17 00:00:00 2001 From: Jessica Hamilton Date: Mon, 24 Apr 2017 14:21:36 +0000 Subject: [PATCH 07/17] Haiku: add missing cases of using LIBRARY_PATH --- src/bootstrap/bootstrap.py | 3 +++ src/bootstrap/util.rs | 2 ++ src/librustc_back/dynamic_lib.rs | 2 ++ src/tools/compiletest/src/procsrv.rs | 2 ++ 4 files changed, 9 insertions(+) diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py index 3233a73b007cc..55622c6b81b27 100644 --- a/src/bootstrap/bootstrap.py +++ b/src/bootstrap/bootstrap.py @@ -367,6 +367,9 @@ def build_bootstrap(self): env["DYLD_LIBRARY_PATH"] = os.path.join(self.bin_root(), "lib") + \ (os.pathsep + env["DYLD_LIBRARY_PATH"]) \ if "DYLD_LIBRARY_PATH" in env else "" + env["LIBRARY_PATH"] = os.path.join(self.bin_root(), "lib") + \ + (os.pathsep + env["LIBRARY_PATH"]) \ + if "LIBRARY_PATH" in env else "" env["PATH"] = os.path.join(self.bin_root(), "bin") + \ os.pathsep + env["PATH"] if not os.path.isfile(self.cargo()): diff --git a/src/bootstrap/util.rs b/src/bootstrap/util.rs index dab20f44bc361..e01c06b10fcd6 100644 --- a/src/bootstrap/util.rs +++ b/src/bootstrap/util.rs @@ -139,6 +139,8 @@ pub fn dylib_path_var() -> &'static str { "PATH" } else if cfg!(target_os = "macos") { "DYLD_LIBRARY_PATH" + } else if cfg!(target_os = "haiku") { + "LIBRARY_PATH" } else { "LD_LIBRARY_PATH" } diff --git a/src/librustc_back/dynamic_lib.rs b/src/librustc_back/dynamic_lib.rs index 38e60060925e6..e6f305c22b2d4 100644 --- a/src/librustc_back/dynamic_lib.rs +++ b/src/librustc_back/dynamic_lib.rs @@ -68,6 +68,8 @@ impl DynamicLibrary { "PATH" } else if cfg!(target_os = "macos") { "DYLD_LIBRARY_PATH" + } else if cfg!(target_os = "haiku") { + "LIBRARY_PATH" } else { "LD_LIBRARY_PATH" } diff --git a/src/tools/compiletest/src/procsrv.rs b/src/tools/compiletest/src/procsrv.rs index 3d8f2296236a2..dbda8f4d802c0 100644 --- a/src/tools/compiletest/src/procsrv.rs +++ b/src/tools/compiletest/src/procsrv.rs @@ -20,6 +20,8 @@ pub fn dylib_env_var() -> &'static str { "PATH" } else if cfg!(target_os = "macos") { "DYLD_LIBRARY_PATH" + } else if cfg!(target_os = "haiku") { + "LIBRARY_PATH" } else { "LD_LIBRARY_PATH" } From c558a2ae37052dc1f12aa4e40578eb4ae9aca3b9 Mon Sep 17 00:00:00 2001 From: Michael Wu Date: Sun, 9 Apr 2017 02:03:31 -0400 Subject: [PATCH 08/17] Add Hexagon support This requires an updated LLVM with D31999 and D32000 to build libcore. A basic hello world builds and runs successfully on the hexagon simulator. --- src/librustc_llvm/build.rs | 2 +- src/librustc_llvm/lib.rs | 6 +++++ src/librustc_trans/abi.rs | 2 ++ src/librustc_trans/cabi_hexagon.rs | 43 ++++++++++++++++++++++++++++++ src/librustc_trans/lib.rs | 1 + src/rustllvm/PassWrapper.cpp | 9 ++++++- 6 files changed, 61 insertions(+), 2 deletions(-) create mode 100644 src/librustc_trans/cabi_hexagon.rs diff --git a/src/librustc_llvm/build.rs b/src/librustc_llvm/build.rs index 4871f60466dfd..3c88ae886d6f5 100644 --- a/src/librustc_llvm/build.rs +++ b/src/librustc_llvm/build.rs @@ -94,7 +94,7 @@ fn main() { let optional_components = ["x86", "arm", "aarch64", "mips", "powerpc", "pnacl", "systemz", "jsbackend", "msp430", - "sparc", "nvptx"]; + "sparc", "nvptx", "hexagon"]; // FIXME: surely we don't need all these components, right? Stuff like mcjit // or interpreter the compiler itself never uses. diff --git a/src/librustc_llvm/lib.rs b/src/librustc_llvm/lib.rs index 7c52ceae459cd..c9b3a7ff3f3aa 100644 --- a/src/librustc_llvm/lib.rs +++ b/src/librustc_llvm/lib.rs @@ -382,6 +382,12 @@ pub fn initialize_available_targets() { LLVMInitializeNVPTXTarget, LLVMInitializeNVPTXTargetMC, LLVMInitializeNVPTXAsmPrinter); + init_target!(llvm_component = "hexagon", + LLVMInitializeHexagonTargetInfo, + LLVMInitializeHexagonTarget, + LLVMInitializeHexagonTargetMC, + LLVMInitializeHexagonAsmPrinter, + LLVMInitializeHexagonAsmParser); } pub fn last_error() -> Option { diff --git a/src/librustc_trans/abi.rs b/src/librustc_trans/abi.rs index 998e392b1f907..a6b0eb473eb8e 100644 --- a/src/librustc_trans/abi.rs +++ b/src/librustc_trans/abi.rs @@ -29,6 +29,7 @@ use cabi_sparc; use cabi_sparc64; use cabi_nvptx; use cabi_nvptx64; +use cabi_hexagon; use machine::llalign_of_min; use type_::Type; use type_of; @@ -896,6 +897,7 @@ impl<'a, 'tcx> FnType<'tcx> { "sparc64" => cabi_sparc64::compute_abi_info(ccx, self), "nvptx" => cabi_nvptx::compute_abi_info(ccx, self), "nvptx64" => cabi_nvptx64::compute_abi_info(ccx, self), + "hexagon" => cabi_hexagon::compute_abi_info(ccx, self), a => ccx.sess().fatal(&format!("unrecognized arch \"{}\" in target specification", a)) } diff --git a/src/librustc_trans/cabi_hexagon.rs b/src/librustc_trans/cabi_hexagon.rs new file mode 100644 index 0000000000000..1acda72675c31 --- /dev/null +++ b/src/librustc_trans/cabi_hexagon.rs @@ -0,0 +1,43 @@ +// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![allow(non_upper_case_globals)] + +use abi::{FnType, ArgType, LayoutExt}; +use context::CrateContext; + +fn classify_ret_ty<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, ret: &mut ArgType<'tcx>) { + if ret.layout.is_aggregate() && ret.layout.size(ccx).bits() > 64 { + ret.make_indirect(ccx); + } else { + ret.extend_integer_width_to(32); + } +} + +fn classify_arg_ty<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, arg: &mut ArgType<'tcx>) { + if arg.layout.is_aggregate() && arg.layout.size(ccx).bits() > 64 { + arg.make_indirect(ccx); + } else { + arg.extend_integer_width_to(32); + } +} + +pub fn compute_abi_info<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, fty: &mut FnType<'tcx>) { + if !fty.ret.is_ignore() { + classify_ret_ty(ccx, &mut fty.ret); + } + + for arg in &mut fty.args { + if arg.is_ignore() { + continue; + } + classify_arg_ty(ccx, arg); + } +} diff --git a/src/librustc_trans/lib.rs b/src/librustc_trans/lib.rs index 117d8568500b8..d5fc2ee5e25e0 100644 --- a/src/librustc_trans/lib.rs +++ b/src/librustc_trans/lib.rs @@ -97,6 +97,7 @@ mod builder; mod cabi_aarch64; mod cabi_arm; mod cabi_asmjs; +mod cabi_hexagon; mod cabi_mips; mod cabi_mips64; mod cabi_msp430; diff --git a/src/rustllvm/PassWrapper.cpp b/src/rustllvm/PassWrapper.cpp index c410a6b1349d6..b938f94cda2cb 100644 --- a/src/rustllvm/PassWrapper.cpp +++ b/src/rustllvm/PassWrapper.cpp @@ -147,6 +147,12 @@ extern "C" void LLVMRustAddPass(LLVMPassManagerRef PMR, LLVMPassRef RustPass) { #define SUBTARGET_SPARC #endif +#ifdef LLVM_COMPONENT_HEXAGON +#define SUBTARGET_HEXAGON SUBTARGET(Hexagon) +#else +#define SUBTARGET_HEXAGON +#endif + #define GEN_SUBTARGETS \ SUBTARGET_X86 \ SUBTARGET_ARM \ @@ -155,7 +161,8 @@ extern "C" void LLVMRustAddPass(LLVMPassManagerRef PMR, LLVMPassRef RustPass) { SUBTARGET_PPC \ SUBTARGET_SYSTEMZ \ SUBTARGET_MSP430 \ - SUBTARGET_SPARC + SUBTARGET_SPARC \ + SUBTARGET_HEXAGON #define SUBTARGET(x) \ namespace llvm { \ From 3f97b2a65c31a1c53c29d233d6b37b0258e4a6b2 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Mon, 24 Apr 2017 16:26:04 +0200 Subject: [PATCH 09/17] Add ui tests --- src/libsyntax/parse/parser.rs | 11 ++++------- .../auxiliary/foo/bar.rs | 0 .../auxiliary/foo/mod.rs | 0 .../invalid-module-declaration.rs | 0 .../invalid-module-declaration.stderr | 14 ++++++++++++++ 5 files changed, 18 insertions(+), 7 deletions(-) rename src/test/{compile-fail => ui/invalid-module-declaration}/auxiliary/foo/bar.rs (100%) rename src/test/{compile-fail => ui/invalid-module-declaration}/auxiliary/foo/mod.rs (100%) rename src/test/{compile-fail => ui/invalid-module-declaration}/invalid-module-declaration.rs (100%) create mode 100644 src/test/ui/invalid-module-declaration/invalid-module-declaration.stderr diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 9df791c1c124e..afdb0cc4fdb79 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -57,10 +57,10 @@ use tokenstream::{self, Delimited, ThinTokenStream, TokenTree, TokenStream}; use symbol::{Symbol, keywords}; use util::ThinVec; +use std::cmp; use std::collections::HashSet; use std::mem; -use std::path::{Path, PathBuf}; -use std::rc::Rc; +use std::path::{self, Path, PathBuf}; use std::slice; bitflags! { @@ -5367,7 +5367,7 @@ impl<'a> Parser<'a> { "cannot declare a new module at this location"); if id_sp != syntax_pos::DUMMY_SP { let src_path = PathBuf::from(self.sess.codemap().span_to_filename(id_sp)); - if let Some(stem) = src_path.clone().file_stem() { + if let Some(stem) = src_path.file_stem() { let mut dest_path = src_path.clone(); dest_path.set_file_name(stem); dest_path.push("mod.rs"); @@ -5385,10 +5385,7 @@ impl<'a> Parser<'a> { } Err(err) } else { - match paths.result { - Ok(succ) => Ok(succ), - Err(err) => Err(self.span_fatal_err(id_sp, err)), - } + paths.result.map_err(|err| self.span_fatal_err(id_sp, err)) } } diff --git a/src/test/compile-fail/auxiliary/foo/bar.rs b/src/test/ui/invalid-module-declaration/auxiliary/foo/bar.rs similarity index 100% rename from src/test/compile-fail/auxiliary/foo/bar.rs rename to src/test/ui/invalid-module-declaration/auxiliary/foo/bar.rs diff --git a/src/test/compile-fail/auxiliary/foo/mod.rs b/src/test/ui/invalid-module-declaration/auxiliary/foo/mod.rs similarity index 100% rename from src/test/compile-fail/auxiliary/foo/mod.rs rename to src/test/ui/invalid-module-declaration/auxiliary/foo/mod.rs diff --git a/src/test/compile-fail/invalid-module-declaration.rs b/src/test/ui/invalid-module-declaration/invalid-module-declaration.rs similarity index 100% rename from src/test/compile-fail/invalid-module-declaration.rs rename to src/test/ui/invalid-module-declaration/invalid-module-declaration.rs diff --git a/src/test/ui/invalid-module-declaration/invalid-module-declaration.stderr b/src/test/ui/invalid-module-declaration/invalid-module-declaration.stderr new file mode 100644 index 0000000000000..3e9b21cdb740f --- /dev/null +++ b/src/test/ui/invalid-module-declaration/invalid-module-declaration.stderr @@ -0,0 +1,14 @@ +error: cannot declare a new module at this location + --> $DIR/auxiliary/foo/bar.rs:11:9 + | +11 | pub mod baz; + | ^^^ + | +note: maybe move this module `$DIR/auxiliary/foo/bar.rs` to its own directory via `$DIR/auxiliary/foo/bar/mod.rs` + --> $DIR/auxiliary/foo/bar.rs:11:9 + | +11 | pub mod baz; + | ^^^ + +error: aborting due to previous error + From 7248f67f1b5062c99fd9a1972c932cb79c590910 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Tue, 25 Apr 2017 15:34:31 -0700 Subject: [PATCH 10/17] Build the rustc-src tarball before the rust-src component --- src/bootstrap/dist.rs | 60 ++++++++++++++++++++++++------------------- 1 file changed, 33 insertions(+), 27 deletions(-) diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs index 4328c4e3f1d4c..e8c9a96b2214f 100644 --- a/src/bootstrap/dist.rs +++ b/src/bootstrap/dist.rs @@ -369,13 +369,11 @@ pub fn rust_src(build: &Build) { println!("Dist src"); - let name = pkgname(build, "rust-src"); - let image = tmpdir(build).join(format!("{}-image", name)); - let _ = fs::remove_dir_all(&image); - - let dst = image.join("lib/rustlib/src"); - let dst_src = dst.join("rust"); - t!(fs::create_dir_all(&dst_src)); + // Make sure that the root folder of tarball has the correct name + let plain_name = format!("rustc-{}-src", build.rust_package_vers()); + let plain_dst_src = tmpdir(build).join(&plain_name); + let _ = fs::remove_dir_all(&plain_dst_src); + t!(fs::create_dir_all(&plain_dst_src)); // This is the set of root paths which will become part of the source package let src_files = [ @@ -424,13 +422,13 @@ pub fn rust_src(build: &Build) { // Copy the directories using our filter for item in &src_dirs { - let dst = &dst_src.join(item); + let dst = &plain_dst_src.join(item); t!(fs::create_dir(dst)); cp_filtered(&build.src.join(item), dst, &filter_fn); } // Copy the files normally for item in &src_files { - copy(&build.src.join(item), &dst_src.join(item)); + copy(&build.src.join(item), &plain_dst_src.join(item)); } // If we're building from git sources, we need to vendor a complete distribution. @@ -455,10 +453,35 @@ pub fn rust_src(build: &Build) { // Vendor all Cargo dependencies let mut cmd = Command::new(&build.cargo); cmd.arg("vendor") - .current_dir(&dst_src.join("src")); + .current_dir(&plain_dst_src.join("src")); build.run(&mut cmd); } + // Create the version file + write_file(&plain_dst_src.join("version"), build.rust_version().as_bytes()); + + // Create plain source tarball + let tarball = rust_src_location(build); + if let Some(dir) = tarball.parent() { + t!(fs::create_dir_all(dir)); + } + let mut cmd = Command::new("tar"); + cmd.arg("-czf").arg(sanitize_sh(&tarball)) + .arg(&plain_name) + .current_dir(tmpdir(build)); + build.run(&mut cmd); + + + let name = pkgname(build, "rust-src"); + let image = tmpdir(build).join(format!("{}-image", name)); + let _ = fs::remove_dir_all(&image); + + let dst = image.join("lib/rustlib/src"); + let dst_src = dst.join("rust"); + t!(fs::create_dir_all(&dst_src)); + + cp_r(&plain_dst_src, &dst_src); + // Create source tarball in rust-installer format let mut cmd = Command::new(SH_CMD); cmd.arg(sanitize_sh(&build.src.join("src/rust-installer/gen-installer.sh"))) @@ -473,23 +496,6 @@ pub fn rust_src(build: &Build) { .arg("--legacy-manifest-dirs=rustlib,cargo"); build.run(&mut cmd); - // Rename directory, so that root folder of tarball has the correct name - let plain_name = format!("rustc-{}-src", build.rust_package_vers()); - let plain_dst_src = tmpdir(build).join(&plain_name); - let _ = fs::remove_dir_all(&plain_dst_src); - t!(fs::create_dir_all(&plain_dst_src)); - cp_r(&dst_src, &plain_dst_src); - - // Create the version file - write_file(&plain_dst_src.join("version"), build.rust_version().as_bytes()); - - // Create plain source tarball - let mut cmd = Command::new("tar"); - cmd.arg("-czf").arg(sanitize_sh(&rust_src_location(build))) - .arg(&plain_name) - .current_dir(tmpdir(build)); - build.run(&mut cmd); - t!(fs::remove_dir_all(&image)); t!(fs::remove_dir_all(&plain_dst_src)); } From b9bdb1766d68dbe5da0e0cd65b2227186004d2cf Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Tue, 25 Apr 2017 15:58:07 -0700 Subject: [PATCH 11/17] Reduce the contents of the rust-src component --- src/bootstrap/dist.rs | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs index e8c9a96b2214f..7e04b3660cd33 100644 --- a/src/bootstrap/dist.rs +++ b/src/bootstrap/dist.rs @@ -480,7 +480,35 @@ pub fn rust_src(build: &Build) { let dst_src = dst.join("rust"); t!(fs::create_dir_all(&dst_src)); - cp_r(&plain_dst_src, &dst_src); + // This is the reduced set of paths which will become the rust-src component + // (essentially libstd and all of its path dependencies) + let std_src_dirs = [ + "src/build_helper", + "src/liballoc", + "src/liballoc_jemalloc", + "src/liballoc_system", + "src/libcollections", + "src/libcompiler_builtins", + "src/libcore", + "src/liblibc", + "src/libpanic_abort", + "src/libpanic_unwind", + "src/librand", + "src/librustc_asan", + "src/librustc_lsan", + "src/librustc_msan", + "src/librustc_tsan", + "src/libstd", + "src/libstd_unicode", + "src/libunwind", + "src/rustc/libc_shim", + ]; + + for item in &std_src_dirs { + let dst = &dst_src.join(item); + t!(fs::create_dir_all(dst)); + cp_r(&plain_dst_src.join(item), dst); + } // Create source tarball in rust-installer format let mut cmd = Command::new(SH_CMD); From 9f96d0a7b8c0e24fe9e6ed303371dd16db5668d5 Mon Sep 17 00:00:00 2001 From: Wesley Wiser Date: Tue, 25 Apr 2017 22:55:58 -0400 Subject: [PATCH 12/17] Add a regression test for ICE #33287 Fixes #33287 --- src/test/run-pass/issue-33287.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/test/run-pass/issue-33287.rs diff --git a/src/test/run-pass/issue-33287.rs b/src/test/run-pass/issue-33287.rs new file mode 100644 index 0000000000000..a2021e0e52792 --- /dev/null +++ b/src/test/run-pass/issue-33287.rs @@ -0,0 +1,18 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +const A: [u32; 1] = [0]; + +fn test() { + let range = A[1]..; +} + +fn main() { } + From 32aeb22f5488acc51b01d93684d35d097e6e23f5 Mon Sep 17 00:00:00 2001 From: Michael Wu Date: Tue, 25 Apr 2017 18:08:13 -0400 Subject: [PATCH 13/17] Avoid the hexagon backend on old versions of LLVM --- src/librustc_llvm/build.rs | 66 ++++++++++++++++++++++---------------- 1 file changed, 38 insertions(+), 28 deletions(-) diff --git a/src/librustc_llvm/build.rs b/src/librustc_llvm/build.rs index 3c88ae886d6f5..3fd75146193e7 100644 --- a/src/librustc_llvm/build.rs +++ b/src/librustc_llvm/build.rs @@ -17,30 +17,24 @@ use std::path::{PathBuf, Path}; use build_helper::output; -fn detect_llvm_link(llvm_config: &Path) -> (&'static str, Option<&'static str>) { - let mut version_cmd = Command::new(llvm_config); - version_cmd.arg("--version"); - let version_output = output(&mut version_cmd); - let mut parts = version_output.split('.').take(2) - .filter_map(|s| s.parse::().ok()); - if let (Some(major), Some(minor)) = (parts.next(), parts.next()) { - if major > 3 || (major == 3 && minor >= 9) { - // Force the link mode we want, preferring static by default, but - // possibly overridden by `configure --enable-llvm-link-shared`. - if env::var_os("LLVM_LINK_SHARED").is_some() { - return ("dylib", Some("--link-shared")); - } else { - return ("static", Some("--link-static")); - } - } else if major == 3 && minor == 8 { - // Find out LLVM's default linking mode. - let mut mode_cmd = Command::new(llvm_config); - mode_cmd.arg("--shared-mode"); - if output(&mut mode_cmd).trim() == "shared" { - return ("dylib", None); - } else { - return ("static", None); - } +fn detect_llvm_link(major: u32, minor: u32, llvm_config: &Path) + -> (&'static str, Option<&'static str>) { + if major > 3 || (major == 3 && minor >= 9) { + // Force the link mode we want, preferring static by default, but + // possibly overridden by `configure --enable-llvm-link-shared`. + if env::var_os("LLVM_LINK_SHARED").is_some() { + return ("dylib", Some("--link-shared")); + } else { + return ("static", Some("--link-static")); + } + } else if major == 3 && minor == 8 { + // Find out LLVM's default linking mode. + let mut mode_cmd = Command::new(llvm_config); + mode_cmd.arg("--shared-mode"); + if output(&mut mode_cmd).trim() == "shared" { + return ("dylib", None); + } else { + return ("static", None); } } ("static", None) @@ -92,9 +86,25 @@ fn main() { let host = env::var("HOST").expect("HOST was not set"); let is_crossed = target != host; - let optional_components = - ["x86", "arm", "aarch64", "mips", "powerpc", "pnacl", "systemz", "jsbackend", "msp430", - "sparc", "nvptx", "hexagon"]; + let mut optional_components = + vec!["x86", "arm", "aarch64", "mips", "powerpc", "pnacl", + "systemz", "jsbackend", "msp430", "sparc", "nvptx"]; + + let mut version_cmd = Command::new(&llvm_config); + version_cmd.arg("--version"); + let version_output = output(&mut version_cmd); + let mut parts = version_output.split('.').take(2) + .filter_map(|s| s.parse::().ok()); + let (major, minor) = + if let (Some(major), Some(minor)) = (parts.next(), parts.next()) { + (major, minor) + } else { + (3, 7) + }; + + if major > 3 { + optional_components.push("hexagon"); + } // FIXME: surely we don't need all these components, right? Stuff like mcjit // or interpreter the compiler itself never uses. @@ -158,7 +168,7 @@ fn main() { .cpp_link_stdlib(None) // we handle this below .compile("librustllvm.a"); - let (llvm_kind, llvm_link_arg) = detect_llvm_link(&llvm_config); + let (llvm_kind, llvm_link_arg) = detect_llvm_link(major, minor, &llvm_config); // Link in all LLVM libraries, if we're uwring the "wrong" llvm-config then // we don't pick up system libs because unfortunately they're for the host From 85c2ff1c466f9ed5dd69b63a03d667ac4468db58 Mon Sep 17 00:00:00 2001 From: Jessica Hamilton Date: Wed, 26 Apr 2017 15:20:09 +1200 Subject: [PATCH 14/17] Update num_cpus dependency to 1.x (1.4.0) --- src/Cargo.lock | 6 +++--- src/bootstrap/Cargo.toml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Cargo.lock b/src/Cargo.lock index f4c35719f3631..0a584ac6b01c4 100644 --- a/src/Cargo.lock +++ b/src/Cargo.lock @@ -78,7 +78,7 @@ dependencies = [ "gcc 0.3.45 (registry+https://github.com/rust-lang/crates.io-index)", "getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.23 (registry+https://github.com/rust-lang/crates.io-index)", "toml 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -299,7 +299,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "num_cpus" -version = "0.2.13" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "libc 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1004,7 +1004,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum mdbook 0.0.19 (registry+https://github.com/rust-lang/crates.io-index)" = "2598843aeda0c5bb2e8e4d714564f1c3fc40f7844157e34563bf96ae3866b56e" "checksum memchr 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1dbccc0e46f1ea47b9f17e6d67c5a96bd27030519c519c9c91327e31275a47b4" "checksum num-traits 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)" = "e1cbfa3781f3fe73dc05321bed52a06d2d491eaa764c52335cf4399f046ece99" -"checksum num_cpus 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "cee7e88156f3f9e19bdd598f8d6c9db7bf4078f99f8381f43a55b09648d1a6e3" +"checksum num_cpus 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ca313f1862c7ec3e0dfe8ace9fa91b1d9cb5c84ace3d00f5ec4216238e93c167" "checksum open 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3478ed1686bd1300c8a981a940abc92b06fac9cbef747f4c668d4e032ff7b842" "checksum pest 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0a6dda33d67c26f0aac90d324ab2eb7239c819fc7b2552fe9faa4fe88441edc8" "checksum pulldown-cmark 0.0.14 (registry+https://github.com/rust-lang/crates.io-index)" = "d9ab1e588ef8efd702c7ed9d2bd774db5e6f4d878bb5a1a9f371828fbdff6973" diff --git a/src/bootstrap/Cargo.toml b/src/bootstrap/Cargo.toml index 1eda1608c4709..ecfddec328cd1 100644 --- a/src/bootstrap/Cargo.toml +++ b/src/bootstrap/Cargo.toml @@ -27,7 +27,7 @@ test = false build_helper = { path = "../build_helper" } cmake = "0.1.17" filetime = "0.1" -num_cpus = "0.2" +num_cpus = "1.0" toml = "0.1" getopts = "0.2" rustc-serialize = "0.3" From 27b00ec752cfd65e70f213272d0d960c05dc9aae Mon Sep 17 00:00:00 2001 From: Michael Wu Date: Tue, 25 Apr 2017 18:50:41 -0400 Subject: [PATCH 15/17] Cherry pick LLVM hexagon fixes --- src/llvm | 2 +- src/rustllvm/llvm-rebuild-trigger | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/llvm b/src/llvm index a884d21cc5f0b..878af191434cd 160000 --- a/src/llvm +++ b/src/llvm @@ -1 +1 @@ -Subproject commit a884d21cc5f0b23a1693d1e872fd8998a4fdd17f +Subproject commit 878af191434cd716eeb13c2be7a2b1e21abf2749 diff --git a/src/rustllvm/llvm-rebuild-trigger b/src/rustllvm/llvm-rebuild-trigger index c8732e27b8252..52ebf449d6007 100644 --- a/src/rustllvm/llvm-rebuild-trigger +++ b/src/rustllvm/llvm-rebuild-trigger @@ -1,4 +1,4 @@ # If this file is modified, then llvm will be (optionally) cleaned and then rebuilt. # The actual contents of this file do not matter, but to trigger a change on the # build bots then the contents should be changed so git updates the mtime. -2017-03-23 +2017-04-25 From 29e6656859f19a1cb5bd1672b9369acef98d1862 Mon Sep 17 00:00:00 2001 From: steveklabnik Date: Mon, 24 Apr 2017 07:20:16 -0400 Subject: [PATCH 16/17] Address platform-specific behavior in TcpStream::shutdown Fixes #25164 --- src/libstd/net/tcp.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/libstd/net/tcp.rs b/src/libstd/net/tcp.rs index bc315d54100e4..8def11295fda8 100644 --- a/src/libstd/net/tcp.rs +++ b/src/libstd/net/tcp.rs @@ -177,6 +177,13 @@ impl TcpStream { /// /// [`Shutdown`]: ../../std/net/enum.Shutdown.html /// + /// # Platform-specific behavior + /// + /// Calling this function multiple times may result in different behavior, + /// depending on the operating system. On Linux, the second call will + /// return `Ok(())`, but on macOS, it will return `ErrorKind::NotConnected`. + /// This may change in the future. + /// /// # Examples /// /// ```no_run From 22eb3c69b913091b8e363803dab973a2a8230736 Mon Sep 17 00:00:00 2001 From: Michael Wu Date: Tue, 18 Apr 2017 16:23:47 -0400 Subject: [PATCH 17/17] Enable building the LLVM Hexagon target --- src/bootstrap/config.toml.example | 2 +- src/bootstrap/native.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bootstrap/config.toml.example b/src/bootstrap/config.toml.example index fad79022043e3..0309eca0e5dea 100644 --- a/src/bootstrap/config.toml.example +++ b/src/bootstrap/config.toml.example @@ -51,7 +51,7 @@ # support. You'll need to write a target specification at least, and most # likely, teach rustc about the C ABI of the target. Get in touch with the # Rust team and file an issue if you need assistance in porting! -#targets = "X86;ARM;AArch64;Mips;PowerPC;SystemZ;JSBackend;MSP430;Sparc;NVPTX" +#targets = "X86;ARM;AArch64;Mips;PowerPC;SystemZ;JSBackend;MSP430;Sparc;NVPTX;Hexagon" # Cap the number of parallel linker invocations when compiling LLVM. # This can be useful when building LLVM with debug info, which significantly diff --git a/src/bootstrap/native.rs b/src/bootstrap/native.rs index 726e94e49a19e..af3fcd1ec3c26 100644 --- a/src/bootstrap/native.rs +++ b/src/bootstrap/native.rs @@ -81,7 +81,7 @@ pub fn llvm(build: &Build, target: &str) { // NOTE: remember to also update `config.toml.example` when changing the defaults! let llvm_targets = match build.config.llvm_targets { Some(ref s) => s, - None => "X86;ARM;AArch64;Mips;PowerPC;SystemZ;JSBackend;MSP430;Sparc;NVPTX", + None => "X86;ARM;AArch64;Mips;PowerPC;SystemZ;JSBackend;MSP430;Sparc;NVPTX;Hexagon", }; let assertions = if build.config.llvm_assertions {"ON"} else {"OFF"};