J. David Bryan wrote:
On 31 Oct 2001, at 4:40, Frank Heckenbach wrote:
I set GCC_FOR_TARGET and GPC_FOR_TARGET on the command line, then it works for me. Since command line settings take precendence in make, this will override the default `GPC_FOR_TARGET = ./xgpc -B./'.
I'm not sure if that's how it's supposed to be done, but AFAICS, GCC_FOR_TARGET is not set automatically when configuring for a cross-build.
Using GCC 2.95.3, the makefiles appear to be generated in this way:
Host = Build
./makefile: GCC_FOR_TARGET = $$r/gcc/xgcc ... ./makefile: GPC_FOR_TARGET = (not defined)
./gcc/makefile: GCC_FOR_TARGET = ./xgcc ... ./gcc/makefile: GPC_FOR_TARGET = ./xgpc ...
Host <> Build
./makefile: GCC_FOR_TARGET = ix86-pc-mingw32msvc-gcc ... ./makefile: GPC_FOR_TARGET = (not defined)
./gcc/makefile: GCC_FOR_TARGET = ./xgcc ... ./gcc/makefile: GPC_FOR_TARGET = ./xgpc ...
The result in the Host <> Build case is that the cross-gcc compiler is used to compile C programs in the RTS, but the (hosted) gpc compiler just built is used to compile the Pascal programs. This fails because the gpc just built doesn't run on the build system.
It would appear that in the Host <> Build case, the definition override:
GPC_FOR_TARGET = ix86-pc-mingw32msvc-gpc
...should appear in the top-level makefile.
AFAICS there are at least 3 ways to solve it:
- Set GPC_FOR_TARGET on the command line. That's what I'm doing, and it works. But it's not optimal since it could be done automatically.
- Convince the GCC people to set GPC_FOR_TARGET in the top level makefile. Someone who is in contact with them (e.g., Peter, not me) could try this.
- Forget about GPC_FOR_TARGET, and use GCC_FOR_TARGET with s/gcc/gpc/ (e.g., ./xgcc -> ./xgpc, /usr/bin/foo-bar-baz-gcc -bqux -> /usr/bin/foo-bar-baz-gpc -bqux). Does anyone see a situation where this would fail? (Though the second one is probably the cleaner solution.)
Frank