Skip to content

Commit 73f3379

Browse files
mattgodboltclaude
andauthored
Add Norcroft C/C++ (ncc-ng) compiler build (#121)
Add build support for the Norcroft C/C++ compiler from https://github.com/Norcroft/ncc-ng Builds ncc (ARM C) and n++ (ARM C++) compilers. Thumb compilers (ntcc, nt++) are disabled pending an upstream fix for missing TOOLVER_TCC definition. Related: compiler-explorer/compiler-explorer#8297 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 18baaad commit 73f3379

File tree

3 files changed

+52
-0
lines changed

3 files changed

+52
-0
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ jobs:
1717
- lc3
1818
- misc
1919
- nasm
20+
- ncc-ng
2021
- python
2122
- pythran
2223
- rocm

Dockerfile.ncc-ng

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
FROM ubuntu:22.04
2+
3+
ARG DEBIAN_FRONTEND=noninteractive
4+
RUN apt update -y -q && apt upgrade -y -q && \
5+
apt install -y -q \
6+
build-essential \
7+
git \
8+
xz-utils
9+
10+
RUN mkdir -p /root
11+
COPY ncc-ng /root/
12+
COPY common.sh /root/
13+
14+
WORKDIR /root

ncc-ng/build.sh

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/bin/bash
2+
3+
set -ex
4+
source common.sh
5+
6+
VERSION=$1
7+
if [[ "${VERSION}" = "trunk" ]]; then
8+
VERSION=trunk-$(date +%Y%m%d)
9+
BRANCH=main
10+
else
11+
BRANCH=${VERSION}
12+
fi
13+
14+
URL=https://github.com/Norcroft/ncc-ng
15+
16+
FULLNAME=ncc-ng-${VERSION}
17+
OUTPUT=$2/${FULLNAME}.tar.xz
18+
19+
REVISION="ncc-ng-$(get_remote_revision "${URL}" "heads/${BRANCH}")"
20+
LAST_REVISION="${3:-}"
21+
22+
initialise "${REVISION}" "${OUTPUT}" "${LAST_REVISION}"
23+
24+
PREFIX=$(pwd)/prefix
25+
DIR=$(pwd)/ncc-ng
26+
27+
git clone --depth 1 -b "${BRANCH}" "${URL}" "${DIR}"
28+
29+
cd "${DIR}"
30+
make all # builds ncc and n++ (ARM backend)
31+
# TODO: Thumb compilers (ntcc, nt++) fail to build due to missing TOOLVER_TCC in toolver.h
32+
# Uncomment when upstream fixes: make ntcc nt++
33+
34+
mkdir -p "${PREFIX}/bin"
35+
cp bin/* "${PREFIX}/bin/"
36+
37+
complete "${PREFIX}" "${FULLNAME}" "${OUTPUT}"

0 commit comments

Comments
 (0)