elf_loader 0.14.0

A high-performance, no_std compliant ELF loader and JIT linker for Rust.
Documentation
name: Rust

on:
  push:
    branches: [ "main" ]
  pull_request:
    branches: [ "main" ]

env:
  CARGO_TERM_COLOR: always

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v4
    - uses: dtolnay/rust-toolchain@master
      with:
        toolchain: ${{ matrix.channel }}
    - env:
        TARGET: ${{ matrix.target }}
        CHANNEL: ${{ matrix.channel }}
        FEATURES: ${{ matrix.features }}
        OP: build
      run: sh ci/run.sh
    strategy:
      matrix:
        target: [ x86_64-unknown-linux-gnu, aarch64-unknown-linux-gnu, riscv64gc-unknown-linux-gnu, loongarch64-unknown-linux-gnu]
        channel: [ stable ]
        features: [ "use-syscall" ]
        include:
          - target: x86_64-unknown-linux-gnu
            channel: 1.93.0
            features: "use-syscall"
          - target: x86_64-unknown-linux-gnu
            channel: stable
            features: "version"
          - target: x86_64-unknown-linux-gnu
            channel: stable
            features: "log"

  test-linking:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v4
    - uses: dtolnay/rust-toolchain@master
      with:
        toolchain: ${{ matrix.channel }}
    - env:
        TARGET: ${{ matrix.target }}
        CHANNEL: ${{ matrix.channel }}
        FEATURES: ${{ matrix.features }}
        OP: test
      run: sh ci/run.sh
    strategy:
      matrix:
        target: [ x86_64-unknown-linux-gnu, aarch64-unknown-linux-gnu, riscv64gc-unknown-linux-gnu, loongarch64-unknown-linux-gnu, i586-unknown-linux-gnu, arm-unknown-linux-gnueabihf]
        channel: [ stable ]
        features: [ "use-syscall" ]
        include:
          - target: x86_64-unknown-linux-gnu
            channel: 1.93.0
            features: "use-syscall"

  test-mini-loader:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v4
    - uses: dtolnay/rust-toolchain@master
      with:
        toolchain: ${{ matrix.channel }}
    - name: Set up QEMU and binfmt_misc
      uses: docker/setup-qemu-action@v3
      with:
        platforms: all
    - env:
        TARGET: ${{ matrix.target }}
        CHANNEL: ${{ matrix.channel }}
        ARGS: "target/exec_a"
        OP: run -r -p mini-loader -Zbuild-std=core,alloc,panic_abort
        MINI_LOADER: 1
      run: |
        rustup component add rust-src
        sh ci/run.sh
    strategy:
      matrix:
        target: [ x86_64-unknown-none]
        channel: [ nightly ]

  test-windows-loader:
    runs-on: windows-latest
    steps:
    - uses: actions/checkout@v4
    - uses: dtolnay/rust-toolchain@master
      with:
        toolchain: stable
    - name: Run example
      run: cargo run -p windows-elf-loader --example from_memory

  bench:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v4
    - uses: dtolnay/rust-toolchain@master
      with:
        toolchain: ${{ matrix.channel }}
    - env:
        TARGET: ${{ matrix.target }}
        CHANNEL: ${{ matrix.channel }}
        FEATURES: ${{ matrix.features }}
        OP: bench
      run: sh ci/run.sh
    strategy:
      matrix:
        target: [ x86_64-unknown-linux-gnu ]
        channel: [ stable ]
        features: [ "use-syscall" ]

  build-no-std:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v4
    - uses: dtolnay/rust-toolchain@master
      with:
        toolchain: nightly
    - env:
        TARGET: x86_64-unknown-none
        CHANNEL: nightly
        OP: build
      run: sh ci/run.sh