Waldek Hebisch wrote:
Francesco Lombardi wrote:
Hi all! I'm trying to build a cross compiler from win32-cygwin to arm-elf. I built the gcc cross compiler that works very well... Now, with the same configuration, I'm trying to build gpc compiler. The building process seems good, but if I try to compile a simple pascal code I obtain some errors:
C:\cygwin\home\Mode3\Nuova cartella>arm-elf-gpc -o prova.o prova.pp /home/gba/lib/gcc-lib/arm-elf/3.3.1/libgpc.a(rts.o)(.text+0xed0): In function `realpath': /home/Administrator/sources/gcc/gcc/p/rts/rts.c:1493: undefined reference to `getcwd' /home/gba/lib/gcc-lib/arm-elf/3.3.1/libgpc.a(rts.o)(.text+0x1114): In function `_p_CStringRealPath': /home/Administrator/sources/gcc/gcc/p/rts/rts.c:1583: undefined reference to `getcwd'
GPC runtime library assumes Unix environment. Your option are:
- Provide stubs for missing Unix functions.
- Use GPC without runtime (I wrote int the past to the list how to do
it). 3) Write mini-runtime which do not need Unix functions
I you manage 2) you can then proceed to 3) picking the functions that you really need from regular GPC runtime. Or you can do 3) deleting references to Unix functions from regular runtime. I suspect that picking parts that you need is easier then deleting but YMMW.
If getcwd is the only error you get, we can add an autoconf check for it (just as we do for almost all other Unix-specific functions that we use).
For a quick check if it's the only problem, you can try adding
#define getcwd(buf, size) NULL
in p/rts/rts.c (e.g., in line 215). (But if there were other errors that you trimmed in your mail, I might have to see them to tell if it's worth checking for all of those things.)
Frank