Wood David wrote:
I'm trying to compile gpc-20040516 with gcc-core-3.4.2 in the hope it will sort out a compatibility problem when linked with other c-code we've built. I found Waldek's patches to gpc proper and gcc 3.4.20041015 (I've also tried the 3.4.0 patch) and applied these using $ patch -p1 < XX.diff in the respective source directories. However, the make crashes, firstly with
../../gcc-3.4.2/gcc/p/mk_lang_opt: Permission denied.
In normal build `mk_lang_opt' should not run (it is needed only after a modification). The problem is due to limitation of `patch' (inabilty to set file mode or modification time) and microsecond timestamps in new kernels. Before the build you should touch `lang.opt' and `handle-opts.c' to mark them as up to date.
So I do a chmod +x on this file and type make again. The next worry comes when it says I should have 16 shift/reduce conflicts and 30 reduce/reduce conflicts but I get 16 and 295!
That is harmless.
The final nail in the coffin appears when p/handle-opts.c produces a string of errors because the OPT_* components are undeclared. Just before this, lang.c reports a number of warnings about function declarations not being prototypes and no previous prototype for 'pascal_post-options' or 'pascal_handle_option'.
Trying to run `mk_lang_opt' had wiped-out pre-built `lang.opt' (you get empty file instead). `lang.opt' is needed to define `OPT_*' constants. Making `mk_lang_opt' executable _before_ the build should also correct the problem.