From e8fa7e1f2897c48029d5f8b729c06dfa8017b436 Mon Sep 17 00:00:00 2001 From: Sebastiaan de Schaetzen Date: Mon, 23 Feb 2026 08:13:18 +0100 Subject: [PATCH] Update devcontainer (AI+human) --- .devcontainer/Dockerfile | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 4eee051..678fe0b 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -7,37 +7,35 @@ # - CMake + Ninja for the build system # - xorriso and mtools used internally by grub-mkrescue / grub-mkimage -FROM debian:bookworm-slim +FROM alpine:3.23 -ENV DEBIAN_FRONTEND=noninteractive - -RUN apt-get update && apt-get install -y --no-install-recommends \ +RUN apk add --no-cache \ # Core build tools clang \ lld \ cmake \ - ninja-build \ + ninja \ make \ git \ # GRUB image generation - grub-pc-bin \ - grub-common \ + grub \ xorriso \ mtools \ # QEMU for running the OS - qemu-system-x86 \ + qemu-system-i386 \ # Handy utilities file \ - ca-certificates \ - && rm -rf /var/lib/apt/lists/* + ca-certificates # Verify the cross-compilation toolchain can produce an i386-elf binary. +# Compile and link separately so ld.lld is invoked directly, avoiding the +# host gcc linker driver (which rejects -m32 on non-x86 hosts such as aarch64). RUN echo 'void _start(void){for(;;)__asm__("hlt");}' > /tmp/test.c \ - && clang -target i386-elf -m32 -march=i386 -ffreestanding -fno-stack-protector \ - -nostdlib -fuse-ld=lld -Wl,-e,_start \ - /tmp/test.c -o /tmp/test.elf \ - && file /tmp/test.elf | grep -q "ELF 32-bit.*80386" \ + && clang -v -target i386-elf -march=i386 -ffreestanding -fno-stack-protector \ + -c /tmp/test.c -o /tmp/test.o \ + && ld.lld -m elf_i386 -e _start --nostdlib /tmp/test.o -o /tmp/test.elf \ + && file /tmp/test.elf | grep -q "ELF 32-bit.*386" \ && echo "Toolchain OK" \ - && rm /tmp/test.c /tmp/test.elf + && rm /tmp/test.c /tmp/test.o /tmp/test.elf WORKDIR /workspaces/claude-os