-
Notifications
You must be signed in to change notification settings - Fork 12.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add aarch64_unknown_nto_qnx700
target - QNX 7.0 support for aarch64le
#127897
base: master
Are you sure you want to change the base?
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
aarch64_unknown_nto_qnx700
target - QNX 7.0 support for aarch64leaarch64_unknown_nto_qnx700
target - QNX 7.0 support for aarch64le
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@rustbot author |
These commits modify compiler targets. |
@TaKO8Ki I think this PR is ready - as it can be merged without waiting for libc. Thx! |
@rustbot ready |
64c6cd4
to
367f5ea
Compare
Some changes occurred in src/doc/rustc/src/platform-support cc @Nilstrieb |
This comment has been minimized.
This comment has been minimized.
367f5ea
to
82e4590
Compare
82e4590
to
53d070a
Compare
I got a 7.0 license so I can give this a spin in the next week or so. |
Thx @jonathanpallant! I was able to build and run martin's |
I was able to run compiler tests, having to do some workarounds, and got To run, I had to add this line at the end in Most errors show this cryptic error:
|
I was able to build the target with the instructions above (although I note the libc crate warnings are a little troubling...). Now I just need to work out how to make a QNX Neutrino 7.0 disk image I can boot in QEMU. $ bash -c 'source ~/qnx700/qnxsdp-env.sh && cargo +stage1 build --target=aarch64-unknown-nto-qnx700 && file ./target/aarch64-unknown-nto-qnx700/debug/simpletest'
QNX_HOST=/Users/jonathan/qnx700/host/darwin/x86_64
QNX_TARGET=/Users/jonathan/qnx700/target/qnx7
MAKEFLAGS=-I/Users/jonathan/qnx700/target/qnx7/usr/include
Compiling simpletest v0.1.0 (/Users/jonathan/simpletest)
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.44s
./target/aarch64-unknown-nto-qnx700/debug/simpletest: ELF 64-bit LSB shared object, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /usr/lib/ldqnx-64.so.2, BuildID[md5/uuid]=ffd4b4fcd60ead8f6b41e5c64aec8ba4, with debug_info, not stripped |
Full testing notes, some of which may go into qnx md page: Build compiler# Configure qcc build environment
source _path_/qnx700/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 Configure remoteDo this from a new shell - we will need to run more commands in the previous one. I ran into these two issues.
Specifying # 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 suitAssume all previous environment variables are still set, or re-init them 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 |
Using the above method and a properly configured QNX 7.0, I got all but one test to pass: Fixed Test
|
8906423
to
0c93f54
Compare
These commits modify the If this was unintentional then you should revert the changes before this PR is merged. |
0c93f54
to
bea86fd
Compare
Digging deep into backtracing, at first it appeared as if it was simply disabled for QNX 7.0 by @samkearney in rust-lang/backtrace-rs#529, but re-enabling it produced the same test results (but has compiled without any issues). The original PR note:
I looked through both 7.0 and 7.1, and they do not appear any different - so not certain where that info came from. I am not certain this is a real block (most code would never care about parsing backtraces), but it does fail some unit tests. Any thoughts are welcome... |
@nyurik This was a while back, but I am fairly sure I couldn't get it to compile when I was trying it with 7.0, and was getting linker errors for the unwinding-related functions. But since you got it to compile it's evident that I was missing something, so I would discard my comment from before. It's worth noting that I was working only with x86 (32-bit) and didn't try aarch64. Unfortunately, since I did not get to the point of running tests, I don't have any insight on the test failures. |
@samkearney I just got all backtrace support to work as part of the rust-lang/backtrace-rs#648 -- note that it is using very new way to parse the stacktrace - it might be that the core code in that crate has changed its approach, and now it works? If you have a QNX x86 7.0 that I can ssh into, I could try to check the x86. Lets connect on https://rust-lang.zulipchat.com/ and discuss it there? In the mean time, any code review or a +1 would be great :) |
IMO, this is not a blocker for merging The use std::sync::Mutex;
enum Foo { X(Mutex<Option<Foo>>) }
impl Foo { fn bar(self) {} }
fn main() {} error[E0072]: recursive type `Foo` has infinite size
--> src/main.rs:28:1
|
28 | enum Foo { X(Mutex<Option<Foo>>) }
| ^^^^^^^^ --- recursive without indirection
|
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle
|
28 | enum Foo { X(Mutex<Option<Box<Foo>>>) }
| ++++ +
-error[E0391]: cycle detected when computing when `Foo` needs drop
- --> src/main.rs:28:1
- |
-28 | enum Foo { X(Mutex<Option<Foo>>) }
- | ^^^^^^^^
- |
- = note: ...which immediately requires computing when `Foo` needs drop again
- = note: cycle used when computing whether `Foo` needs drop
+error[E0391]: cycle detected when computing layout of `Foo`
+ |
+ = note: ...which requires computing layout of `std::sync::mutex::Mutex<core::option::Option<Foo>>`...
+ = note: ...which requires computing layout of `core::cell::UnsafeCell<core::option::Option<Foo>>`...
+ = note: ...which requires computing layout of `core::option::Option<Foo>`...
+ = note: ...which again requires computing layout of `Foo`, completing the cycle
+note: cycle used when elaborating drops for `<impl at src/main.rs:30:1: 30:9>::bar`
+ --> src/main.rs:30:12
+ |
+30 | impl Foo { fn bar(self) {} }
+ | ^^^^^^^^^^^^
= note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
Some errors have detailed explanations: E0072, E0391.
For more information about an error, try `rustc --explain E0072`.
error: could not compile `btdbg` (bin "btdbg") due to 2 previous errors |
@TaKO8Ki hi, are there any blockers to merge this? |
Previous QNX PRs and their reviewers, in case they have any feedback or want to review and merge this: |
This backports the 7.1 implementation to 7.0.
-lregex
disabled, see Disablelibregex
for QNX 7.0 libc#3775 (released in libc 0.2.156)libgcc.a
instead oflibgcc_s.so
(7.0 used ancient GCC 5.4 which didn't have gcc_s)backtrace
crate to support stack traces Add QNX NTO platform support backtrace-rs#648CC: to the folks who did the initial implementation: @flba-eb, @gh-tr, @jonathanpallant, @japaric
Use latest libc
Either use libc 0.2.156+, or do these steps:
rust/Cargo.toml
, add this line to the[patch.crates-io]
section. This version is based on v0.2.155 libc release plus the needed changes from Disablelibregex
for QNX 7.0 libc#3775rust/config.toml
, add these lines:cargo update -p libc
in therust
repo's rootCompile target
Compile "hello world"