Add arm64 Docker build container for native cross-compilation
Uses ubuntu:22.04 arm64 image running under QEMU emulation to produce aarch64 binaries that match the target device exactly (same glibc, same distro). Replaces the broken Buildroot cross-compilation approach. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
7597f17f9e
commit
a1bafece22
0
docker-arm64/.build
Normal file
0
docker-arm64/.build
Normal file
8
docker-arm64/Dockerfile
Normal file
8
docker-arm64/Dockerfile
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
FROM ubuntu:22.04
|
||||||
|
ENV DEBIAN_FRONTEND=noninteractive
|
||||||
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
|
build-essential pkg-config \
|
||||||
|
libsdl2-dev libsdl2-image-dev \
|
||||||
|
libavformat-dev libavcodec-dev libavutil-dev libswresample-dev \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
WORKDIR /workspace
|
||||||
25
docker-arm64/Makefile
Normal file
25
docker-arm64/Makefile
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
.PHONY: shell build clean
|
||||||
|
|
||||||
|
IMAGE_NAME = arm64-dev
|
||||||
|
PROJECT_DIR := $(shell cd .. && pwd)
|
||||||
|
|
||||||
|
CONTAINER_NAME = $(shell docker ps -f "ancestor=$(IMAGE_NAME)" --format "{{.Names}}")
|
||||||
|
|
||||||
|
.build: Dockerfile
|
||||||
|
docker build --platform linux/arm64 -t $(IMAGE_NAME) .
|
||||||
|
touch .build
|
||||||
|
|
||||||
|
ifeq ($(CONTAINER_NAME),)
|
||||||
|
shell: .build
|
||||||
|
docker run --platform linux/arm64 -it --rm -v "$(PROJECT_DIR)":/workspace $(IMAGE_NAME) /bin/bash
|
||||||
|
else
|
||||||
|
shell:
|
||||||
|
docker exec -it $(CONTAINER_NAME) /bin/bash
|
||||||
|
endif
|
||||||
|
|
||||||
|
build: .build
|
||||||
|
docker run --platform linux/arm64 --rm -v "$(PROJECT_DIR)":/workspace $(IMAGE_NAME) make
|
||||||
|
|
||||||
|
clean:
|
||||||
|
docker rmi $(IMAGE_NAME)
|
||||||
|
rm -f .build
|
||||||
Loading…
x
Reference in New Issue
Block a user