pcc/ common-problems

You have an idea of how it is supposed to work by reading How-it-works and you have read Supported-Platforms to see if there are solutions for your operating system.

Still not working properly? Here are a few things you can try:

prog.c:1: error: cannot find foo.h

Run your program through the pre-processor:

$ pcc -v -E prog.c > prog.i

You will see which directories the pre-processor is searching to find the header files. The header file must be somewhere else. The operating system may be putting header files in some obscure directories. Find where the file is located and add the location to os/your-os/ccconfig.h in the source distribution.

If the header is a part of GCC, then you should try to create a new header file with the equivalent features. Place it into a directory searched by the pre-processor and post the contents of the file to Supported-Platforms.

prog.c, line 16: compiler error: Cannot generate code, node 0x1800f20 op CALL

You've just discovered missing functionality in the compiler for your machine.

Run the C source through the pre-processor and run the pre-processed source through the compiler proper:

$ pcc -v -E prog.c
$ /usr/local/libexec/ccom prog.i

This will give you sufficient information to put an additional entry in arch/cpu-type/table.c. Or you can post the output to the mailing list.

Segmentation Fault

You have probably found a code-generation bug. Try debugging with gdb:

$ pcc -g prog.c
$ gdb ./a.out
(gdb) run
(gdb) list
(gdb) disassemble

These commands should be sufficient to see the C source code causing the problem and the resulting machine code generated by the compiler. Probably somewhere in arch/cpu-type/table.c there is an entry generating an invalid instruction (if you are very lucky).

The problem may also be in arch/cpu-type/local2.c (if you are lucky).

It could be a type conversation problem when an SCONV entry is invalid in arch/cpu-type/table.c (if you are unlucky).

It could be almost anywhere (if you are very unlucky).