From 2d3a0ab3512885e3e1452d8c86f9943cd8d9d473 Mon Sep 17 00:00:00 2001 From: simonsan <14062932+simonsan@users.noreply.github.com> Date: Sat, 30 Nov 2024 21:01:37 +0100 Subject: [PATCH] feat: add base support for armv7-unknown-linux-gnueabihf in configuration and targets (#76) Signed-off-by: simonsan <14062932+simonsan@users.noreply.github.com> --- .cargo/config.toml | 2 ++ .github/install-arm-linkers.yml | 5 +++++ .github/workflows/cross-ci.yml | 10 +++++----- .github/workflows/nightly.yml | 12 ++++++------ .github/workflows/prebuilt-pr.yml | 12 ++++++------ .github/workflows/release.yml | 5 +++++ Cross.toml | 12 ------------ dist-workspace.toml | 8 +++++--- 8 files changed, 34 insertions(+), 32 deletions(-) create mode 100644 .github/install-arm-linkers.yml diff --git a/.cargo/config.toml b/.cargo/config.toml index 2544dcc..e3bd868 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -21,3 +21,5 @@ linker = "i686-linux-gnu-gcc" [env] CC_i686-unknown-linux-gnu = "i686-linux-gnu-gcc" CC_aarch64_unknown_linux_musl = "aarch64-linux-gnu-gcc" +CC_armv7_unknown_linux_gnueabihf = "arm-linux-gnueabihf-gcc" +CC_armv7_unknown_linux_musleabihf = "arm-linux-gnueabihf-gcc" diff --git a/.github/install-arm-linkers.yml b/.github/install-arm-linkers.yml new file mode 100644 index 0000000..7f05778 --- /dev/null +++ b/.github/install-arm-linkers.yml @@ -0,0 +1,5 @@ +- name: Install armv7 and aarch64 Linkers + if: runner.os == 'Linux' + run: | + sudo apt install gcc-aarch64-linux-gnu + sudo apt install gcc-arm-none-eabi diff --git a/.github/workflows/cross-ci.yml b/.github/workflows/cross-ci.yml index 64d3039..fb0689b 100644 --- a/.github/workflows/cross-ci.yml +++ b/.github/workflows/cross-ci.yml @@ -76,11 +76,11 @@ jobs: target: i686-unknown-linux-gnu architecture: i386 use-cross: true - # - os: ubuntu-latest - # os-name: linux - # target: armv7-unknown-linux-gnueabihf - # architecture: armv7 - # use-cross: true + - os: ubuntu-latest + os-name: linux + target: armv7-unknown-linux-gnueabihf + architecture: armv7 + use-cross: true steps: - name: Checkout repository diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index f3f25dc..dc16582 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -79,12 +79,12 @@ jobs: architecture: i386 binary-postfix: "" use-cross: true - # - os: ubuntu-latest - # os-name: linux - # target: armv7-unknown-linux-gnueabihf - # architecture: armv7 - # binary-postfix: "" - # use-cross: true + - os: ubuntu-latest + os-name: linux + target: armv7-unknown-linux-gnueabihf + architecture: armv7 + binary-postfix: "" + use-cross: true steps: - name: Checkout repository diff --git a/.github/workflows/prebuilt-pr.yml b/.github/workflows/prebuilt-pr.yml index 90f9a22..d03ef83 100644 --- a/.github/workflows/prebuilt-pr.yml +++ b/.github/workflows/prebuilt-pr.yml @@ -74,12 +74,12 @@ jobs: architecture: i386 binary-postfix: "" use-cross: true - # - os: ubuntu-latest - # os-name: linux - # target: armv7-unknown-linux-gnueabihf - # architecture: armv7 - # binary-postfix: "" - # use-cross: true + - os: ubuntu-latest + os-name: linux + target: armv7-unknown-linux-gnueabihf + architecture: armv7 + binary-postfix: "" + use-cross: true steps: - name: Checkout repository diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index aedca7d..41003f1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -119,6 +119,11 @@ jobs: - uses: actions/checkout@v4 with: submodules: recursive + - name: "Install armv7 and aarch64 Linkers" + if: "runner.os == 'Linux'" + run: | + sudo apt install gcc-aarch64-linux-gnu + sudo apt install gcc-arm-none-eabi - uses: swatinem/rust-cache@v2 with: key: ${{ join(matrix.targets, '-') }} diff --git a/Cross.toml b/Cross.toml index 68a0447..afdbd85 100644 --- a/Cross.toml +++ b/Cross.toml @@ -1,18 +1,6 @@ -[target.x86_64-pc-windows-gnu] -# additional commands to run prior to building the package -pre-build = [ - "dpkg --add-architecture $CROSS_DEB_ARCH", - "apt-get update && apt-get --assume-yes install nasm:$CROSS_DEB_ARCH libssl-dev:$CROSS_DEB_ARCH", -] - [target.i686-unknown-linux-gnu] image = "ghcr.io/cross-rs/i686-unknown-linux-gnu:edge" pre-build = [ "dpkg --add-architecture $CROSS_DEB_ARCH", "apt-get update && apt-get --assume-yes install gcc-multilib-i686-linux-gnu gcc-i686-linux-gnu", ] - -[target.x86_64-pc-windows-gnu.env] -passthrough = [ - "AWS_LC_SYS_PREBUILT_NASM=1", -] diff --git a/dist-workspace.toml b/dist-workspace.toml index 853d267..c54f617 100644 --- a/dist-workspace.toml +++ b/dist-workspace.toml @@ -25,12 +25,14 @@ pr-run-mode = "upload" tap = "rustic-rs/homebrew-tap" # Publish jobs to run in CI publish-jobs = ["homebrew"] +github-build-setup = "../install-arm-linkers.yml" [dist.github-custom-runners] aarch64-apple-darwin = "macos-latest" aarch64-unknown-linux-gnu = "ubuntu-latest" aarch64-unknown-linux-musl = "ubuntu-latest" armv7-unknown-linux-gnueabihf = "ubuntu-latest" +armv7-unknown-linux-musleabihf = "ubuntu-latest" i686-unknown-linux-gnu = "ubuntu-latest" x86_64-apple-darwin = "macos-13" x86_64-pc-windows-gnu = "windows-latest" @@ -43,8 +45,8 @@ nasm = '*' # Required for building `aws-lc-sys` on Windows [dist.dependencies.apt] gcc-aarch64-linux-gnu = { version = '*', targets = ["aarch64-unknown-linux-gnu", "aarch64-unknown-linux-musl"] } -gcc-arm-linux-gnueabihf = { version = '*', targets = ["armv7-unknown-linux-gnueabihf"] } +gcc-arm-linux-gnueabihf = { version = '*', targets = ["armv7-unknown-linux-gnueabihf", "armv7-unknown-linux-musleabihf"] } gcc-i686-linux-gnu = { version = '*', targets = ["i686-unknown-linux-gnu"] } gcc-multilib-i686-linux-gnu = { version = '*', targets = ["i686-unknown-linux-gnu"] } -musl-tools = { version = '*', targets = ["aarch64-unknown-linux-musl", "x86_64-unknown-linux-musl"] } -musl-dev = { version = '*', targets = ["aarch64-unknown-linux-musl", "x86_64-unknown-linux-musl"] } +musl-tools = { version = '*', targets = ["aarch64-unknown-linux-musl", "x86_64-unknown-linux-musl", "armv7-unknown-linux-musleabihf"] } +musl-dev = { version = '*', targets = ["aarch64-unknown-linux-musl", "x86_64-unknown-linux-musl", "armv7-unknown-linux-musleabihf"] }