Commit Graph

2300 Commits

Author SHA1 Message Date
newpavlov
cb52065d55 replace libc::nanosleep with wasi::poll_oneoff 2019-08-19 13:31:41 +03:00
newpavlov
23cc850ff1 return 0 from errno function 2019-08-19 10:44:08 +03:00
newpavlov
6896ed383d use wasi crate 2019-08-19 09:47:58 +03:00
Salim Nasser
f0b394bfb6 Fixed: error: unnecessary trailing semicolon 2019-08-17 18:56:38 -07:00
Mazdak Farrokhzad
e452738000 Rollup merge of #63546 - lzutao:clouldabi-maybeuninit, r=RalfJung
Remove uses of `mem::uninitialized()` from cloudabi

This PR removes uses of `mem::uninitialized` from `cloudabi` module,
excluding the layout test in `src/libstd/sys/cloudabi/abi/cloudabi.rs`.

r? @RalfJung
cc @EdSchouten
cc #62397
2019-08-15 14:34:04 +02:00
Mazdak Farrokhzad
1db4bbcced Rollup merge of #63155 - mfkl:uwp-msvc, r=alexcrichton
Add UWP MSVC targets

Hi,

- The README URI change is the correct one for VS2019 community edition, which I suspect most people would use. Doesn't _need_ to be merged though.
- This 5e6619edd1 fixes the UWP build (msvc or not, doesn't matter). I suspect it broke with recent changes unnoticed because no CI.
- Store lib location is found through the VCToolsInstallDir env variable. The end of the path is currently for the VS2019 store lib locations only.
- I could not test the aarch64_uwp_windows_msvc target because the rust build script does not currently support arm64 msvc AFAIU.
2019-08-15 14:33:58 +02:00
Lzu Tao
6e8639a418 Remove uses of mem::uninitialized() from cloudabi 2019-08-15 09:04:49 +00:00
Mark Rousskov
2601c86487 Handle cfg(bootstrap) throughout 2019-08-14 05:39:53 -04:00
Mazdak Farrokhzad
6743ad6726 Rollup merge of #63350 - iluuu1994:use-associated-type-bounds, r=Centril
Use associated_type_bounds where applicable - closes #61738
2019-08-10 08:13:19 +02:00
Ilija Tovilo
3a6a29b4ec Use associated_type_bounds where applicable - closes #61738 2019-08-08 22:39:15 +02:00
Mazdak Farrokhzad
76938abba1 Rollup merge of #63332 - marmistrz:truncate, r=alexcrichton
Add an overflow check in truncate implementation for Unix.

Closes #63326.
cc @alexcrichton
2019-08-08 16:33:37 +02:00
Marcin Mielniczuk
3adbf63b11 Move the TryInto import into the inner scope 2019-08-08 11:44:59 +02:00
Jeremy Soller
ebb648d4fb Fix cfg_if usage 2019-08-06 19:32:39 -06:00
Jeremy Soller
0498da9a3d redox: convert to target_family unix 2019-08-06 16:18:23 -06:00
Marcin Mielniczuk
3cd9f3f6ab Add an overflow check in truncate implementation for Unix. 2019-08-06 19:35:54 +02:00
Thomas de Zeeuw
dad56c3947 Add {IoSlice, IoSliceMut}::advance 2019-08-03 10:44:45 +02:00
bors
d9bd4b289f Auto merge of #63228 - Centril:rollup-x39p5ga, r=Centril
Rollup of 7 pull requests

Successful merges:

 - #63107 (Added support for armv7-unknown-linux-gnueabi/musleabi)
 - #63121 (On `format!()` arg count mismatch provide extra info)
 - #63196 (build_helper: try less confusing method names)
 - #63206 (remove unsupported test case)
 - #63208 (Round generator sizes to a multiple of their alignment)
 - #63212 (Pretty print attributes in `print_arg`)
 - #63215 (Clarify semantics of mem::zeroed)

Failed merges:

r? @ghost
2019-08-02 22:44:53 +00:00
Mazdak Farrokhzad
ed7b0447cb Rollup merge of #63206 - BaoshanPang:master, r=alexcrichton
remove unsupported test case

r? @alexcrichton
2019-08-03 00:09:09 +02:00
bors
b0e40bfba4 Auto merge of #62309 - jlevon:62302, r=alexcrichton
provide thread name to OS for Solarish systems

Fixes #62302

Passes a Linux bootstrap build. python x.py test src/tools/tidy happy.
I tested this with a small test binary that spawns a few threads, and verified
that:

 - on an illumos system lacking the libc function, the binary runs but no OS-level
    thread names are set
 - on an illumos system with the feature, the binary runs, and the thread names are
    visible and correct under tools like MDB, pstack, core dump, etc.
2019-08-02 19:06:53 +00:00
Baoshan Pang
208672f0d5 remove unsupported test case 2019-08-02 09:32:46 -07:00
John Levon
6be2d9ae86 provide thread name to OS for Solarish systems 2019-08-02 09:37:23 +01:00
gnzlbg
74dc2b6f6f Remove mach dependency 2019-08-01 17:01:33 +02:00
gnzlbg
9ea83f9732 Update libc and use the Mach kernel APIs via the mach crate instead. 2019-08-01 17:01:33 +02:00
Martin Finkel
5e6619edd1 Fix UWP build 2019-07-31 16:39:25 +07:00
Mazdak Farrokhzad
cdf97589df Rollup merge of #63117 - BaoshanPang:bugfix, r=alexcrichton
Use global variable 'environ' to pass environments to rtpSpawn

r? @alexcrichton
2019-07-30 22:43:36 +02:00
Baoshan Pang
f6906ba11b use gloabl variable 'environ' to pass environments to rtpSpawn 2019-07-29 10:19:59 -07:00
Joe Richey
0cdd693bf6 vxworks: Remove Linux-specific comments. 2019-07-28 23:09:21 -07:00
Mazdak Farrokhzad
778b631ff0 Rollup merge of #62809 - alexcrichton:wasm-llvm-9, r=nikic
rustc: Update wasm32 support for LLVM 9

This commit brings in a number of minor updates for rustc's support for
the wasm target which has changed in the LLVM 9 update. Notable updates
include:

* The compiler now no longer manually inserts the `producers` section,
  instead relying on LLVM to do so. LLVM uses the `llvm.ident` metadata
  for the `processed-by` directive (which is now emitted on the wasm
  target in this PR) and it uses debuginfo to figure out what `language`
  to put in the `producers` section.

* Threaded WebAssembly code now requires different flags to be passed
  with LLD. In LLD we now pass:

  * `--shared-memory` - required since objects are compiled with
    atomics. This also means that the generated memory will be marked as
    `shared`.
  * `--max-memory=1GB` - required with the `--shared-memory` argument
    since shared memories in WebAssembly must have a maximum size. The
    1GB number is intended to be a conservative estimate for rustc, but
    it should be overridable with `-C link-arg` if necessary.
  * `--passive-segments` - this has become the default for multithreaded
    memory, but when compiling a threaded module all data segments need
    to be marked as passive to ensure they don't re-initialize memory
    for each thread. This will also cause LLD to emit a synthetic
    function to initialize memory which users will have to arrange to
    call.
  * The `__heap_base` and `__data_end` globals are explicitly exported
    since they're now hidden by default due to the `--export` flags we
    pass to LLD.
2019-07-29 02:10:52 +02:00
Mazdak Farrokhzad
b405aa2d03 Rollup merge of #62806 - mati865:clippy, r=TimNN
Fix few Clippy warnings
2019-07-28 11:11:08 +02:00
Mazdak Farrokhzad
4ad743c022 Rollup merge of #63013 - nivkner:ffi-safe-slice, r=sfackler
add `repr(transparent)` to `IoSliceMut` where missing

tried using `IoSliceMut` in FFI, got `improper_ctypes` warning.

according to the docs: `IoSliceMut` is  "guaranteed to be ABI compatible with the `iovec` type" so it should be usable in FFI.
`IoSlice` is also `repr(transparent)` for every platform where these types contain `iovec`-like types.
vxworks also has `IoSliceMut` as transparent so its not even consistently one or the other.

no comment about this next to the types or in the PR that introduced the types, so assuming this was just missed.

r? @sfackler
2019-07-27 17:40:49 +02:00
Mazdak Farrokhzad
15398b6b35 Rollup merge of #62980 - alexcrichton:windows-metadata, r=sfackler
std: Add more accessors for `Metadata` on Windows

This commit adds accessors for more fields in `fs::Metadata` on Windows
which weren't previously exposed. There's two sources of `fs::Metadata`
on Windows currently, one from `DirEntry` and one from a file itself.
These two sources of information don't actually have the same set of
fields exposed in their stat information, however. To handle this the
platform-specific accessors of Windows-specific information all return
`Option` to return `None` in the case a metadata comes from a
`DirEntry`, but they're guaranteed to return `Some` if it comes from a
file itself.

This is motivated by some changes in CraneStation/wasi-common#42, and
I'm curious how others feel about this platform-specific functionality!
2019-07-26 18:56:58 +02:00
Mazdak Farrokhzad
ceea0be207 Rollup merge of #62862 - BaoshanPang:cleanup, r=alexcrichton
code cleanup

remove all codes that are not used by vxWorks
2019-07-26 18:56:47 +02:00
Niv Kaminer
d7b211025e add repr(transparent) to IoSliceMut where missing 2019-07-26 18:56:47 +03:00
Alex Crichton
c69f367baf std: Add more accessors for Metadata on Windows
This commit adds accessors for more fields in `fs::Metadata` on Windows
which weren't previously exposed. There's two sources of `fs::Metadata`
on Windows currently, one from `DirEntry` and one from a file itself.
These two sources of information don't actually have the same set of
fields exposed in their stat information, however. To handle this the
platform-specific accessors of Windows-specific information all return
`Option` to return `None` in the case a metadata comes from a
`DirEntry`, but they're guaranteed to return `Some` if it comes from a
file itself.

This is motivated by some changes in CraneStation/wasi-common#42, and
I'm curious how others feel about this platform-specific functionality!
2019-07-26 07:35:59 -07:00
Hugo Beauzée-Luyssen
e88a4cee52 std: win: Disable stack overflow handling on UWP
The required functions are not available, so hope for the best
2019-07-25 21:30:08 +02:00
Hugo Beauzée-Luyssen
668f0d3495 std: win: Don't use console APIs on UWP 2019-07-25 21:30:08 +02:00
Hugo Beauzée-Luyssen
4c05073d1d std: win: Don't use GetFileInformationByHandle on UWP 2019-07-25 21:30:08 +02:00
Hugo Beauzée-Luyssen
a24be59b46 std: win: Don't use GetUserProfileDirectoryW on UWP 2019-07-25 21:30:08 +02:00
Hugo Beauzée-Luyssen
ef267284e8 std: win: Don't expose link() on UWP
Or rather expose it, but always return an error
2019-07-25 21:30:08 +02:00
Hugo Beauzée-Luyssen
a713a0399a std: win: Don't use SetHandleInformation on UWP
Attempt to create sockets with the WSA_FLAG_NO_HANDLE_INHERIT flag, and
handle the potential error gracefully (as the flag isn't support on
Windows 7 before SP1)
2019-07-25 21:30:08 +02:00
Hugo Beauzée-Luyssen
9407ed759f std: rand: Use BCrypt on UWP
As Rtl* functions are not allowed there
2019-07-25 21:30:08 +02:00
Hugo Beauzée-Luyssen
e34bcdbc57 libstd: windows: compat: Allow use of attributes 2019-07-25 21:30:08 +02:00
Alex Crichton
dc50a633f3 std: Use native #[thread_local] TLS on wasm
This commit moves `thread_local!` on WebAssembly targets to using the
`#[thread_local]` attribute in LLVM. This was recently implemented
upstream and is [in the process of being documented][dox]. This change
only takes affect if modules are compiled with `+atomics` which is
currently unstable and a pretty esoteric method of compiling wasm
artifacts.

This "new power" of the wasm toolchain means that the old
`wasm-bindgen-threads` feature of the standard library can be removed
since it should now be possible to create a fully functioning threaded
wasm module without intrusively dealing with libstd symbols or
intrinsics. Yay!

[dox]: https://github.com/WebAssembly/tool-conventions/pull/116
2019-07-25 11:17:07 -07:00
Nathan
b70f217262 Use raw pointers in std::sys::cloudabi when passing MaybeUninit values 2019-07-23 13:51:28 -04:00
Nathan
0ac6afafa6 Cleanup std::sys::cloudabi 2019-07-23 13:49:37 -04:00
Nathan
82dd54baf3 Modify CloudABI ReentrantMutex to use MaybeUninit
Remove uses of mem::uninitialized, which is now deprecated
2019-07-23 10:14:46 -04:00
Nathan
e1e0df8a49 Remove uses of mem::uninitialized in std::sys::cloudabi
Usages still appear in cloudabi tests and in the reentrant mutex implementation
2019-07-22 20:42:08 -04:00
Baoshan Pang
279c399599 code cleanup 2019-07-21 18:29:24 -07:00
Ralf Jung
33452b0587 warn about deprecated-in-future in most of libstd 2019-07-19 09:35:32 +02:00
Mateusz Mikuła
124f6ef7cd Fix clippy::len_zero warnings 2019-07-18 15:14:56 +02:00