Sign inSign up

pascalecu/clang-objc2-gnustep

By pascalecu

•Updated 6 months ago

Objective-C 2.0 development environment using Clang + GNUstep + libobjc2

Image
0

547

pascalecu/clang-objc2-gnustep repository overview

⁠Objective-C 2.0 Development Environment (Clang + libobjc2 + GNUstep)

This repository provides a Docker image for a modern Objective-C 2.0 toolchain based on:

  • Clang (LLVM toolchain)
  • GNUstep
  • libobjc2 (modern Objective-C runtime)
  • libdispatch (Swift corelibs GCD implementation)

It replaces legacy GCC-based Objective-C environments with a Clang-based toolchain using a modern Objective-C runtime (libobjc2).

⁠Features

This environment supports modern Objective-C features through Clang + libobjc2:

  • Automatic Reference Counting (ARC)
  • Blocks (closures)
  • Grand Central Dispatch (libdispatch)
  • Object literals
  • Subscripting
  • Properties and dot syntax
  • Objective-C 2.0 runtime features

These features require the combination of:

  • Clang compiler
  • libobjc2 runtime
  • GNUstep base libraries

⁠Why this image exists

Many Objective-C environments are:

  • GCC-based with outdated runtime support
  • Bundled with full GUI stacks when only CLI tools are needed
  • Not aligned with modern Clang + libobjc2 development

This image focuses on a minimal, modern toolchain:

  • Clang + libobjc2 runtime model
  • Swift corelibs libdispatch (modern GCD)
  • GNUstep base for Foundation-compatible APIs

⁠Usage

⁠Pull image

docker pull pascalecu/clang-objc2-gnustep:clang22-ubuntu26.04

⁠Build locally

git clone https://github.com/pascalecu/clang-objc2-gnustep
cd clang-objc2-gnustep
docker build -t clang-objc2-gnustep .

⁠Run container

$ docker run --rm -it -v $(pwd):/workdir pascalecu/clang-objc2-gnustep:clang22-ubuntu26.04 bash

⁠Compile a program

Inside the container:

objc -o foobar foobar.m
./foobar

For convenience, the image includes an objc wrapper script that configures the compiler and runtime environment.

#!/usr/bin/env bash
set -euo pipefail

export GNUSTEP_MAKEFILES=/opt/gnustep/share/GNUstep/Makefiles
source /opt/gnustep/share/GNUstep/Makefiles/GNUstep.sh

exec clang-X \
  -fobjc-runtime=gnustep-2.0 \
  -fobjc-arc \
  -fblocks \
  -fobjc-exceptions \
  -O2 \
  -I/opt/gnustep/include \
  -L/opt/gnustep/lib \
  -Wl,-rpath,/opt/gnustep/lib \
  "$@" \
  -lgnustep-base -lobjc -ldispatch -lpthread -ldl -lm

where clang-X depends on the tag.

This image is intended for CLI and systems programming use. As such, no GUI frameworks are included.

⁠Acknowledgments

Tag summary

Content type

Image

Digest

sha256:63257fdec…

Size

191.3 MB

Last updated

6 months ago

docker pull pascalecu/clang-objc2-gnustep:clang22-ubuntu26.04