Skip to content

Commit a3a0776

Browse files
authored
Merge branch 'master' into bare-metal-cortex-a
2 parents 470cdf5 + 29b854f commit a3a0776

File tree

564 files changed

+14174
-10058
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

564 files changed

+14174
-10058
lines changed

.gitignore

+1-8
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,7 @@ __pycache__/
3434
# Created by default with `src/ci/docker/run.sh`:
3535
/obj/
3636
/rustllvm/
37-
/src/libcore/unicode/DerivedCoreProperties.txt
38-
/src/libcore/unicode/DerivedNormalizationProps.txt
39-
/src/libcore/unicode/PropList.txt
40-
/src/libcore/unicode/ReadMe.txt
41-
/src/libcore/unicode/Scripts.txt
42-
/src/libcore/unicode/SpecialCasing.txt
43-
/src/libcore/unicode/UnicodeData.txt
44-
/src/libcore/unicode/downloaded
37+
/unicode-downloads
4538
/target/
4639
# Generated by compiletest for incremental:
4740
/tmp/

.gitmodules

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
[submodule "src/llvm-project"]
4141
path = src/llvm-project
4242
url = https://github.com/rust-lang/llvm-project.git
43-
branch = rustc/9.0-2019-09-19
43+
branch = rustc/9.0-2019-12-19
4444
[submodule "src/doc/embedded-book"]
4545
path = src/doc/embedded-book
4646
url = https://github.com/rust-embedded/book.git

Cargo.lock

+43-9
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ dependencies = [
207207
"serde_json",
208208
"time",
209209
"toml",
210+
"winapi 0.3.8",
210211
]
211212

212213
[[package]]
@@ -520,9 +521,9 @@ dependencies = [
520521

521522
[[package]]
522523
name = "cmake"
523-
version = "0.1.38"
524+
version = "0.1.42"
524525
source = "registry+https://github.com/rust-lang/crates.io-index"
525-
checksum = "96210eec534fc3fbfc0452a63769424eaa80205fda6cea98e5b61cb3d97bcec8"
526+
checksum = "81fb25b677f8bf1eb325017cb6bb8452f87969db0fedb4f757b297bee78a7c62"
526527
dependencies = [
527528
"cc",
528529
]
@@ -576,9 +577,9 @@ dependencies = [
576577

577578
[[package]]
578579
name = "compiler_builtins"
579-
version = "0.1.22"
580+
version = "0.1.24"
580581
source = "registry+https://github.com/rust-lang/crates.io-index"
581-
checksum = "e6f083abf9bb9005a27d2da62706f661245278cb7096da37ab27410eaf60f2c1"
582+
checksum = "b9975aefa63997ef75ca9cf013ff1bb81487aaa0b622c21053afd3b92979a7af"
582583
dependencies = [
583584
"cc",
584585
"rustc-std-workspace-core",
@@ -1587,12 +1588,11 @@ dependencies = [
15871588

15881589
[[package]]
15891590
name = "iovec"
1590-
version = "0.1.2"
1591+
version = "0.1.4"
15911592
source = "registry+https://github.com/rust-lang/crates.io-index"
1592-
checksum = "dbe6e417e7d0975db6512b90796e8ce223145ac4e33c377e4a42882a0e88bb08"
1593+
checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e"
15931594
dependencies = [
15941595
"libc",
1595-
"winapi 0.2.8",
15961596
]
15971597

15981598
[[package]]
@@ -1812,9 +1812,9 @@ dependencies = [
18121812

18131813
[[package]]
18141814
name = "libssh2-sys"
1815-
version = "0.2.11"
1815+
version = "0.2.14"
18161816
source = "registry+https://github.com/rust-lang/crates.io-index"
1817-
checksum = "126a1f4078368b163bfdee65fbab072af08a1b374a5551b21e87ade27b1fbf9d"
1817+
checksum = "36aa6e813339d3a063292b77091dfbbb6152ff9006a459895fa5bebed7d34f10"
18181818
dependencies = [
18191819
"cc",
18201820
"libc",
@@ -3497,6 +3497,7 @@ dependencies = [
34973497
"serialize",
34983498
"smallvec 1.0.0",
34993499
"stable_deref_trait",
3500+
"winapi 0.3.8",
35003501
]
35013502

35023503
[[package]]
@@ -3524,6 +3525,7 @@ dependencies = [
35243525
"rustc_target",
35253526
"serialize",
35263527
"syntax",
3528+
"winapi 0.3.8",
35273529
]
35283530

35293531
[[package]]
@@ -3543,6 +3545,7 @@ dependencies = [
35433545
"term_size",
35443546
"termcolor",
35453547
"unicode-width",
3548+
"winapi 0.3.8",
35463549
]
35473550

35483551
[[package]]
@@ -3649,11 +3652,13 @@ dependencies = [
36493652
"rustc_span",
36503653
"rustc_target",
36513654
"rustc_traits",
3655+
"rustc_ty",
36523656
"rustc_typeck",
36533657
"serialize",
36543658
"smallvec 1.0.0",
36553659
"syntax",
36563660
"tempfile",
3661+
"winapi 0.3.8",
36573662
]
36583663

36593664
[[package]]
@@ -3723,6 +3728,7 @@ dependencies = [
37233728
"smallvec 1.0.0",
37243729
"stable_deref_trait",
37253730
"syntax",
3731+
"winapi 0.3.8",
37263732
]
37273733

37283734
[[package]]
@@ -3948,6 +3954,17 @@ dependencies = [
39483954
"syntax",
39493955
]
39503956

3957+
[[package]]
3958+
name = "rustc_ty"
3959+
version = "0.0.0"
3960+
dependencies = [
3961+
"log",
3962+
"rustc",
3963+
"rustc_data_structures",
3964+
"rustc_hir",
3965+
"rustc_span",
3966+
]
3967+
39513968
[[package]]
39523969
name = "rustc_typeck"
39533970
version = "0.0.0"
@@ -4948,6 +4965,16 @@ version = "1.10.0"
49484965
source = "registry+https://github.com/rust-lang/crates.io-index"
49494966
checksum = "612d636f949607bdf9b123b4a6f6d966dedf3ff669f7f045890d3a4a73948169"
49504967

4968+
[[package]]
4969+
name = "ucd-parse"
4970+
version = "0.1.4"
4971+
source = "registry+https://github.com/rust-lang/crates.io-index"
4972+
checksum = "ca6b52bf4da6512f0f07785a04769222e50d29639e7ecd016b7806fd2de306b4"
4973+
dependencies = [
4974+
"lazy_static 1.3.0",
4975+
"regex",
4976+
]
4977+
49514978
[[package]]
49524979
name = "ucd-trie"
49534980
version = "0.1.1"
@@ -4969,6 +4996,13 @@ dependencies = [
49694996
"version_check 0.1.5",
49704997
]
49714998

4999+
[[package]]
5000+
name = "unicode-bdd"
5001+
version = "0.1.0"
5002+
dependencies = [
5003+
"ucd-parse",
5004+
]
5005+
49725006
[[package]]
49735007
name = "unicode-bidi"
49745008
version = "0.3.4"

Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ members = [
2323
"src/tools/rustfmt",
2424
"src/tools/miri",
2525
"src/tools/rustdoc-themes",
26+
"src/tools/unicode-table-generator",
2627
]
2728
exclude = [
2829
"build",

src/bootstrap/Cargo.toml

+4
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,9 @@ lazy_static = "1.3.0"
4949
time = "0.1"
5050
ignore = "0.4.10"
5151

52+
[target.'cfg(windows)'.dependencies.winapi]
53+
version = "0.3"
54+
features = ["fileapi", "ioapiset", "jobapi2", "handleapi", "winioctl"]
55+
5256
[dev-dependencies]
5357
pretty_assertions = "0.5"

src/bootstrap/job.rs

+10-78
Original file line numberDiff line numberDiff line change
@@ -35,84 +35,16 @@ use std::io;
3535
use std::mem;
3636
use std::ptr;
3737

38-
type HANDLE = *mut u8;
39-
type BOOL = i32;
40-
type DWORD = u32;
41-
type LPHANDLE = *mut HANDLE;
42-
type LPVOID = *mut u8;
43-
type JOBOBJECTINFOCLASS = i32;
44-
type SIZE_T = usize;
45-
type LARGE_INTEGER = i64;
46-
type UINT = u32;
47-
type ULONG_PTR = usize;
48-
type ULONGLONG = u64;
49-
50-
const FALSE: BOOL = 0;
51-
const DUPLICATE_SAME_ACCESS: DWORD = 0x2;
52-
const PROCESS_DUP_HANDLE: DWORD = 0x40;
53-
const JobObjectExtendedLimitInformation: JOBOBJECTINFOCLASS = 9;
54-
const JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE: DWORD = 0x2000;
55-
const JOB_OBJECT_LIMIT_PRIORITY_CLASS: DWORD = 0x00000020;
56-
const SEM_FAILCRITICALERRORS: UINT = 0x0001;
57-
const SEM_NOGPFAULTERRORBOX: UINT = 0x0002;
58-
const BELOW_NORMAL_PRIORITY_CLASS: DWORD = 0x00004000;
59-
60-
extern "system" {
61-
fn CreateJobObjectW(lpJobAttributes: *mut u8, lpName: *const u8) -> HANDLE;
62-
fn CloseHandle(hObject: HANDLE) -> BOOL;
63-
fn GetCurrentProcess() -> HANDLE;
64-
fn OpenProcess(dwDesiredAccess: DWORD, bInheritHandle: BOOL, dwProcessId: DWORD) -> HANDLE;
65-
fn DuplicateHandle(
66-
hSourceProcessHandle: HANDLE,
67-
hSourceHandle: HANDLE,
68-
hTargetProcessHandle: HANDLE,
69-
lpTargetHandle: LPHANDLE,
70-
dwDesiredAccess: DWORD,
71-
bInheritHandle: BOOL,
72-
dwOptions: DWORD,
73-
) -> BOOL;
74-
fn AssignProcessToJobObject(hJob: HANDLE, hProcess: HANDLE) -> BOOL;
75-
fn SetInformationJobObject(
76-
hJob: HANDLE,
77-
JobObjectInformationClass: JOBOBJECTINFOCLASS,
78-
lpJobObjectInformation: LPVOID,
79-
cbJobObjectInformationLength: DWORD,
80-
) -> BOOL;
81-
fn SetErrorMode(mode: UINT) -> UINT;
82-
}
83-
84-
#[repr(C)]
85-
struct JOBOBJECT_EXTENDED_LIMIT_INFORMATION {
86-
BasicLimitInformation: JOBOBJECT_BASIC_LIMIT_INFORMATION,
87-
IoInfo: IO_COUNTERS,
88-
ProcessMemoryLimit: SIZE_T,
89-
JobMemoryLimit: SIZE_T,
90-
PeakProcessMemoryUsed: SIZE_T,
91-
PeakJobMemoryUsed: SIZE_T,
92-
}
93-
94-
#[repr(C)]
95-
struct IO_COUNTERS {
96-
ReadOperationCount: ULONGLONG,
97-
WriteOperationCount: ULONGLONG,
98-
OtherOperationCount: ULONGLONG,
99-
ReadTransferCount: ULONGLONG,
100-
WriteTransferCount: ULONGLONG,
101-
OtherTransferCount: ULONGLONG,
102-
}
103-
104-
#[repr(C)]
105-
struct JOBOBJECT_BASIC_LIMIT_INFORMATION {
106-
PerProcessUserTimeLimit: LARGE_INTEGER,
107-
PerJobUserTimeLimit: LARGE_INTEGER,
108-
LimitFlags: DWORD,
109-
MinimumWorkingsetSize: SIZE_T,
110-
MaximumWorkingsetSize: SIZE_T,
111-
ActiveProcessLimit: DWORD,
112-
Affinity: ULONG_PTR,
113-
PriorityClass: DWORD,
114-
SchedulingClass: DWORD,
115-
}
38+
use winapi::shared::minwindef::{DWORD, FALSE, LPVOID};
39+
use winapi::um::errhandlingapi::SetErrorMode;
40+
use winapi::um::handleapi::{CloseHandle, DuplicateHandle};
41+
use winapi::um::jobapi2::{AssignProcessToJobObject, CreateJobObjectW, SetInformationJobObject};
42+
use winapi::um::processthreadsapi::{GetCurrentProcess, OpenProcess};
43+
use winapi::um::winbase::{BELOW_NORMAL_PRIORITY_CLASS, SEM_NOGPFAULTERRORBOX};
44+
use winapi::um::winnt::{
45+
JobObjectExtendedLimitInformation, DUPLICATE_SAME_ACCESS, JOBOBJECT_EXTENDED_LIMIT_INFORMATION,
46+
JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE, JOB_OBJECT_LIMIT_PRIORITY_CLASS, PROCESS_DUP_HANDLE,
47+
};
11648

11749
pub unsafe fn setup(build: &mut Build) {
11850
// Enable the Windows Error Reporting dialog which msys disables,

src/bootstrap/native.rs

+2
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,8 @@ impl Step for Llvm {
230230
cfg.define("CMAKE_SYSTEM_NAME", "NetBSD");
231231
} else if target.contains("freebsd") {
232232
cfg.define("CMAKE_SYSTEM_NAME", "FreeBSD");
233+
} else if target.contains("windows") {
234+
cfg.define("CMAKE_SYSTEM_NAME", "Windows");
233235
}
234236

235237
cfg.define("LLVM_NATIVE_BUILD", builder.llvm_out(builder.config.build).join("build"));

src/bootstrap/util.rs

+13-49
Original file line numberDiff line numberDiff line change
@@ -123,37 +123,24 @@ pub fn symlink_dir(config: &Config, src: &Path, dest: &Path) -> io::Result<()> {
123123
// what can be found here:
124124
//
125125
// http://www.flexhex.com/docs/articles/hard-links.phtml
126-
//
127-
// Copied from std
128126
#[cfg(windows)]
129-
#[allow(nonstandard_style)]
130127
fn symlink_dir_inner(target: &Path, junction: &Path) -> io::Result<()> {
131128
use std::ffi::OsStr;
132129
use std::os::windows::ffi::OsStrExt;
133130
use std::ptr;
134131

135-
const MAXIMUM_REPARSE_DATA_BUFFER_SIZE: usize = 16 * 1024;
136-
const GENERIC_WRITE: DWORD = 0x40000000;
137-
const OPEN_EXISTING: DWORD = 3;
138-
const FILE_FLAG_OPEN_REPARSE_POINT: DWORD = 0x00200000;
139-
const FILE_FLAG_BACKUP_SEMANTICS: DWORD = 0x02000000;
140-
const FSCTL_SET_REPARSE_POINT: DWORD = 0x900a4;
141-
const IO_REPARSE_TAG_MOUNT_POINT: DWORD = 0xa0000003;
142-
const FILE_SHARE_DELETE: DWORD = 0x4;
143-
const FILE_SHARE_READ: DWORD = 0x1;
144-
const FILE_SHARE_WRITE: DWORD = 0x2;
145-
146-
type BOOL = i32;
147-
type DWORD = u32;
148-
type HANDLE = *mut u8;
149-
type LPCWSTR = *const u16;
150-
type LPDWORD = *mut DWORD;
151-
type LPOVERLAPPED = *mut u8;
152-
type LPSECURITY_ATTRIBUTES = *mut u8;
153-
type LPVOID = *mut u8;
154-
type WCHAR = u16;
155-
type WORD = u16;
156-
132+
use winapi::shared::minwindef::{DWORD, WORD};
133+
use winapi::um::fileapi::{CreateFileW, OPEN_EXISTING};
134+
use winapi::um::handleapi::CloseHandle;
135+
use winapi::um::ioapiset::DeviceIoControl;
136+
use winapi::um::winbase::{FILE_FLAG_BACKUP_SEMANTICS, FILE_FLAG_OPEN_REPARSE_POINT};
137+
use winapi::um::winioctl::FSCTL_SET_REPARSE_POINT;
138+
use winapi::um::winnt::{
139+
FILE_SHARE_DELETE, FILE_SHARE_READ, FILE_SHARE_WRITE, GENERIC_WRITE,
140+
IO_REPARSE_TAG_MOUNT_POINT, MAXIMUM_REPARSE_DATA_BUFFER_SIZE, WCHAR,
141+
};
142+
143+
#[allow(non_snake_case)]
157144
#[repr(C)]
158145
struct REPARSE_MOUNTPOINT_DATA_BUFFER {
159146
ReparseTag: DWORD,
@@ -165,29 +152,6 @@ pub fn symlink_dir(config: &Config, src: &Path, dest: &Path) -> io::Result<()> {
165152
ReparseTarget: WCHAR,
166153
}
167154

168-
extern "system" {
169-
fn CreateFileW(
170-
lpFileName: LPCWSTR,
171-
dwDesiredAccess: DWORD,
172-
dwShareMode: DWORD,
173-
lpSecurityAttributes: LPSECURITY_ATTRIBUTES,
174-
dwCreationDisposition: DWORD,
175-
dwFlagsAndAttributes: DWORD,
176-
hTemplateFile: HANDLE,
177-
) -> HANDLE;
178-
fn DeviceIoControl(
179-
hDevice: HANDLE,
180-
dwIoControlCode: DWORD,
181-
lpInBuffer: LPVOID,
182-
nInBufferSize: DWORD,
183-
lpOutBuffer: LPVOID,
184-
nOutBufferSize: DWORD,
185-
lpBytesReturned: LPDWORD,
186-
lpOverlapped: LPOVERLAPPED,
187-
) -> BOOL;
188-
fn CloseHandle(hObject: HANDLE) -> BOOL;
189-
}
190-
191155
fn to_u16s<S: AsRef<OsStr>>(s: S) -> io::Result<Vec<u16>> {
192156
Ok(s.as_ref().encode_wide().chain(Some(0)).collect())
193157
}
@@ -212,7 +176,7 @@ pub fn symlink_dir(config: &Config, src: &Path, dest: &Path) -> io::Result<()> {
212176
ptr::null_mut(),
213177
);
214178

215-
let mut data = [0u8; MAXIMUM_REPARSE_DATA_BUFFER_SIZE];
179+
let mut data = [0u8; MAXIMUM_REPARSE_DATA_BUFFER_SIZE as usize];
216180
let db = data.as_mut_ptr() as *mut REPARSE_MOUNTPOINT_DATA_BUFFER;
217181
let buf = &mut (*db).ReparseTarget as *mut u16;
218182
let mut i = 0;

0 commit comments

Comments
 (0)