From a1ebff0d0243357c5efe0d6bfd12884ab4961331 Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Thu, 18 Jul 2024 10:26:50 +0200 Subject: [PATCH] Add CI job for avr-unknown-gnu-atmega328 --- .github/workflows/ci.yml | 48 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0752a2223..00854a930 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,3 +47,51 @@ jobs: - name: Build Documentation run: cargo doc --no-deps + + build-avr: + runs-on: ubuntu-latest + + steps: + - name: Install build dependencies + shell: bash + run: | + env && pwd && sudo apt-get update -y -qq && sudo apt-get install -y -qq llvm gcc-avr avr-libc libclang-dev + + - name: Install rust + run: rustup toolchain install --profile minimal --component=rust-src nightly + + - name: Configure target + run: | + cat < avr-atmega328p.json + { + "arch": "avr", + "atomic-cas": false, + "cpu": "atmega328p", + "data-layout": "e-P1-p:16:8-i8:8-i16:8-i32:8-i64:8-f32:8-f64:8-n8-a:8", + "eh-frame-header": false, + "exe-suffix": ".elf", + "late-link-args": { + "gcc": [ + "-lgcc" + ] + }, + "linker": "avr-gcc", + "llvm-target": "avr-unknown-unknown", + "max-atomic-width": 8, + "no-default-libraries": false, + "pre-link-args": { + "gcc": [ + "-mmcu=atmega328p" + ] + }, + "relocation-model": "static", + "target-c-int-width": "16", + "target-pointer-width": "16" + } + EOT + + - name: Patch delog + run: echo 'delog = { version = "0.1.6", git = "https://github.com/LechevSpace/delog.git", rev = "e83f3fd" }' >> Cargo.toml + + - name: Build avr + run: cargo +nightly build -Z build-std=core --target=./avr-atmega328p.json --release