Skip to content

Commit

Permalink
Try #544:
Browse files Browse the repository at this point in the history
  • Loading branch information
bors-ferrocene[bot] committed Apr 26, 2024
2 parents 90f09c7 + 6d8fcd2 commit f271d3f
Show file tree
Hide file tree
Showing 8 changed files with 77 additions and 11 deletions.
26 changes: 25 additions & 1 deletion .circleci/workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,12 @@ jobs:
resource_class: large # 4-core
environment:
FERROCENE_HOST: x86_64-unknown-linux-gnu
FERROCENE_TARGETS: aarch64-unknown-linux-gnu,aarch64-unknown-none,thumbv7em-none-eabi,thumbv7em-none-eabihf,armv8r-none-eabihf,wasm32-unknown-unknown,armv7r-none-eabihf,armebv7r-none-eabihf
FERROCENE_TARGETS: aarch64-unknown-linux-gnu,aarch64-unknown-none,thumbv7em-none-eabi,thumbv7em-none-eabihf,armv8r-none-eabihf,wasm32-unknown-unknown,armv7r-none-eabihf,armebv7r-none-eabihf,aarch64-unknown-nto-qnx710,x86_64-pc-nto-qnx710
SCRIPT: |
./x.py --stage 2 dist rust-std
steps:
- ferrocene-job-dist:
qnx: true
restore-from-job: x86_64-linux-build

x86_64-linux-dist-src:
Expand Down Expand Up @@ -297,6 +298,7 @@ jobs:
FERROCENE_TARGETS: aarch64-unknown-none,x86_64-unknown-linux-gnu,aarch64-unknown-linux-gnu,thumbv7em-none-eabi,thumbv7em-none-eabihf,armv8r-none-eabihf,wasm32-unknown-unknown,armv7r-none-eabihf,armebv7r-none-eabihf
steps:
- aws-oidc-auth
- setup-qnx-toolchain: {}
- ferrocene-git-shallow-clone:
depth: 1
- run:
Expand Down Expand Up @@ -672,6 +674,9 @@ commands:
llvm-subset:
type: boolean
default: true
qnx:
type: boolean
default: false
steps:
- ferrocene-checkout:
llvm-subset: << parameters.llvm-subset >>
Expand All @@ -681,6 +686,11 @@ commands:
steps:
- ferrocene-setup-darwin
- aws-oidc-auth
- when:
condition:
equal: [<<parameters.qnx>>, true]
steps:
- setup-qnx-toolchain: {}
- run:
name: Restore files from the << parameters.restore-from-job >> job
command: ferrocene/ci/scripts/persist-between-jobs.sh restore << parameters.restore-from-job >>
Expand Down Expand Up @@ -879,6 +889,20 @@ commands:
path: /tmp/metrics
destination: metrics

setup-qnx-toolchain:
description: Setup QNX Toolchain
steps:
- run:
name: Fetch QNX710 toolchain
command: aws s3 cp s3://ferrocene-ci-mirrors/manual/qnx/qnx710.tar.zst - | zstd -d | tar x
- run:
name: Set PATH to include QNX710 tools
command: echo 'source $(pwd)/qnx710/qnxsdp-env.sh' >> "$BASH_ENV"
- run:
name: Start QNX License Server port forwarding
command: aws ssm start-session --target i-0accef99ca2244097 --document-name AWS-StartPortForwardingSession --parameters '{"portNumber":["56859"], "localPortNumber":["56859"]}'
background: true

aws-oidc-auth:
description: Authenticate with AWS using OIDC
steps:
Expand Down
11 changes: 11 additions & 0 deletions ferrocene/ci/configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,17 @@ add --release-description="Ferrocene by Ferrous Systems"
# #
##############################################################################

# QNX toolchains aren't automatically inferred, set them explicitly.
#
# Assumes `qnxsdp-env.sh` has been sourced or the binaries are otherwise
# already on path
add --set target.aarch64-unknown-nto-qnx710.cc=aarch64-unknown-nto-qnx7.1.0-gcc
add --set target.aarch64-unknown-nto-qnx710.cxx=aarch64-unknown-nto-qnx7.1.0-g++
add --set target.aarch64-unknown-nto-qnx710.ar=aarch64-unknown-nto-qnx7.1.0-ar
add --set target.x86_64-pc-nto-qnx710.cc=x86_64-pc-nto-qnx7.1.0-gcc
add --set target.x86_64-pc-nto-qnx710.cxx=x86_64-pc-nto-qnx7.1.0-g++
add --set target.x86_64-pc-nto-qnx710.ar=x86_64-pc-nto-qnx7.1.0-ar

# Set the host platform to build. The environment variable is set from the CI
# configuration (see the .circleci directory).
#
Expand Down
2 changes: 2 additions & 0 deletions ferrocene/ci/docker-images/ubuntu-20/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ RUN apt-get update \
libc6-dev-arm64-cross \
# Needed for thumbv7em-none-eabihf & armv8r-none-eabihf cross-compilation
gcc-arm-none-eabi \
# Needed for riscv64gc-unknown-linux-gnu cross compilation
gcc-riscv64-linux-gnu \
# Needed for the wasm32-unknown-unknown target
clang \
# Needed to install AWS CLI during the build:
Expand Down
2 changes: 2 additions & 0 deletions ferrocene/doc/release-notes/src/next.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ shipped as a preview.
* :target-with-triple:`armv7r-none-eabihf`
* :target-with-triple:`armebv7r-none-eabihf`
* :target-with-triple:`x86_64-apple-darwin`
* :target-with-triple:`aarch64-unknown-nto-qnx710`
* :target-with-triple:`x86_64-pc-nto-qnx710`

* Experimental support has been added for a new host platform.
Note that experimental targets are not qualified for safety critical use. The
Expand Down
22 changes: 12 additions & 10 deletions ferrocene/doc/target-names.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@
# In the documents, as long as the ferrocene_qualification extension is added,
# you can refer to them with :target:`triple`.

aarch64-unknown-none = "Armv8-A bare-metal"
thumbv7em-none-eabi = "Armv7E-M bare-metal (soft-float)"
thumbv7em-none-eabihf = "Armv7E-M bare-metal (hard-float)"
armv8r-none-eabihf = "Armv8-R bare-metal (hard-float)"
armv7r-none-eabihf = "Armv7-R bare-metal (hard-float)"
armebv7r-none-eabihf = "Armv7-R bare-metal (hard-float, big-endian)"
wasm32-unknown-unknown = "WASM bare-metal"
x86_64-unknown-linux-gnu = "x86-64 Linux (glibc)"
aarch64-apple-darwin = "Apple Silicon macOS"
x86_64-apple-darwin = "Intel macOS"
aarch64-unknown-none = "Armv8-A bare-metal"
thumbv7em-none-eabi = "Armv7E-M bare-metal (soft-float)"
thumbv7em-none-eabihf = "Armv7E-M bare-metal (hard-float)"
armv8r-none-eabihf = "Armv8-R bare-metal (hard-float)"
armv7r-none-eabihf = "Armv7-R bare-metal (hard-float)"
armebv7r-none-eabihf = "Armv7-R bare-metal (hard-float, big-endian)"
wasm32-unknown-unknown = "WASM bare-metal"
x86_64-unknown-linux-gnu = "x86-64 Linux (glibc)"
aarch64-apple-darwin = "Apple Silicon macOS"
x86_64-apple-darwin = "Intel macOS"
aarch64-unknown-nto-qnx710 = "Armv8-A QNX 7.1.0"
x86_64-pc-nto-qnx710 = "x86-64 QNX 7.1.0"
12 changes: 12 additions & 0 deletions ferrocene/doc/user-manual/src/targets/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,18 @@ should not be used in production.
- Bare-metal
- \-

* - :target:`aarch64-unknown-nto-qnx710`
- ``aarch64-unknown-nto-qnx710``
- Cross-compilation
- Full
- \-

* - :target:`x86_64-pc-nto-qnx710`
- ``x86_64-pc-nto-qnx710``
- Cross-compilation
- Full
- \-

* - :target:`wasm32-unknown-unknown`
- ``wasm32-unknown-unknown``
- Cross-compilation
Expand Down
11 changes: 11 additions & 0 deletions ferrocene/packages.toml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,17 @@ targets = [
name = "rust-std"
subset = "default"

[groups.qnx]
targets = [
"aarch64-unknown-nto-qnx710",
"x86_64-pc-nto-qnx710",
]

[[groups.cross-compilation.packages]]
name = "rust-std"
subset = "default"


[groups.oxidos]
targets = ["wasm32-unknown-unknown"]

Expand Down
2 changes: 2 additions & 0 deletions ferrocene/tools/self-test/src/targets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ static SUPPORTED_TARGETS: &[TargetSpec] = &[
TargetSpec { triple: "thumbv7em-none-eabi", std: false, linker: Linker::BundledLld },
TargetSpec { triple: "armv7r-none-eabihf", std: false, linker: Linker::BundledLld },
TargetSpec { triple: "armebv7r-none-eabihf", std: false, linker: Linker::BundledLld },
TargetSpec { triple: "aarch64-unknown-nto-qnx710", std: false, linker: Linker::BundledLld },
TargetSpec { triple: "x86_64-pc-nto-qnx710", std: false, linker: Linker::BundledLld },
TargetSpec { triple: "aarch64-apple-darwin", std: true, linker: Linker::BundledLld },
TargetSpec { triple: "x86_64-apple-darwin", std: true, linker: Linker::BundledLld },
];
Expand Down

0 comments on commit f271d3f

Please sign in to comment.