lingeling: Fix build errors with GCC 15 (#476133)

This commit is contained in:
Sandro
2026-01-04 01:01:17 +00:00
committed by GitHub
2 changed files with 64 additions and 0 deletions
+58
View File
@@ -0,0 +1,58 @@
From f1e35d1102a87eb576ce3f09da5cdf1d4b09722c Mon Sep 17 00:00:00 2001
From: Anders Kaseorg <andersk@mit.edu>
Date: Thu, 1 Jan 2026 21:50:52 -0800
Subject: [PATCH] Fix incompatible pointer type errors from GCC 15
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
---
treengeling.c | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/treengeling.c b/treengeling.c
index 1fcafc8..c26c5b5 100644
--- a/treengeling.c
+++ b/treengeling.c
@@ -292,6 +292,16 @@ UNLOCK (simplified)
UNLOCK (stats)
UNLOCK (workers)
+static void lockmsg_callback (void * voidptr) {
+ lockmsg();
+ (void) voidptr;
+}
+
+static void unlockmsg_callback (void * voidptr) {
+ unlockmsg();
+ (void) voidptr;
+}
+
/*------------------------------------------------------------------------*/
static void err (const char * fmt, ...) {
@@ -818,7 +828,7 @@ static void initroot () {
lglsetopt (root, "bca", 0);
lglseterm (root, term, 0);
lglsetconsumeunits (root, consumeunits, &rootconsumed);
- lglsetmsglock (root, lockmsg, unlockmsg, 0);
+ lglsetmsglock (root, lockmsg_callback, unlockmsg_callback, 0);
}
lglsetime (root, getime);
lglsetprefix (root, "c (root) ");
@@ -857,7 +867,7 @@ static Node * newnode (Node * parent, int decision) {
sprintf (prefix, "c (%d %lld) ", res->depth, (LL) res->id);
lglsetprefix (res->lgl, prefix);
lglseterm (res->lgl, term, 0);
- lglsetmsglock (res->lgl, lockmsg, unlockmsg, 0);
+ lglsetmsglock (res->lgl, lockmsg_callback, unlockmsg_callback, 0);
if (!noparallel) lglsetconsumeunits (res->lgl, consumeunits, &res->consumed);
cubemsg (res, "opened cube");
added++;
@@ -1040,7 +1050,7 @@ static void startparallel (LGL * lgl) {
lglseterm (parallel.lgl, term, 0);
lglsetproduceunit (parallel.lgl, produceunit, 0);
lglsetconsumecls (parallel.lgl, consumecls, 0);
- lglsetmsglock (parallel.lgl, lockmsg, unlockmsg, 0);
+ lglsetmsglock (parallel.lgl, lockmsg_callback, unlockmsg_callback, 0);
parallel.decisions = lglgetdecs (parallel.lgl);
parallel.conflicts = lglgetconfs (parallel.lgl);
parallel.propagations = lglgetprops (parallel.lgl);
+6
View File
@@ -17,6 +17,12 @@ stdenv.mkDerivation {
sha256 = "1lb2g37nd8qq5hw5g6l691nx5095336yb2zlbaw43mg56hkj8357";
};
patches = [
# Fix incompatible pointer type errors from GCC 15
# https://github.com/arminbiere/lingeling/pull/11
./gcc-15.patch
];
configurePhase = ''
runHook preConfigure