sergev / bkunix

Unix V6 operating system for Soviet personal computer BK-0010/0011M
GNU General Public License v2.0
76 stars 22 forks source link

Errors compiling cross-devel #3

Open jockm opened 1 year ago

jockm commented 1 year ago

When I go into the cross-devel directory and issue a make (as per the instructions), I get the following errors found below.

According to this SO post it seems to be related to the -m32 compiler flag. Allows all but ccom and cpp to compile. The former needs implicit-int disabled and the latter needs misleading-indentation disabled.

There may be others, I am just getting started.

Compiling on Debian 12, x86-64, gcc 12.2.0

make
for i in cc pcc c2 ccom cpp as ld; do make DESTDIR=/usr/local -C $i; done
make[1]: Entering directory '/home/jock/pdp11/os/foozle11unix/cross-devel/cc'
gcc -m32 -Werror -O -Wall -DDESTDIR=\"/usr/local\"   -c -o pcc.o pcc.c
pcc.c:8:10: fatal error: sys/param.h: No such file or directory
    8 | #include <sys/param.h>
      |          ^~~~~~~~~~~~~
compilation terminated.
make[1]: *** [<builtin>: pcc.o] Error 1
make[1]: Leaving directory '/home/jock/pdp11/os/foozle11unix/cross-devel/cc'
make[1]: Entering directory '/home/jock/pdp11/os/foozle11unix/cross-devel/pcc'
rm -f pcclocal.h
cat pcc.h localdefs.h | egrep '^#[  ]*(define[  ][  ]*PCC(F|T|TM|OM)?_|ifdef|ifndef|endif)' | sed -e 's/PCC[A-Z]*_//' > pcclocal.h
rm -f pcctokens
cat pcc.h localdefs.h | egrep '^#[  ]*define[   ][  ]*PCC_' | sed -e 's/^#[     ]*define[   ][  ]*PCC_/%term    /' > pcctokens
cat pcctokens ../mip/cgram.y > gram.in
byacc gram.in
make[1]: byacc: No such file or directory
make[1]: *** [Makefile:73: cgram.c] Error 127
make[1]: Leaving directory '/home/jock/pdp11/os/foozle11unix/cross-devel/pcc'
make[1]: Entering directory '/home/jock/pdp11/os/foozle11unix/cross-devel/c2'
gcc -m32 -Werror -O -g -Wall   -c -o c20.o c20.c
In file included from c2.h:12,
                 from c20.c:8:
/usr/include/stdio.h:27:10: fatal error: bits/libc-header-start.h: No such file or directory
   27 | #include <bits/libc-header-start.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [<builtin>: c20.o] Error 1
make[1]: Leaving directory '/home/jock/pdp11/os/foozle11unix/cross-devel/c2'
make[1]: Entering directory '/home/jock/pdp11/os/foozle11unix/cross-devel/ccom'
gcc -m32 -O -g -Wall -DDESTDIR=\"/usr/local\"   -c -o c00.o c00.c
In file included from c00.c:12:
/usr/include/stdlib.h:26:10: fatal error: bits/libc-header-start.h: No such file or directory
   26 | #include <bits/libc-header-start.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [<builtin>: c00.o] Error 1
make[1]: Leaving directory '/home/jock/pdp11/os/foozle11unix/cross-devel/ccom'
make[1]: Entering directory '/home/jock/pdp11/os/foozle11unix/cross-devel/cpp'
gcc -m32 -Werror -O -g -Wall -DFLEXNAMES   -c -o cpp.o cpp.c
In file included from cpp.c:16:
/usr/include/stdio.h:27:10: fatal error: bits/libc-header-start.h: No such file or directory
   27 | #include <bits/libc-header-start.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [<builtin>: cpp.o] Error 1
make[1]: Leaving directory '/home/jock/pdp11/os/foozle11unix/cross-devel/cpp'
make[1]: Entering directory '/home/jock/pdp11/os/foozle11unix/cross-devel/as'
gcc -m32 -Werror -g -Wall -DDESTDIR=\"/usr/local\"   -c -o as11.o as11.c
In file included from as11.c:8:
/usr/include/stdio.h:27:10: fatal error: bits/libc-header-start.h: No such file or directory
   27 | #include <bits/libc-header-start.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [<builtin>: as11.o] Error 1
make[1]: Leaving directory '/home/jock/pdp11/os/foozle11unix/cross-devel/as'
make[1]: Entering directory '/home/jock/pdp11/os/foozle11unix/cross-devel/ld'
gcc -m32 -Werror -O -g -Wall   -c -o size.o size.c
In file included from size.c:8:
/usr/include/stdio.h:27:10: fatal error: bits/libc-header-start.h: No such file or directory
   27 | #include <bits/libc-header-start.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [<builtin>: size.o] Error 1
make[1]: Leaving directory '/home/jock/pdp11/os/foozle11unix/cross-devel/ld'
leobru commented 1 year ago

Code rot has crept in. If you have a fix, please let us know.

weiqist commented 8 months ago

byacc has not been installed on the system (must be) and CC option without -Werror in cpp/Makefile dirty hack for skip it