Commit Graph

159 Commits

Author SHA1 Message Date
Jan Sommer 6f435cb07f Port std library to RTEMS 2024-09-03 09:19:29 +02:00
bors 1a1cc050d8 Auto merge of #127897 - nyurik:add-qnx-70-target, r=saethlin
add `aarch64_unknown_nto_qnx700` target - QNX 7.0 support for aarch64le

This backports the QNX 7.1 aarch64 implementation to 7.0.

* [x] required `-lregex` disabled, see https://github.com/rust-lang/libc/pull/3775 (released in libc 0.2.156)
* [x] uses `libgcc.a` instead of `libgcc_s.so` (7.0 used ancient GCC 5.4 which didn't have gcc_s)
* [x] a fix in `backtrace` crate to support stack traces https://github.com/rust-lang/backtrace-rs/pull/648

This PR bumps libc dependency to 0.2.158

CC: to the folks who did the [initial implementation](https://doc.rust-lang.org/rustc/platform-support/nto-qnx.html): `@flba-eb,` `@gh-tr,` `@jonathanpallant,` `@japaric`

# Compile target

```bash
# Configure qcc build environment
source _path_/_to_/qnx7.0/qnxsdp-env.sh

# Tell rust to use qcc when building QNX 7.0 targets
export build_env='
    CC_aarch64-unknown-nto-qnx700=qcc
    CFLAGS_aarch64-unknown-nto-qnx700=-Vgcc_ntoaarch64le_cxx
    CXX_aarch64-unknown-nto-qnx700=qcc
    AR_aarch64_unknown_nto_qnx700=ntoaarch64-ar'

# Build rust compiler, libs, and the remote test server
env $build_env ./x.py build \
  --target x86_64-unknown-linux-gnu,aarch64-unknown-nto-qnx700 \
  rustc library/core library/alloc library/std src/tools/remote-test-server

rustup toolchain link stage1 build/host/stage1
```

# Compile "hello world"

```bash
source _path_/_to_/qnx7.0/qnxsdp-env.sh

cargo new hello_world
cd hello_world
cargo +stage1 build --release --target aarch64-unknown-nto-qnx700
```

# Configure a remote for testing

Do this from a new shell - we will need to run more commands in the previous one.  I ran into these two issues, and found some workarounds.

* Temporary dir might not work properly
* Default `remote-test-server` has issues binding to an address

```
# ./remote-test-server
starting test server
thread 'main' panicked at src/tools/remote-test-server/src/main.rs:175:29:
called `Result::unwrap()` on an `Err` value: Os { code: 249, kind: AddrNotAvailable, message: "Can't assign requested address" }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
```

Specifying `--bind` param actually fixes that, and so does setting `TMPDIR` properly.

```bash
# Copy remote-test-server to remote device. You may need to use sftp instead.
# ATTENTION: Note that the path is different from the one in the remote testing documentation for some reason
scp ./build/x86_64-unknown-linux-gnu/stage1-tools-bin/remote-test-server  qnxdevice:/path/

# Run ssh with port forwarding - so that rust tester can connect to the local port instead
ssh -L 12345:127.0.0.1:12345 qnxdevice

# on the device, run
rm -rf tmp && mkdir -p tmp && TMPDIR=$PWD/tmp ./remote-test-server --bind 0.0.0.0:12345
```

# Run test suit

Assume all previous environment variables are still set, or re-init them

```bash
export TEST_DEVICE_ADDR="localhost:12345"

# tidy needs to be skipped due to using un-published libc dependency
export exclude_tests='
    --exclude src/bootstrap
    --exclude src/tools/error_index_generator
    --exclude src/tools/linkchecker
    --exclude src/tools/tidy
    --exclude tests/ui-fulldeps
    --exclude rustc
    --exclude rustdoc
    --exclude tests/run-make-fulldeps'

env $build_env ./x.py test  $exclude_tests --stage 1 --target aarch64-unknown-nto-qnx700
```

try-job: dist-x86_64-msvc
2024-09-01 08:00:25 +00:00
Yuri Astrakhan f41e0bb41d Squashed `aarch64_unknown_nto_qnx700` support 2024-08-30 01:19:55 -04:00
Amjad Alsharafi 555414e683
Update `compiler_builtins` to `0.1.123`
Signed-off-by: Amjad Alsharafi <26300843+Amjad50@users.noreply.github.com>
2024-08-29 08:38:19 +08:00
Scott McMurray 62f7d5305e Update `compiler_builtins` to `0.1.121` 2024-08-23 12:02:26 -07:00
Amjad Alsharafi 57b164a9d2
Update `compiler_builtins` to `0.1.120`
Signed-off-by: Amjad Alsharafi <26300843+Amjad50@users.noreply.github.com>
2024-08-22 14:26:31 +08:00
Matthias Krüger f4c860a996
Rollup merge of #128873 - ChrisDenton:windows-targets, r=Mark-Simulacrum
Add windows-targets crate to std's sysroot

With this PR, when backtrace is used as a crate from crates.io it will (once updated) use the real [windows-targets](https://crates.io/crates/windows-targets) crate. But when used from std it'll use std's replacement version.

This allows sharing our customized `windows_tagets::link!` macro between std proper and the backtrace crate when used as part of std, ensuring a consistent linking story. This will be especially important once we move to using [`raw-dylib`](https://doc.rust-lang.org/reference/items/external-blocks.html#dylib-versus-raw-dylib) by default.
2024-08-14 05:05:51 +02:00
Chris Denton acb024110f
Add windows-targets crate to std's sysroot 2024-08-09 10:43:43 +00:00
Guillaume Gomez 6d69b2e408 Update compiler-builtins version to 0.1.118 2024-08-08 14:47:49 +02:00
Trevor Gross 51e68c3006 Update `compiler-builtins` to 0.1.117
This includes [1] which means we can remove the (nonworking)
configuration of `no-f16-f128`.

Fixes https://github.com/rust-lang/rust/issues/128401.

[1]: https://github.com/rust-lang/compiler-builtins/pull/652
2024-08-06 21:48:32 -05:00
bors 80d8270d84 Auto merge of #125016 - nicholasbishop:bishop-cb-112, r=tgross35
Update compiler_builtins to 0.1.114

The `weak-intrinsics` feature was removed from compiler_builtins in https://github.com/rust-lang/compiler-builtins/pull/598, so dropped the `compiler-builtins-weak-intrinsics` feature from alloc/std/sysroot.

In https://github.com/rust-lang/compiler-builtins/pull/593, some builtins for f16/f128 were added. These don't work for all compiler backends, so add a `compiler-builtins-no-f16-f128` feature and disable it for cranelift and gcc.
2024-07-29 07:41:33 +00:00
Nicholas Bishop ecf2963baf Update compiler_builtins to 0.1.114
The `weak-intrinsics` feature was removed from compiler_builtins in
https://github.com/rust-lang/compiler-builtins/pull/598, so dropped the
`compiler-builtins-weak-intrinsics` feature from alloc/std/sysroot.

In https://github.com/rust-lang/compiler-builtins/pull/593, some
builtins for f16/f128 were added. These don't work for all compiler
backends, so add a `compiler-builtins-no-f16-f128` feature and disable
it for cranelift and gcc. Also disable it for LLVM targets that don't
support it.
2024-07-28 20:43:07 -04:00
bors f751af4d78 Auto merge of #127153 - NobodyXu:pipe, r=ChrisDenton
Initial implementation of anonymous_pipe API

ACP completed in rust-lang/libs-team#375
Tracking issue: #127154

try-job: x86_64-msvc
try-job: i686-mingw
2024-07-24 00:03:14 +00:00
Jiahao XU c9c8a14884
Initial implementation of anonymous_pipe
Co-authored-by: Alphyr <47725341+a1phyr@users.noreply.github.com>
Co-authored-by: Jubilee <46493976+workingjubilee@users.noreply.github.com>
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2024-07-23 23:13:56 +10:00
Ayush Singh e2903989da
uefi: process: Fixes from PR
- Update system table crc32
- Fix unsound use of Box
- Free exit data
- Code improvements
- Introduce OwnedTable
- Update r-efi to latest version
- Use extended_varargs_abi_support for
  install_multiple_protocol_interfaces and
  uninstall_multiple_protocol_interfaces
- Fix comments
- Stub out args implementation

Signed-off-by: Ayush Singh <ayushdevel1325@gmail.com>
2024-07-19 17:44:27 +05:30
Chris Denton e136f08a6f
Add experimental raw-dylib feature to std
For Windows, this allows defining imports without needing the user to have import libraries. It's intended for this to become the default.
2024-07-05 16:11:25 +00:00
Urgau f026e0bfc1 Cleanup bootstrap check-cfg 2024-06-27 11:30:03 +02:00
Stefan Lankes 1f125a6716 add HermitOS support of vectored read/write operations
In general, the I/O interface of hermit-abi is more POSIX-like
interface. Consequently, platform abstraction layer for HermitOS
has slightly adjusted and some inaccuracies remove.
2024-06-07 20:48:30 +02:00
Jubilee Young 49c2a1dda9 Update backtrace to 0.3.73 2024-06-06 22:50:45 -07:00
Jubilee Young 3ec9d8db27 Sync libstd deps with backtrace 2024-05-27 19:53:41 -07:00
Urgau 02eada8f8d Remove now outdated comment since we bumped stage0 2024-05-24 08:08:41 +02:00
Urgau 45ad60d05a Copy core/alloc check-cfg message also in std 2024-05-23 16:08:34 +02:00
Urgau 28689850e5 Move some expected cfgs to std build.rs as per Cargo recommandation 2024-05-23 16:08:31 +02:00
Urgau 324b66c553 Expect any feature cfg in core and std crates 2024-05-23 15:20:25 +02:00
Lzu Tao 73602bf408 Update check-cfg lists for std 2024-05-21 18:17:55 +00:00
Matthias Krüger 4abf179b14
Rollup merge of #125011 - diondokter:opt-for-size, r=Amanieu,kobzol
Add opt-for-size core lib feature flag

Adds a feature flag to the core library that enables the possibility to have smaller implementations for certain algorithms.

So far, the core lib has traded performance for binary size. This is likely what most people want since they have big simd-capable machines. However, people on small machines, like embedded devices, don't enjoy the potential speedup of the bigger algorithms, but do have to pay for them. These microcontrollers often only have 16-1024kB of flash memory.

This PR is the result of some talks with project members like `@Amanieu` at RustNL.
There are some open questions of how this is eventually stabilized, but it's a similar question as with the existing `panic_immediate_abort` feature.

Speaking as someone from the embedded side, we'd rather have this unstable for a while as opposed to not having it at all. In the meantime we can try to use it and also add additional PRs to the core lib that uses the feature flag in areas where we find benefit.

Open questions from my side:
- Is this a good feature name?
  - `panic_immediate_abort` is fairly verbose, so I went with something equally verbose
  - It's easy to refactor later
- I've added the feature to `std` and `alloc` as well as they might benefit too. Do we agree?
  - I expect these to get less usage out of the flag since most size-constraint projects don't use these libraries often.
2024-05-21 12:47:04 +02:00
Ben Kimock aa31281f2d Remove Windows dependency on libc 2024-05-20 11:13:31 -04:00
Mads Marquart 74012d5200 Update libc to 0.2.155 2024-05-18 00:48:57 +02:00
Mark Rousskov 3aa16f0d2f Pin libc back to 0.2.153 2024-05-11 10:25:37 -04:00
Dion Dokter 579266a6be Add flag to std and alloc too 2024-05-11 14:20:03 +02:00
Martin Nordholts 9af3b1eff4 library/std: Remove unused `gimli-symbolize` feature
library/backtrace also declares a feature called `gimli-symbolize` which
appear used, but the feature in std with the same name is unused, so
remove it.
2024-05-02 06:51:17 +02:00
Chris Denton b1f1039d8b
Replace libc::c_int with core::ffi::c_int
And remove the libc crate when it isn't needed
2024-04-14 07:11:51 +00:00
Stefan Lankes 3726cbb5fe add platform-specific function to get the error number for HermitOS
Extending `std` to get the last error number for HermitOS.

HermitOS is a tier 3 platform and this PR changes only files,
wich are related to the tier 3 platform.
2024-02-28 23:01:56 +01:00
Aphek ee8703315e Update libc to 0.2.153 2024-02-01 23:58:42 -03:00
Brian Cain d5c39d0638 Update compiler_builtins to 0.1.105
This provides the builtins for the hexagon architecture.
2024-01-09 20:30:56 -08:00
Guillaume Gomez 87b0de6cb7
Rollup merge of #118645 - Patryk27:bump-compiler-builtins, r=Nilstrieb,dtolnay
chore: Bump compiler_builtins

Actually closes https://github.com/rust-lang/rust/issues/118079.
2024-01-09 17:52:20 +01:00
Kai Luo 9f64023096 Use different cfg for AIX 2023-12-13 10:15:27 +08:00
Kai Luo d2402e3f0d Add xcoff support 2023-12-12 10:20:06 +08:00
Patryk Wychowaniec a2b79cd92f
chore: Bump compiler_builtins
Actually closes https://github.com/rust-lang/rust/issues/118079.
2023-12-05 15:58:07 +01:00
Urgau 15719a8c1d libc: bump dependency to 0.2.150 2023-11-05 18:32:10 +01:00
Nicholas Bishop 5d3535c616 Bump compiler_builtins to 0.1.103 2023-11-04 13:11:10 -04:00
Ben Kimock 2e7364a586 Increase the reach of panic_immediate_abort 2023-10-29 09:31:07 -04:00
bors d60d63fbf7 Auto merge of #116527 - sthibaul:libc, r=Mark-Simulacrum
Bump libc dependency

To get GNU/Hurd support, so that CI of external repositories (e.g. getrandom) can build std.
2023-10-15 15:17:17 +00:00
Peter Jaszkowiak 49aa5a23ca Revert "Invoke `backtrace-rs` buildscript in `std` buildscript"
This reverts commit 93677276bc
because it caused issues for projects building the standard
library with non-cargo build systems.
2023-10-13 13:43:00 -06:00
Samuel Thibault 04d4336009 Bump libc dependency
To get GNU/Hurd support, so that CI of external repositories (e.g. getrandom)
can build std.
2023-10-08 19:56:44 +02:00
Peter Jaszkowiak 93677276bc Invoke `backtrace-rs` buildscript in `std` buildscript
Based on #99883 by @Arc-blroth
Depends on rust-lang/backtrace-rs#556 and rust-lang/cc-rs#705
2023-10-02 19:34:27 -06:00
Ayush Singh 7a956441a1
Fixes from PR
- Some comment fixes.
- Make some functions unsafe.
- Make helpers module private.
- Rebase on master
- Update r-efi to v4.2.0

Signed-off-by: Ayush Singh <ayushsingh1325@gmail.com>
2023-09-22 17:23:33 +05:30
Ayush Singh 48c6ae0611
Add Minimal Std implementation for UEFI
Implemented modules:
1. alloc
2. os_str
3. env
4. math

Tracking Issue: https://github.com/rust-lang/rust/issues/100499
API Change Proposal: https://github.com/rust-lang/libs-team/issues/87

This was originally part of https://github.com/rust-lang/rust/pull/100316. Since
that PR was becoming too unwieldy and cluttered, and with suggestion
from @dvdhrm, I have extracted a minimal std implementation to this PR.

Signed-off-by: Ayush Singh <ayushsingh1325@gmail.com>
2023-09-22 17:23:30 +05:30
Guillaume Gomez 6cfc6a8705
Rollup merge of #115839 - Dirreke:bump-libc, r=dtolnay
Bump libc to 0.2.148
2023-09-19 11:35:51 +02:00
dirreke b8044774ff Bump libc to 0.2.148 2023-09-14 16:56:49 +08:00