From 48fdab752f29ba2f398bfadaabea1d6402f15dbb Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Tue, 7 Apr 2026 18:56:37 -0700 Subject: [PATCH 1/3] cproc: Re-add qbe to output While cproc no longer uses its own qbe branch, it still needs qbe to run. 0b11d3d fixed the build, but dropped qbe so it stopped working (compiler-explorer#7241). Also add qbe revision to ce-build-revision, similar to what is done with gcc and binutils. --- misc/build-cproc.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/misc/build-cproc.sh b/misc/build-cproc.sh index fb5e597..6fecbb3 100755 --- a/misc/build-cproc.sh +++ b/misc/build-cproc.sh @@ -17,6 +17,8 @@ fi URL="https://git.sr.ht/~mcf/cproc" BRANCH="master" +QBE_URL="git://c9x.me/qbe.git" +QBE_BRANCH="master" BASENAME=cproc-${VERSION}-$(date +%Y%m%d) FULLNAME=${BASENAME}.tar.xz @@ -33,7 +35,8 @@ else fi REVISION=$(git ls-remote --heads "${URL}" "refs/heads/${BRANCH}" | cut -f 1) -echo "ce-build-revision:${REVISION}" +QBE_REVISION=$(git ls-remote --heads "${QBE_URL}" "refs/heads/${QBE_BRANCH}" | cut -f 1) +echo "ce-build-revision:${REVISION}_qbe-${QBE_REVISION}" echo "ce-build-output:${OUTPUT}" if [[ "${REVISION}" == "${LAST_REVISION}" ]]; then @@ -69,6 +72,11 @@ git am ../../cproc-version.patch make -j"$(nproc)" make install DESTDIR="$PWD/root" BINDIR=/bin +git clone --depth 1 "${QBE_URL}" --branch "${QBE_BRANCH}" +pushd qbe +make install DESTDIR="$PWD/../root" BINDIR=/bin +popd + pushd root export XZ_DEFAULTS="-T 0" From bb007f88601fa913b72456b3e1aa4407669502b8 Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Tue, 7 Apr 2026 19:05:50 -0700 Subject: [PATCH 2/3] cproc: Remove patch adding --version --- misc/build-cproc.sh | 10 ------ misc/cproc-version.patch | 72 ---------------------------------------- 2 files changed, 82 deletions(-) delete mode 100644 misc/cproc-version.patch diff --git a/misc/build-cproc.sh b/misc/build-cproc.sh index 6fecbb3..dc20740 100755 --- a/misc/build-cproc.sh +++ b/misc/build-cproc.sh @@ -57,16 +57,6 @@ pushd build-cproc git clone --depth 1 "${URL}" --branch "${BRANCH}" pushd cproc -## Temporary (hopefully) patch to support basic --version -## -## The following 2 lines are needed on virgin system where nothing is -## configured. git really needs something here, or it will fail. Even using -## --author is not enough. -git config user.email || git config user.email "none@example.com" -git config user.name || git config user.name "None" - -git am ../../cproc-version.patch - ./configure make -j"$(nproc)" diff --git a/misc/cproc-version.patch b/misc/cproc-version.patch deleted file mode 100644 index a2d5efc..0000000 --- a/misc/cproc-version.patch +++ /dev/null @@ -1,72 +0,0 @@ -From 096c248718795c4b52df47dc16941615e6806a5c Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Marc=20Poulhi=C3=A8s?= -Date: Tue, 19 Oct 2021 22:04:34 +0200 -Subject: [PATCH] Supports for getting version with --version -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Very basic support for getting version with --version. Currently configure gets -the current SHA1 from the git repository and use this as version. - -Signed-off-by: Marc Poulhiès ---- - configure | 6 ++++++ - driver.c | 10 ++++++++++ - 2 files changed, 16 insertions(+) - -diff --git a/configure b/configure -index be7a95b..615b23e 100755 ---- a/configure -+++ b/configure -@@ -164,6 +164,12 @@ static const char *const linkcmd[] = {"$DEFAULT_LINKER", $linkflags}; - EOF - echo done - -+VERSION_STRING=$(git rev-parse HEAD) -+printf "creating version.h..." -+cat >version.h <config.mk < - - #include "util.h" -+#include "version.h" - - enum filetype { - NONE, /* detect based on file extension */ -@@ -64,6 +65,13 @@ static struct stageinfo stages[] = { - [LINK] = {.name = "link"}, - }; - -+static void -+version(void) -+{ -+ fprintf(stderr, "version: " VERSION_STRING "\n"); -+ exit(2); -+} -+ - static void - usage(const char *fmt, ...) - { -@@ -448,6 +456,8 @@ main(int argc, char *argv[]) - } else if (strcmp(arg, "-pthread") == 0) { - arrayaddptr(&stages[LINK].cmd, "-l"); - arrayaddptr(&stages[LINK].cmd, "pthread"); -+ } else if (strcmp(arg, "--version") == 0) { -+ version(); - } else { - if (arg[2] != '\0' && strchr("cESsv", arg[1])) - usage(NULL); --- -2.33.0 - From 23cc1691de907ba9d9c4cbc970444d7776e1775b Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Tue, 7 Apr 2026 19:19:33 -0700 Subject: [PATCH 3/3] cproc: Tidy up build using common.sh --- misc/build-cproc.sh | 64 +++++++++------------------------------------ 1 file changed, 13 insertions(+), 51 deletions(-) diff --git a/misc/build-cproc.sh b/misc/build-cproc.sh index dc20740..3eb56b3 100755 --- a/misc/build-cproc.sh +++ b/misc/build-cproc.sh @@ -1,12 +1,12 @@ #!/bin/bash ## $1 : version, currently cproc does not have any and only uses master branch. -## $2 : destination: a directory or S3 path (eg. s3://...) +## $2 : destination: a directory ## $3 : last revision successfully build (optional) set -ex +source common.sh -ROOT=$PWD VERSION="${1}" LAST_REVISION="${3-}" @@ -20,62 +20,24 @@ BRANCH="master" QBE_URL="git://c9x.me/qbe.git" QBE_BRANCH="master" -BASENAME=cproc-${VERSION}-$(date +%Y%m%d) -FULLNAME=${BASENAME}.tar.xz -OUTPUT=${ROOT}/${FULLNAME} -S3OUTPUT= -if [[ $2 =~ ^s3:// ]]; then - S3OUTPUT=$2 -else - if [[ -d "${2}" ]]; then - OUTPUT=$2/${FULLNAME} - else - OUTPUT=${2-$OUTPUT} - fi -fi - -REVISION=$(git ls-remote --heads "${URL}" "refs/heads/${BRANCH}" | cut -f 1) -QBE_REVISION=$(git ls-remote --heads "${QBE_URL}" "refs/heads/${QBE_BRANCH}" | cut -f 1) -echo "ce-build-revision:${REVISION}_qbe-${QBE_REVISION}" -echo "ce-build-output:${OUTPUT}" - -if [[ "${REVISION}" == "${LAST_REVISION}" ]]; then - echo "ce-build-status:SKIPPED" - exit -fi +CPROC_REVISION=$(get_remote_revision "${URL}" "heads/${BRANCH}") +QBE_REVISION=$(get_remote_revision "${QBE_URL}" "heads/${QBE_BRANCH}") +REVISION="${CPROC_REVISION}_qbe-${QBE_REVISION}" -## From now, no unset variable -set -u +FULLNAME=cproc-${VERSION}-$(date +%Y%m%d) +OUTPUT=$(realpath "$2/${FULLNAME}.tar.xz") -OUTPUT=$(realpath "${OUTPUT}") +initialise "${REVISION}" "${OUTPUT}" "${LAST_REVISION}" -rm -rf build-cproc -mkdir -p build-cproc - -pushd build-cproc +DESTDIR="${PWD}/stage" git clone --depth 1 "${URL}" --branch "${BRANCH}" pushd cproc - ./configure - -make -j"$(nproc)" -make install DESTDIR="$PWD/root" BINDIR=/bin - -git clone --depth 1 "${QBE_URL}" --branch "${QBE_BRANCH}" -pushd qbe -make install DESTDIR="$PWD/../root" BINDIR=/bin +make -j"$(nproc)" install DESTDIR="${DESTDIR}" BINDIR=/bin popd -pushd root - -export XZ_DEFAULTS="-T 0" -tar Jcf "${OUTPUT}" --transform "s,^./,./${BASENAME}/," ./ - -if [[ -n "${S3OUTPUT}" ]]; then - aws s3 cp --storage-class REDUCED_REDUNDANCY "${OUTPUT}" "${S3OUTPUT}" -fi +git clone --depth 1 "${QBE_URL}" --branch "${QBE_BRANCH}" +make -C qbe -j"$(nproc)" install DESTDIR="${DESTDIR}" BINDIR=/bin -popd -popd -echo "ce-build-status:OK" +complete "${DESTDIR}" "${FULLNAME}" "${OUTPUT}"