| 1 | This patch provides an update so that nhc98 can be built and works with
|
| 2 | a modern C compiler (GCC 11) and libc (glibc 2.33).
|
| 3 |
|
| 4 | diff --git a/Makefile.inc b/Makefile.inc
|
| 5 | index 4fbd47a..5bce5c9 100644
|
| 6 | |
| 7 | |
| 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 |
|
| 20 | diff --git a/script/nhc98heap.c b/script/nhc98heap.c
|
| 21 | index 534010e..a30d5cd 100644
|
| 22 | |
| 23 | |
| 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;
|
| 31 | diff --git a/src/runtime/Kernel/collector.c b/src/runtime/Kernel/collector.c
|
| 32 | index b95a273..1f879c5 100644
|
| 33 | |
| 34 | |
| 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 */
|