Skip to content

[AARCH64] fix redeclaration #11

[AARCH64] fix redeclaration

[AARCH64] fix redeclaration #11

name: Compile and Run nostdlib examples
on: [push, pull_request]
jobs:
windows:
strategy:
matrix:
cc: [gcc]
os: [windows-latest, windows-2025, windows-2022, windows-11-arm]
example: [win32_hello_world, win32_hello_cli]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Compile ${{ matrix.example }}
run: ${{ matrix.cc }} -s -O2 -mconsole -march=native -mtune=native -std=c89 -pedantic -nodefaultlibs -nostdlib -mno-stack-arg-probe -Xlinker /STACK:0x100000,0x100000 -Xlinker /ENTRY:nostdlib_main -fno-builtin -ffreestanding -fno-asynchronous-unwind-tables -fuse-ld=lld -Wall -Wextra -Werror -Wvla -Wconversion -Wdouble-promotion -Wmissing-field-initializers -Wuninitialized -Winit-self -Wunused -Wunused-macros -Wunused-local-typedefs ${{ matrix.example }}.c -o ${{ matrix.example }}_${{ matrix.cc }}.exe -lkernel32
- name: Run ${{ matrix.example }}
run: .\${{ matrix.example }}_${{ matrix.cc }}.exe
- name: Upload ${{ matrix.example }} Artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}-${{ matrix.cc }}-${{ matrix.example }}
path: ${{ matrix.example }}_${{ matrix.cc }}.exe
ubuntu:
strategy:
matrix:
cc: [gcc, clang]
os: [ubuntu-latest, ubuntu-24.04, ubuntu-22.04, ubuntu-24.04-arm, ubuntu-22.04-arm]
example: [linux_hello_world, linux_hello_cli]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Install Dependencies
run: sudo apt update && sudo apt install -y ${{ matrix.cc }} lld
- name: Compile ${{ matrix.example }}
run: |
if [[ "${{ matrix.os }}" == *"arm"* ]]; then
${{ matrix.cc }} -O2 -std=c89 -pedantic -nodefaultlibs -nostdlib \
-fno-builtin -ffreestanding -fno-asynchronous-unwind-tables -fuse-ld=lld \
-Wall -Wextra -Werror -Wvla -Wconversion -Wdouble-promotion \
-Wmissing-field-initializers -Wuninitialized -Winit-self -Wunused \
-Wunused-macros -Wunused-local-typedefs \
-Wl,-e,nostdlib_main ${{ matrix.example }}.c -o ${{ matrix.example }}_${{ matrix.cc }} -static -s
else
${{ matrix.cc }} -O2 -march=native -mtune=native -std=c89 -pedantic -nodefaultlibs -nostdlib \
-fno-builtin -ffreestanding -fno-asynchronous-unwind-tables -fuse-ld=lld \
-Wall -Wextra -Werror -Wvla -Wconversion -Wdouble-promotion \
-Wmissing-field-initializers -Wuninitialized -Winit-self -Wunused \
-Wunused-macros -Wunused-local-typedefs \
-Wl,-e,nostdlib_main ${{ matrix.example }}.c -o ${{ matrix.example }}_${{ matrix.cc }} -static -s
fi
- name: Run ${{ matrix.example }}
run: ./${{ matrix.example }}_${{ matrix.cc }}
- name: Upload ${{ matrix.example }} Artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}-${{ matrix.cc }}-${{ matrix.example }}
path: ${{ matrix.example }}_${{ matrix.cc }}