Rust on QNX
This blog shows how to build a Rust toolchain for QNX 7.1 OS.Below is my environment:
Host OS: Linux Mint 22.1
QNX: 7.1
To get started, let's get lastest Rust so we can use it to bootstrap the new toolchain
$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
$ sudo apt install build-essential cmake python3 perl git llvm-dev
$ source ~/qnx710/qnxsdp-env.sh $ mkdir ~/repo $ cd ~/repo $ git clone https://github.com/rust-lang/rust.git $ cd rust $ #create config.toml $ echo 'profile = "compiler"' > config.toml $ echo change-id = 999999 >> config.toml
$ export build_env=' CC_x86_64_unknown_nto_qnx710=qcc CFLAGS_x86_64_unknown_nto_qnx710=-Vgcc_ntox86_64_cxx CXX_x86_64_unknown_nto_qnx710=qcc AR_x86_64_unknown_nto_qnx710=ntox86_64-ar '
$ env $build_env \ ./x.py build \ --target x86_64-unknown-linux-gnu,x86_64-pc-nto-qnx710 \ rustc library/core library/alloc library/std
$ rustup toolchain link qnx-toolchain ~/repo/rust/build/x86_64-unknown-linux-gnu/stage1/
$ rustup default qnx-toolchain
$ ls ~/prj/hello-world/target/x86_64-pc-nto-qnx710/debug/hello-word
No comments:
Post a Comment