projects/guix·blob python-team · refs

42 lines · 1.2 KiB

1This patch provides an update so that nhc98 can be built and works with
2a modern C compiler (GCC 11) and libc (glibc 2.33).
3
4diff --git a/Makefile.inc b/Makefile.inc
5index 4fbd47a..5bce5c9 100644
6--- a/Makefile.inc
7+++ b/Makefile.inc
8@@ -1,6 +1,10 @@
9 ### Configurable variables:
10
11-OPT = -O3
12+# We want C89 semantics plus C++-style comments and things like the
13+# 'setjmp_buf' and 'u_short' types. More importantly, build with '-O1'
14+# only to avoid modern optimizations that break the code.
15+OPT = -O1 -std=gnu89 -D_GNU_SOURCE=1
16+
17 #ARCH = -m32
18 ARCH =
19
20diff --git a/script/nhc98heap.c b/script/nhc98heap.c
21index 534010e..a30d5cd 100644
22--- a/script/nhc98heap.c
23+++ b/script/nhc98heap.c
24@@ -1,5 +1,6 @@
25 #include <stdlib.h>
26 #include <stdio.h>
27+#include <ctype.h>
28 main(int argc, char **argv)
29 {
30 int prefix = 1;
31diff --git a/src/runtime/Kernel/collector.c b/src/runtime/Kernel/collector.c
32index b95a273..1f879c5 100644
33--- a/src/runtime/Kernel/collector.c
34+++ b/src/runtime/Kernel/collector.c
35@@ -2,6 +2,7 @@
36 #include <stdlib.h>
37 #include <stdio.h>
38 #include <string.h>
39+#include <unistd.h>
40 #include "node.h"
41 /*#include "newmacros.h" -- already included in node.h */
42 /*#include "runtime.h" -- already included in node.h */