creduce: fix build with gcc15; migrate to by-name (#518263)

This commit is contained in:
Peder Bergebakken Sundt
2026-05-10 13:09:46 +00:00
committed by GitHub
3 changed files with 65 additions and 9 deletions
+53
View File
@@ -0,0 +1,53 @@
From 1c715fef9113d5a5291694eab739d4a743ab08d5 Mon Sep 17 00:00:00 2001
From: Bradley Walters <oss@walters.app>
Date: Fri, 2 Jan 2026 22:02:30 -0800
Subject: [PATCH] unifdef: constexpr is reserved in C23
---
unifdef/unifdef.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/unifdef/unifdef.c b/unifdef/unifdef.c
index 5c67cd44..692a1640 100644
--- a/unifdef/unifdef.c
+++ b/unifdef/unifdef.c
@@ -201,7 +201,7 @@ static int depth; /* current #if nesting */
static int delcount; /* count of deleted lines */
static unsigned blankcount; /* count of blank lines */
static unsigned blankmax; /* maximum recent blankcount */
-static bool constexpr; /* constant #if expression */
+static bool isconstexpr; /* constant #if expression */
static bool zerosyms; /* to format symdepth output */
static bool firstsym; /* ditto */
@@ -1078,7 +1078,7 @@ eval_unary(const struct ops *ops, long *valp, const char **cpp)
*valp = (value[sym] != NULL);
lt = *valp ? LT_TRUE : LT_FALSE;
}
- constexpr = false;
+ isconstexpr = false;
} else if (!endsym(*cp)) {
debug("eval%d symbol", prec(ops));
sym = findsym(&cp);
@@ -1095,7 +1095,7 @@ eval_unary(const struct ops *ops, long *valp, const char **cpp)
lt = *valp ? LT_TRUE : LT_FALSE;
cp = skipargs(cp);
}
- constexpr = false;
+ isconstexpr = false;
} else {
debug("eval%d bad expr", prec(ops));
return (LT_ERROR);
@@ -1162,10 +1162,10 @@ ifeval(const char **cpp)
long val = 0;
debug("eval %s", *cpp);
- constexpr = killconsts ? false : true;
+ isconstexpr = killconsts ? false : true;
ret = eval_table(eval_ops, &val, cpp);
debug("eval = %d", val);
- return (constexpr ? LT_IF : ret == LT_ERROR ? LT_IF : ret);
+ return (isconstexpr ? LT_IF : ret == LT_ERROR ? LT_IF : ret);
}
/*
@@ -4,13 +4,15 @@
fetchFromGitHub,
cmake,
makeWrapper,
llvm,
libclang,
llvmPackages_18,
flex,
zlib,
perlPackages,
util-linux,
}:
let
llvmPackages = llvmPackages_18;
in
stdenv.mkDerivation {
pname = "creduce";
@@ -23,6 +25,11 @@ stdenv.mkDerivation {
hash = "sha256-RbxFqZegsCxnUaIIA5OfTzx1wflCPeF+enQt90VwMgA=";
};
patches = [
# https://github.com/csmith-project/creduce/pull/290
./fix-gcc15.patch
];
postPatch = ''
substituteInPlace {clex,clang_delta,delta,unifdef,creduce,.}/CMakeLists.txt --replace-fail \
"cmake_minimum_required(VERSION 2.8.12)" "cmake_minimum_required(VERSION 3.10)"
@@ -39,14 +46,14 @@ stdenv.mkDerivation {
nativeBuildInputs = [
cmake
makeWrapper
llvm.dev
llvmPackages.llvm.dev
];
buildInputs = [
# Ensure stdenv's CC is on PATH before clang-unwrapped
stdenv.cc
# Actual deps:
llvm
libclang
llvmPackages.llvm
llvmPackages.libclang
flex
zlib
]
-4
View File
@@ -5538,10 +5538,6 @@ with pkgs;
credstash = with python3Packages; toPythonApplication credstash;
creduce = callPackage ../development/tools/misc/creduce {
inherit (llvmPackages_18) llvm libclang;
};
css-html-js-minify = with python3Packages; toPythonApplication css-html-js-minify;
cvise = python3Packages.callPackage ../development/tools/misc/cvise {