To reproduce:
-
Use an ARM64 computer (tested on M1 mac and on Raspberry Pi model 4B)
- On Raspberry pi, I used Raspbian:bookworm
- On M1 mac, I used
docker run --rm -ti -v $(pwd):/demo -w /demo debian:bookworm /bin/bash
(which shares the local directory into the container, assumes you are running this from the cloned gist)
-
On your computer of choice, run
apt update && apt install -y build-essential clang-13 clang
-
Observe gcc produces correct results:
gcc ./min-repro-sample.c && ./a.out