summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@ost.ch>2026-05-07 10:10:59 +0200
committerFelix Morgner <felix.morgner@ost.ch>2026-05-07 10:10:59 +0200
commitc9ba42a4ed3e98bc7936e07e1653103bac611861 (patch)
tree16695ffec1ead81b226f411ac6ad22936d28aa43
parent3fff4803a38c9e3ae22844319d6392e96ee7042e (diff)
downloadtoolchains-c9ba42a4ed3e98bc7936e07e1653103bac611861.tar.xz
toolchains-c9ba42a4ed3e98bc7936e07e1653103bac611861.zip
gdb: enable python scripting
-rw-r--r--Containerfile13
-rw-r--r--Containerfile.ci-bht4
-rw-r--r--Containerfile.ci-x86_642
-rw-r--r--Makefile9
-rwxr-xr-xscripts/0000-prepare-os.sh2
-rwxr-xr-xscripts/0600-build-target-gdb.sh20
6 files changed, 28 insertions, 22 deletions
diff --git a/Containerfile b/Containerfile
index 7a12114..dd4bc06 100644
--- a/Containerfile
+++ b/Containerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:questing AS builder
+FROM ubuntu:resolute AS builder
ARG IMAGE_BUILD
@@ -16,6 +16,8 @@ ARG GMP_VERSION
ARG MPFR_VERSION
ARG MPC_VERSION
+ARG PYTHON_VERSION
+
ENV STATIC_DEPS_PREFIX=/opt/static-deps
ADD ./patches /patches
@@ -30,7 +32,7 @@ RUN /scripts/0400-build-target-newlib.sh
RUN /scripts/0500-build-target-gcc.sh
RUN /scripts/0600-build-target-gdb.sh
-FROM ubuntu:questing
+FROM ubuntu:resolute
LABEL org.opencontainers.image.title="TeachOS Toolchain"
LABEL org.opencontainers.image.description="A semi-statically linked cross-compiler toolchain for TeachOS development."
@@ -39,12 +41,11 @@ LABEL org.opencontainers.image.version="$GCC_VERSION"
LABEL org.opencontainers.iamge.revision="$IMAGE_BUILD"
LABEL org.opencontainers.image.base.name="docker.io/ubuntu:questing"
+ARG PYTHON_VERSION
+
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
- gnupg libstdc++6 software-properties-common wget && \
- wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | gpg --dearmor -o /usr/share/keyrings/llvm-archive-keyring.gpg && \
- echo "deb [signed-by=/usr/share/keyrings/llvm-archive-keyring.gpg] http://apt.llvm.org/questing/ llvm-toolchain-questing main" > /etc/apt/sources.list.d/llvm.list && \
- DEBIAN_FRONTEND=noninteractive apt-get autoremove -y --purge gnupg software-properties-common wget && \
+ libstdc++6 python$PYTHON_VERSION-dev && \
rm -rf /var/lib/apt/lists/*
COPY --from=builder /opt/toolchain /opt/toolchain
diff --git a/Containerfile.ci-bht b/Containerfile.ci-bht
index b96e401..304125b 100644
--- a/Containerfile.ci-bht
+++ b/Containerfile.ci-bht
@@ -1,5 +1,5 @@
-FROM docker.io/library/ubuntu:questing
+FROM docker.io/library/ubuntu:resolute
RUN apt update && \
- apt install -y --no-install-recommends build-essential cmake gcovr ninja-build lcov libcatch2-dev && \
+ apt install -y --no-install-recommends acpica-tools build-essential cmake doxygen gcovr ninja-build lcov libcatch2-dev && \
rm -rf /var/lib/apt/lists/*
diff --git a/Containerfile.ci-x86_64 b/Containerfile.ci-x86_64
index 1fde8ea..7ec5962 100644
--- a/Containerfile.ci-x86_64
+++ b/Containerfile.ci-x86_64
@@ -1,5 +1,5 @@
FROM registry.gitlab.ost.ch:45023/teachos/devcontainers/x86-64:latest
RUN apt update && \
- apt install -y --no-install-recommends clang-tidy cmake grub2-common grub-pc mtools ninja-build xorriso && \
+ apt install -y --no-install-recommends clang-tidy-22 cmake grub2-common grub-pc mtools ninja-build xorriso && \
rm -rf /var/lib/apt/lists/*
diff --git a/Makefile b/Makefile
index 7bfcec5..103b11b 100644
--- a/Makefile
+++ b/Makefile
@@ -15,17 +15,19 @@ GMP_VERSION ?= 6.3.0
MPFR_VERSION ?= 4.2.2
MPC_VERSION ?= 1.4.1
+PYTHON_VERSION ?= 3.14
+
TARGET ?= x86_64-pc-elf
PLATFORM ?= x86-64
REGISTRY ?= registry.gitlab.ost.ch:45023
-IMAGE_BUILD ?= 1
+IMAGE_BUILD ?= 2
IMAGE_BASENAME = teachos/devcontainers
IMAGE_NAME = $(REGISTRY)/$(IMAGE_BASENAME)
-IMAGE_TAG = $(PLATFORM):$(GCC_VERSION)-$(IMAGE_BUILD)
-ARCHIVE_NAME = teachos-$(PLATFORM)-$(GCC_VERSION)-$(IMAGE_BUILD).tar
+IMAGE_TAG = $(PLATFORM):$(GCC_VERSION)-$(IMAGE_BUILD)-py$(PYTHON_VERSION)
+ARCHIVE_NAME = teachos-$(PLATFORM)-$(GCC_VERSION)-$(IMAGE_BUILD)-py$(PYTHON_VERSION).tar
.PHONY: all clean container_image
@@ -58,6 +60,7 @@ container_image: Containerfile
--build-arg GMP_VERSION=$(GMP_VERSION) \
--build-arg MPFR_VERSION=$(MPFR_VERSION) \
--build-arg MPC_VERSION=$(MPC_VERSION) \
+ --build-arg PYTHON_VERSION=$(PYTHON_VERSION) \
--tag $(IMAGE_NAME)/$(IMAGE_TAG) \
.
podman tag $(IMAGE_NAME)/$(IMAGE_TAG) $(IMAGE_NAME)/$(PLATFORM):latest
diff --git a/scripts/0000-prepare-os.sh b/scripts/0000-prepare-os.sh
index a2039ad..4af069e 100755
--- a/scripts/0000-prepare-os.sh
+++ b/scripts/0000-prepare-os.sh
@@ -15,6 +15,8 @@ apt-get install -y --no-install-recommends \
gawk \
libtool \
patch \
+ python${PYTHON_VERSION} \
+ python${PYTHON_VERSION}-dev \
texinfo \
wget \
xz-utils
diff --git a/scripts/0600-build-target-gdb.sh b/scripts/0600-build-target-gdb.sh
index 8e984d8..8bd5a68 100755
--- a/scripts/0600-build-target-gdb.sh
+++ b/scripts/0600-build-target-gdb.sh
@@ -10,16 +10,16 @@ tar xf /downloads/gdb-$GDB_VERSION.tar.xz
cd .build
-../gdb-$GDB_VERSION/configure \
- --prefix=/opt/toolchain \
- --target=$TARGET \
- --disable-nls \
- --disable-werror \
- --with-gmp=$STATIC_DEPS_PREFIX \
- --with-mpfr=$STATIC_DEPS_PREFIX \
- --with-python=no \
- --with-expat=yes \
- --with-zlib=yes \
+../gdb-$GDB_VERSION/configure \
+ --prefix=/opt/toolchain \
+ --target=$TARGET \
+ --disable-nls \
+ --disable-werror \
+ --with-gmp=$STATIC_DEPS_PREFIX \
+ --with-mpfr=$STATIC_DEPS_PREFIX \
+ --with-python=/usr/bin/python${PYTHON_VERSION} \
+ --with-expat=yes \
+ --with-zlib=yes \
CPPFLAGS="-I$STATIC_DEPS_PREFIX/include -I$STATIC_DEPS_PREFIX/include/ncursesw" \
LDFLAGS="-L$STATIC_DEPS_PREFIX/lib"