P r o b l e m 4
The next problem seems to be GPC related. I guess that the GPC experts will be able to help here. The build process ends with the statement:
cpp-precomp: could not open 'RTS_VERSION_CHECK="__GPC_RTS_VERSION_20021128__"'
gcc -o p/util.o -c -DIN_GCC -g -O2 -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -DHAVE_CONFIG_H -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wtraditional -pedantic -Wno-long-long -I. -Ip -I/Users/adriaan/gpcx/gcc -I/Users/adriaan/gpcx/gcc/p -I/Users/adriaan/gpcx/gcc/config -I/Users/adriaan/gpcx/gcc/../include -DGPC -I/Users/adriaan/gpcx/gcc/p -D RTS_VERSION_CHECK=""__GPC_RTS_VERSION_`cat /Users/adriaan/gpcx/gcc/p/rts/rts-version`__"" /Users/adriaan/gpcx/gcc/p/util.c cpp-precomp: could not open 'RTS_VERSION_CHECK="__GPC_RTS_VERSION_20021128__"' make[1]: *** [p/util.o] Error 1 make: *** [all-gcc] Error 2
Try removing the space after `-D' in p/Make-lang.in.
Thanks. This helps. GPC now builds and installs !
If I compile hello.pas with the new GPC, I get what seems to be a linker error. I am not sure what exactly the error message means, I hope somebody on the list does. Is there any specific documentation that I should study to solve linker problems in general ?
[G4:doc/gpc/demos] adriaan% /usr/local/bin/gpc hello.pas /usr/bin/ld: /usr/local/lib/gcc-lib/powerpc-apple-darwin6.0/3.2.1/libgpc.a(init.o) malformed object (bad indirect symbol table entry (76) (symbol at index 241 is not external) /usr/bin/ld: /usr/local/lib/gcc-lib/powerpc-apple-darwin6.0/3.2.1/libgpc.a(error.o) malformed object (bad indirect symbol table entry (60) (symbol at index 972 is not external) /usr/bin/ld: /usr/local/lib/gcc-lib/powerpc-apple-darwin6.0/3.2.1/libgpc.a(getopt.o) malformed object (bad indirect symbol table entry (24) (symbol at index 435 is not external) /usr/bin/ld: /usr/local/lib/gcc-lib/powerpc-apple-darwin6.0/3.2.1/libgpc.a(string.o) malformed object (bad indirect symbol table entry (30) (symbol at index 1251 is not external) /usr/bin/ld: /usr/local/lib/gcc-lib/powerpc-apple-darwin6.0/3.2.1/ libgpc.a(string2.o) malformed object (bad indirect symbol table entry (48) (symbol at index 570 is not external) /usr/bin/ld: /usr/local/lib/gcc-lib/powerpc-apple-darwin6.0/3.2.1/libgpc.a(heap.o) malformed object (bad indirect symbol table entry (15) (symbol at index 235 is not external) /usr/bin/ld: /usr/local/lib/gcc-lib/powerpc-apple-darwin6.0/3.2.1/libgpc.a(files.o) malformed object (bad indirect symbol table entry (70) (symbol at index 431 is not external) /usr/bin/ld: /usr/local/lib/gcc-lib/powerpc-apple-darwin6.0/3.2.1/libgpc.a(endian.o) malformed object (bad indirect symbol table entry (10) (symbol at index 178 is not external) /usr/bin/ld: /usr/local/lib/gcc-lib/powerpc-apple-darwin6.0/3.2.1/ libgpc.a(filename.o) malformed object (bad indirect symbol table entry (122) (symbol at index 2390 is not external) /usr/bin/ld: /usr/local/lib/gcc-lib/powerpc-apple-darwin6.0/3.2.1/libgpc.a(math.o) malformed object (bad indirect symbol table entry (34) (symbol at index 385 is not external) /usr/bin/ld: /usr/local/lib/gcc-lib/powerpc-apple-darwin6.0/3.2.1/libgpc.a(move.o) malformed object (bad indirect symbol table entry (4) (symbol at index 96 is not external) /usr/bin/ld: /usr/local/lib/gcc-lib/powerpc-apple-darwin6.0/3.2.1/ libgpc.a(numtodec.o) malformed object (bad indirect symbol table entry (18) (symbol at index 281 is not external) /usr/bin/ld: /usr/local/lib/gcc-lib/powerpc-apple-darwin6.0/3.2.1/libgpc.a(random.o) malformed object (bad indirect symbol table entry (38) (symbol at index 251 is not external) /usr/bin/ld: /usr/local/lib/gcc-lib/powerpc-apple-darwin6.0/3.2.1/libgpc.a(rtsc.o) malformed object (bad indirect symbol table entry (12) (symbol at index 77 is not external) /usr/bin/ld: /usr/local/lib/gcc-lib/powerpc-apple-darwin6.0/3.2.1/libgpc.a(sets.o) malformed object (bad indirect symbol table entry (12) (symbol at index 774 is not external) /usr/bin/ld: /usr/local/lib/gcc-lib/powerpc-apple-darwin6.0/3.2.1/libgpc.a(time.o) malformed object (bad indirect symbol table entry (50) (symbol at index 933 is not external) collect2: ld returned 1 exit status
P r o b l e m 3
A stament in the file stmt.c" causes problems.
/Users/adriaan/gpcx/gcc/stmt.c:5170:21: attempt to use poisoned "calloc"
The C source reads:
if (size > 0 && size < 600000 /* We deliberately use calloc here, not cmalloc, so that we can suppress this optimization if we don't have enough memory rather than aborting, as xmalloc would do. */ && (cases_seen = (unsigned char *) really_call_calloc (bytes_needed, 1)) != NULL)
Being a C ignoramus, I changed "really_call_calloc" into "xcalloc" (to at least continue the build process).
This also seems to be a GCC problem. I'm not sure which consequences your change has. Otherwise you might want to try removing the `#pragma GCC poison ... calloc' in gcc/system.h.
BTW, which version of GCC (or another C compiler?) did you use for building? I had some problems when building gcc-3.2 with gcc-3.1 on Linux/libc5 (similar to your problem 2). If possible, and you haven't already done so, try using a gcc-3.2 binary for building.
I use the gcc that came with Mac OS X 10.2, gcc (GCC) 3.1 20020420 (prerelease). I will try to install a more recent version.
Regards,
Adriaan van Os