pcc creates bad executables
A minimal reproducer inlined:
empty.c:
int main(void) { return 0; }
~$ pcc -o empty empty.c
~$ ./empty
Segmentation fault (core dumped)
Backtrace of the issue showed that the executable was crashing in __do_global_ctors_aux. Seemed to me that the problem is that there was a miscomplitation of the start files; namely they were compiled by gcc, but needed to be compliled by pcc. I may not have the right of it exactly, but seemed close enough to start from. Some other issues that I ran into was search path and pic/pie issues at linkage.
I have succeeded in two approaches to fix this. One was to add pcc to pcc-libs makedepends and add 'CC=pcc' to the make command for building pcc-libs. This works, but because there is a circular dependency, seems prone to breakage. The second fix was combine the two aports, allowing to build pcc-libs with the freshly built pcc. I have attached a patch for the second fix.