Here is a first report of my attempt to build GPC-20021128 with the GCC-3.2.1 backend on Mac OS X "Darwin". The GPC build is on a 1.1 GB 450 MHz PowerMac G4 running Mac OS X 10.2.
Note: I am also trying to build GPC with an Apple-patched GCC backend (named "GCC3-1151"), but I will report about that separately.
P r o b l e m 1
During Configure, conftest crashes, but the Configure process happily continues. This is not a GPC problem. The crash also appears if I try to build GCC-3.2.1 (without GPC).
**********
Date/Time: 2002-12-24 14:40:01 +0100 OS Version: 10.2 (Build 6C115) Host: G4.local.
Command: conftest PID: 3948
Exception: EXC_BAD_ACCESS (0x0001) Codes: KERN_INVALID_ADDRESS (0x0001) at 0x00088000
Thread 0 Crashed: #0 0x000026d4 in test_1 (configure:127) #1 0x00002a9c in main (configure:237) #2 0x00002298 in _start (crt.c:267) #3 0x00002118 in start
PPC Thread State: srr0: 0x000026d4 srr1: 0x0000f030 vrsave: 0x00000000 xer: 0x00000000 lr: 0x000026b8 ctr: 0x90015040 mq: 0x00000000 r0: 0x00000001 r1: 0xbffffb40 r2: 0x84000482 r3: 0x000025e0 r4: 0x00000000 r5: 0x00000000 r6: 0x90015040 r7: 0x00000000 r8: 0x00000000 r9: 0x00001000 r10: 0x00087000 r11: 0xa0004254 r12: 0x90015040 r13: 0x00000000 r14: 0x00000000 r15: 0x00000000 r16: 0x00000000 r17: 0x00000000 r18: 0x00000000 r19: 0x00000000 r20: 0x00000000 r21: 0x00000000 r22: 0x00000000 r23: 0x00000000 r24: 0x00000000 r25: 0x00000000 r26: 0xbffffd70 r27: 0x00000008 r28: 0x00000001 r29: 0x000033a8 r30: 0xbffffd74 r31: 0x000025e0
P r o b l e m 2
The file "builtin-attrs.def" causes problems. This is not a GPC problem either: same problems if I try to build GCC (without GPC). Being a C ignoramus, I simply commented away the offending lines (in order to at least continue the build process).
In file included from /Users/adriaan/gpcx/gcc/c-common.c:4110: /Users/adriaan/gpcx/gcc/builtin-attrs.def:94: parse error before "_0" /Users/adriaan/gpcx/gcc/builtin-attrs.def:95: redefinition of `ATTR_PRINTF_1' /Users/adriaan/gpcx/gcc/builtin-attrs.def:94: `ATTR_PRINTF_1' previously defined here /Users/adriaan/gpcx/gcc/builtin-attrs.def:95: redefinition of `ATTR_FORMAT_PRINTF_1' /Users/adriaan/gpcx/gcc/builtin-attrs.def:94: `ATTR_FORMAT_PRINTF_1' previously defined here /Users/adriaan/gpcx/gcc/builtin-attrs.def:97: redefinition of `ATTR_PRINTF_2' /Users/adriaan/gpcx/gcc/builtin-attrs.def:96: `ATTR_PRINTF_2' previously defined here /Users/adriaan/gpcx/gcc/builtin-attrs.def:97: redefinition of `ATTR_FORMAT_PRINTF_2' /Users/adriaan/gpcx/gcc/builtin-attrs.def:96: `ATTR_FORMAT_PRINTF_2' previously defined here /Users/adriaan/gpcx/gcc/builtin-attrs.def:99: redefinition of `ATTR_PRINTF_3' /Users/adriaan/gpcx/gcc/builtin-attrs.def:98: `ATTR_PRINTF_3' previously defined here /Users/adriaan/gpcx/gcc/builtin-attrs.def:99: redefinition of `ATTR_FORMAT_PRINTF_3' /Users/adriaan/gpcx/gcc/builtin-attrs.def:98: `ATTR_FORMAT_PRINTF_3' previously defined here /Users/adriaan/gpcx/gcc/builtin-attrs.def:101: redefinition of `ATTR_SCANF_1' /Users/adriaan/gpcx/gcc/builtin-attrs.def:100: `ATTR_SCANF_1' previously defined here /Users/adriaan/gpcx/gcc/builtin-attrs.def:101: redefinition of `ATTR_FORMAT_SCANF_1' /Users/adriaan/gpcx/gcc/builtin-attrs.def:100: `ATTR_FORMAT_SCANF_1' previously defined here /Users/adriaan/gpcx/gcc/builtin-attrs.def:103: redefinition of `ATTR_SCANF_2' /Users/adriaan/gpcx/gcc/builtin-attrs.def:102: `ATTR_SCANF_2' previously defined here /Users/adriaan/gpcx/gcc/builtin-attrs.def:103: redefinition of `ATTR_FORMAT_SCANF_2' /Users/adriaan/gpcx/gcc/builtin-attrs.def:102: `ATTR_FORMAT_SCANF_2' previously defined here /Users/adriaan/gpcx/gcc/builtin-attrs.def:170:3: warning: style of line directive is a GCC extension /Users/adriaan/gpcx/gcc/c-common.c:4225:3: warning: style of line directive is a GCC extension In file included from /Users/adriaan/gpcx/gcc/c-common.c:4225: /Users/adriaan/gpcx/gcc/builtin-attrs.def:2:3: warning: style of line directive is a GCC extension In file included from /Users/adriaan/gpcx/gcc/c-common.c:4225: /Users/adriaan/gpcx/gcc/builtin-attrs.def: In function `c_init_attributes': /Users/adriaan/gpcx/gcc/builtin-attrs.def:94: parse error before "_0" /Users/adriaan/gpcx/gcc/builtin-attrs.def:94: parse error before "_0" /Users/adriaan/gpcx/gcc/builtin-attrs.def:95: parse error before "_2" /Users/adriaan/gpcx/gcc/builtin-attrs.def:95: parse error before "_2" /Users/adriaan/gpcx/gcc/builtin-attrs.def:96: parse error before "_0" /Users/adriaan/gpcx/gcc/builtin-attrs.def:96: parse error before "_0" /Users/adriaan/gpcx/gcc/builtin-attrs.def:97: parse error before "_3" /Users/adriaan/gpcx/gcc/builtin-attrs.def:97: parse error before "_3" /Users/adriaan/gpcx/gcc/builtin-attrs.def:98: parse error before "_0" /Users/adriaan/gpcx/gcc/builtin-attrs.def:98: parse error before "_0" /Users/adriaan/gpcx/gcc/builtin-attrs.def:99: parse error before "_4" /Users/adriaan/gpcx/gcc/builtin-attrs.def:99: parse error before "_4" /Users/adriaan/gpcx/gcc/builtin-attrs.def:100: parse error before "_0" /Users/adriaan/gpcx/gcc/builtin-attrs.def:100: parse error before "_0" /Users/adriaan/gpcx/gcc/builtin-attrs.def:101: parse error before "_2" /Users/adriaan/gpcx/gcc/builtin-attrs.def:101: parse error before "_2" /Users/adriaan/gpcx/gcc/builtin-attrs.def:102: parse error before "_0" /Users/adriaan/gpcx/gcc/builtin-attrs.def:102: parse error before "_0" /Users/adriaan/gpcx/gcc/builtin-attrs.def:103: parse error before "_3" /Users/adriaan/gpcx/gcc/builtin-attrs.def:103: parse error before "_3" /Users/adriaan/gpcx/gcc/builtin-attrs.def:104: parse error before "_0" /Users/adriaan/gpcx/gcc/builtin-attrs.def:104: parse error before "_0" /Users/adriaan/gpcx/gcc/builtin-attrs.def:105: parse error before "_4" /Users/adriaan/gpcx/gcc/builtin-attrs.def:105: parse error before "_4" /Users/adriaan/gpcx/gcc/builtin-attrs.def:170:3: warning: style of line directive is a GCC extension /Users/adriaan/gpcx/gcc/c-common.c:4254:3: warning: style of line directive is a GCC extension In file included from /Users/adriaan/gpcx/gcc/c-common.c:4254: /Users/adriaan/gpcx/gcc/builtin-attrs.def:2:3: warning: style of line directive is a GCC extension In file included from /Users/adriaan/gpcx/gcc/c-common.c:4254: /Users/adriaan/gpcx/gcc/builtin-attrs.def: In function `c_common_insert_default_attributes': /Users/adriaan/gpcx/gcc/builtin-attrs.def:126: `ATTR_FORMAT_PRINTF_1_2' undeclared (first use in this function) /Users/adriaan/gpcx/gcc/builtin-attrs.def:126: (Each undeclared identifier is reported only once /Users/adriaan/gpcx/gcc/builtin-attrs.def:126: for each function it appears in.) /Users/adriaan/gpcx/gcc/builtin-attrs.def:127: `ATTR_FORMAT_PRINTF_2_3' undeclared (first use in this function) /Users/adriaan/gpcx/gcc/builtin-attrs.def:136: `ATTR_FORMAT_SCANF_1_2' undeclared (first use in this function) /Users/adriaan/gpcx/gcc/builtin-attrs.def:137: `ATTR_FORMAT_SCANF_2_3' undeclared (first use in this function) /Users/adriaan/gpcx/gcc/builtin-attrs.def:139: `ATTR_FORMAT_PRINTF_1_0' undeclared (first use in this function) /Users/adriaan/gpcx/gcc/builtin-attrs.def:140: `ATTR_FORMAT_PRINTF_2_0' undeclared (first use in this function) /Users/adriaan/gpcx/gcc/builtin-attrs.def:142: `ATTR_FORMAT_STRFTIME_3_0' undeclared (first use in this function) /Users/adriaan/gpcx/gcc/builtin-attrs.def:150: `ATTR_FORMAT_PRINTF_3_4' undeclared (first use in this function) /Users/adriaan/gpcx/gcc/builtin-attrs.def:151: `ATTR_FORMAT_PRINTF_3_0' undeclared (first use in this function) /Users/adriaan/gpcx/gcc/builtin-attrs.def:152: `ATTR_FORMAT_SCANF_1_0' undeclared (first use in this function) /Users/adriaan/gpcx/gcc/builtin-attrs.def:153: `ATTR_FORMAT_SCANF_2_0' undeclared (first use in this function) /Users/adriaan/gpcx/gcc/builtin-attrs.def:166: `ATTR_FORMAT_STRFMON_3_4' undeclared (first use in this function) /Users/adriaan/gpcx/gcc/builtin-attrs.def:170:3: warning: style of line directive is a GCC extension make[1]: *** [c-common.o] Error 1 make: *** [all-gcc] Error 2
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).
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
I can send in more information, make and configure files, etcetera.
Regards,
Adriaan van Os
Adriaan van Os wrote:
Here is a first report of my attempt to build GPC-20021128 with the GCC-3.2.1 backend on Mac OS X "Darwin". The GPC build is on a 1.1 GB 450 MHz PowerMac G4 running Mac OS X 10.2.
Note: I am also trying to build GPC with an Apple-patched GCC backend (named "GCC3-1151"), but I will report about that separately.
P r o b l e m 1
During Configure, conftest crashes, but the Configure process happily continues. This is not a GPC problem. The crash also appears if I try to build GCC-3.2.1 (without GPC).
P r o b l e m 2
The file "builtin-attrs.def" causes problems. This is not a GPC problem either: same problems if I try to build GCC (without GPC). Being a C ignoramus, I simply commented away the offending lines (in order to at least continue the build process).
I won't comment further on them. Maybe they've been fixed in the patrched GCC sources, and hopefully those fixes will get into the mainline GCC soon (as has been done on other platforms before).
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.
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.
Frank
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
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.
The most recent Apple version of GCC that I can find on the web (http://www.opendarwin.org/en/news.php#20) is "gcc3-1205 Darwin". Installing and using it doesn't change reported problems. Yet, I can use it to build a new GCC from the standard GCC-3.2.1 sources. This gives me a GCC-3.2.1 that installs and runs on Darwin. If I use this new GCC (3.2.1) to build GPC 20021128, there are no building problems: reported problems 1 to 4 have disappeared ! Unfortunately, the linking problem is still the same:
[G4:doc/gpc/demos] adriaan% gpc hello.pas /usr/bin/ld: /usr/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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
The most recent Apple version of GCC that I can find on the web (http://www.opendarwin.org/en/news.php#20) is "gcc3-1205 Darwin". Installing and using it doesn't change reported problems. Yet, I can use it to build a new GCC from the standard GCC-3.2.1 sources. This gives me a GCC-3.2.1 that installs and runs on Darwin. If I use this new GCC (3.2.1) to build GPC 20021128, there are no building problems: reported problems 1 to 4 have disappeared ! Unfortunately, the linking problem is still the same:
[G4:doc/gpc/demos] adriaan% gpc hello.pas /usr/bin/ld: /usr/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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
When I look in gpclib.a (with otool), I find the following entries for these indices. They all read:
"Indirect symbols for (__DATA,__nl_symbol_ptr) ... entries" address index name 0x00001b88 241 _fini_GPC_Init 0x00006624 972 _fini_GPC_Error 0x00001fa0 435 _fini_GPC_Getopt 0x00002424 1251 _fini_GPC_String 0x000018e0 570 _fini_GPC_String2 0x0000095c 235 _fini_GPC_Heap 0x00001520 431 _fini_GPC_Files 0x000005c8 178 _fini_GPC_Endian 0x000081c8 2390 _fini_GPC_Filename 0x00001078 385 _fini_GPC_Math 0x00000260 96 _fini_GPC_Move 0x000008e8 281 _fini_GPC_Numtodec 0x00000ce0 251 _fini_GPC_Random 0x000001b4 77 _fini_GPC_Rtsc 0x0000115c 774 _fini_GPC_Sets 0x00004828 933 _fini_GPC_Time
I hope this additional information is useful in finding the cause of the linking problem.
Best regards,
Adriaan
Adriaan van Os wrote:
The most recent Apple version of GCC that I can find on the web (http://www.opendarwin.org/en/news.php#20) is "gcc3-1205 Darwin". Installing and using it doesn't change reported problems. Yet, I can use it to build a new GCC from the standard GCC-3.2.1 sources. This gives me a GCC-3.2.1 that installs and runs on Darwin. If I use this new GCC (3.2.1) to build GPC 20021128, there are no building problems: reported problems 1 to 4 have disappeared !
I don't quite understand. With the downloaded GCC, you are able to build gcc-3.2.1, but building GPC with gcc-3.2.1 sources fails. But the problems (#1, 2 and 3) are related to parts of the GCC sources that are unchanged by GPC. So compiling the same sources once works and once fails!? I must be missing something ...
Unfortunately, the linking problem is still the same:
[G4:doc/gpc/demos] adriaan% gpc hello.pas /usr/bin/ld: /usr/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)
[...]
When I look in gpclib.a (with otool), I find the following entries for these indices. They all read:
"Indirect symbols for (__DATA,__nl_symbol_ptr) ... entries" address index name 0x00001b88 241 _fini_GPC_Init 0x00006624 972 _fini_GPC_Error 0x00001fa0 435 _fini_GPC_Getopt 0x00002424 1251 _fini_GPC_String 0x000018e0 570 _fini_GPC_String2 0x0000095c 235 _fini_GPC_Heap 0x00001520 431 _fini_GPC_Files 0x000005c8 178 _fini_GPC_Endian 0x000081c8 2390 _fini_GPC_Filename 0x00001078 385 _fini_GPC_Math 0x00000260 96 _fini_GPC_Move 0x000008e8 281 _fini_GPC_Numtodec 0x00000ce0 251 _fini_GPC_Random 0x000001b4 77 _fini_GPC_Rtsc 0x0000115c 774 _fini_GPC_Sets 0x00004828 933 _fini_GPC_Time
I hope this additional information is useful in finding the cause of the linking problem.
Try this (patch may need manual applying, since I've changed some other things in my copy meanwhile).
*** p/parse.y.orig Fri Jan 3 09:44:04 2003 --- p/parse.y Fri Jan 3 09:49:25 2003 *************** *** 792,799 **** tree name = get_module_destructor_name (current_module); const char *save_filename = start_dummy_file_name (); context = build_nt (CALL_EXPR, name, no_parameters (), NULL_TREE); ! if (!start_function (chainon (build_tree_list (NULL_TREE, static_id), ! build_tree_list (NULL_TREE, void_type_node)), context, NULL_TREE, 0)) YYERROR1; store_parm_decls (); --- 792,798 ---- tree name = get_module_destructor_name (current_module); const char *save_filename = start_dummy_file_name (); context = build_nt (CALL_EXPR, name, no_parameters (), NULL_TREE); ! if (!start_function (build_tree_list (NULL_TREE, void_type_node), context, NULL_TREE, 0)) YYERROR1; store_parm_decls ();
Frank
Frank Heckenbach wrote:
Adriaan van Os wrote:
The most recent Apple version of GCC that I can find on the web (http://www.opendarwin.org/en/news.php#20) is "gcc3-1205 Darwin". Installing and using it doesn't change reported problems. Yet, I can use it to build a new GCC from the standard GCC-3.2.1 sources. This gives me a GCC-3.2.1 that installs and runs on Darwin. If I use this new GCC (3.2.1) to build GPC 20021128, there are no building problems: reported problems 1 to 4 have disappeared !
I don't quite understand. With the downloaded GCC, you are able to build gcc-3.2.1, but building GPC with gcc-3.2.1 sources fails. But the problems (#1, 2 and 3) are related to parts of the GCC sources that are unchanged by GPC. So compiling the same sources once works and once fails!? I must be missing something ...
Problems #1, 2 and 3 are related to GCC (not GPC), so to build "GCC 3.2.1" I had to ignore problem #1 (which doesn't seem to influence the build process). Also, I had to apply the hacks for problems #2 and #3. However, this new (hacked) GCC 3.2.1 compiler now causes problems when I try to repeat what (I think) I did. Probably, I have mixed up versions and my statement above is wrong. Well, I have done quite a lot of experimenting with different versions -- on the fly trying to learn UNIX.
I will do my best to find more information on the web on building GCC 3.2.1 on Darwin.
Unfortunately, the linking problem is still the same:
[G4:doc/gpc/demos] adriaan% gpc hello.pas /usr/bin/ld: /usr/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)
[...]
When I look in gpclib.a (with otool), I find the following entries for these indices. They all read:
"Indirect symbols for (__DATA,__nl_symbol_ptr) ... entries" address index name 0x00001b88 241 _fini_GPC_Init 0x00006624 972 _fini_GPC_Error 0x00001fa0 435 _fini_GPC_Getopt 0x00002424 1251 _fini_GPC_String 0x000018e0 570 _fini_GPC_String2 0x0000095c 235 _fini_GPC_Heap 0x00001520 431 _fini_GPC_Files 0x000005c8 178 _fini_GPC_Endian 0x000081c8 2390 _fini_GPC_Filename 0x00001078 385 _fini_GPC_Math 0x00000260 96 _fini_GPC_Move 0x000008e8 281 _fini_GPC_Numtodec 0x00000ce0 251 _fini_GPC_Random 0x000001b4 77 _fini_GPC_Rtsc 0x0000115c 774 _fini_GPC_Sets 0x00004828 933 _fini_GPC_Time
I hope this additional information is useful in finding the cause of the linking problem.
Try this (patch may need manual applying, since I've changed some other things in my copy meanwhile).
*** p/parse.y.orig Fri Jan 3 09:44:04 2003 --- p/parse.y Fri Jan 3 09:49:25 2003
*** 792,799 **** tree name = get_module_destructor_name (current_module); const char *save_filename = start_dummy_file_name (); context = build_nt (CALL_EXPR, name, no_parameters (), NULL_TREE); ! if (!start_function (chainon (build_tree_list (NULL_TREE, static_id), ! build_tree_list (NULL_TREE, void_type_node)), context, NULL_TREE, 0)) YYERROR1; store_parm_decls (); --- 792,798 ---- tree name = get_module_destructor_name (current_module); const char *save_filename = start_dummy_file_name (); context = build_nt (CALL_EXPR, name, no_parameters (), NULL_TREE); ! if (!start_function (build_tree_list (NULL_TREE, void_type_node), context, NULL_TREE, 0)) YYERROR1; store_parm_decls ();
Thanks a lot !!
Superb news ----- GPC builds on Mac OS X !!! Hello.pas compiles and runs !!!
Next step is to run a lot of tests. More news to follow.
Regards,
Adriaan van Os
Frank Heckenbach wrote:
Adriaan van Os wrote:
The most recent Apple version of GCC that I can find on the web (http://www.opendarwin.org/en/news.php#20) is "gcc3-1205 Darwin". Installing and using it doesn't change reported problems. Yet, I can use it to build a new GCC from the standard GCC-3.2.1 sources. This gives me a GCC-3.2.1 that installs and runs on Darwin. If I use this new GCC (3.2.1) to build GPC 20021128, there are no building problems: reported problems 1 to 4 have disappeared !
I don't quite understand. With the downloaded GCC, you are able to build gcc-3.2.1, but building GPC with gcc-3.2.1 sources fails. But the problems (#1, 2 and 3) are related to parts of the GCC sources that are unchanged by GPC. So compiling the same sources once works and once fails!? I must be missing something ...
Problems #1, 2 and 3 are related to GCC (not GPC), so to build "GCC 3.2.1" I had to ignore problem #1 (which doesn't seem to influence the build process). Also, I had to apply the hacks for problems #2 and #3. However, this new (hacked) GCC 3.2.1 compiler now causes problems when I try to repeat what (I think) I did. Probably, I have mixed up versions and my statement above is wrong. Well, I have done quite a lot of experimenting with different versions -- on the fly trying to learn UNIX.
Well, to be more precise, rebuilding GCC 3.2.1, using a fresh copy of the GCC-3.2.1 sources and the hacked GCC 3.2.1 compiler results in an error:
In file included from ../../../gcc-3.2/gcc/intl/dcigettext.c:58: ../include/stdlib.h:84: syntax error before "rune_t" make[3]: *** [dcigettext.o] Error 1 make[2]: *** [intl.all] Error 1 make[1]: *** [stage2_build] Error 2 make: *** [bootstrap] Error 2
(Please note that this error doesn't appear when building GCC 3.2.1 with an Apple GCC, but that results in other problems, as reported).
At first, I thought, the error was related to the hacked GCC 3.2.1 compiler, but it turns out that GCC 3.2.1 doesn't build (itself) on Darwin without a patch to stddef.h. The patch can be found at http://gcc.gnu.org/ml/gcc/2002-08/msg01681.html.
--- gcc-04072002/gcc/ginclude/stddef.h Wed Jan 9 13:28:06 2002 +++ gccsrc/gcc/gcc/ginclude/stddef.h Thu Jul 4 18:37:27 2002 @@ -242,6 +242,7 @@ #ifndef _WCHAR_T_ #ifndef _BSD_WCHAR_T_ #ifndef _BSD_WCHAR_T_DEFINED_ /* Darwin */ +#ifndef _BSD_RUNE_T_DEFINED_ /* Darwin */ #ifndef _WCHAR_T_DEFINED_ #ifndef _WCHAR_T_DEFINED #ifndef _WCHAR_T_H @@ -278,6 +279,7 @@ #ifdef _BSD_RUNE_T_ #if !defined (_ANSI_SOURCE) && !defined (_POSIX_SOURCE) typedef _BSD_RUNE_T_ rune_t; +#define _BSD_RUNE_T_DEFINED_ #define _BSD_WCHAR_T_DEFINED_ #if defined (__FreeBSD__) /* Why is this file so hard to maintain properly? In constrast to @@ -295,6 +297,7 @@ #endif #ifndef __cplusplus typedef __WCHAR_TYPE__ wchar_t; +#endif #endif #endif #endif
I propose to add this patch to gcc-3.2.1.diff. It is already in the GCC trunk (whatever that may be).
After the patch, I can use the hacked GCC 3.2.1 to build a clean GCC-3.2.1, "make bootstrap" is successfull. Now that I (finally) have a clean GCC 3.2.1 compiler, I can also build a clean GPC 3.2.1 on Darwin.
Resumé ----------- Problem 1. The Conftest crash is still there, but it doesn't seem to matter. I will investigate it further. Problem 2. Temporary hack (problem has gone with the final GCC 3.2.1 compiler) Problem 3. Temporary hack (problem has gone with the final GCC 3.2.1 compiler) Problem 4. Remove the space after `-D' in p/Make-lang.in (Frank Heckenbach) Linker reports malformed object. Patch Parse.y (Frank Heckenbach) GCC-3.2.1 doesn't build on Darwin. Apply above patch (Andreas Tobler)
Adriaan van Os wrote:
At first, I thought, the error was related to the hacked GCC 3.2.1 compiler, but it turns out that GCC 3.2.1 doesn't build (itself) on Darwin without a patch to stddef.h. The patch can be found at http://gcc.gnu.org/ml/gcc/2002-08/msg01681.html.
I propose to add this patch to gcc-3.2.1.diff. It is already in the GCC trunk (whatever that may be).
If you mean the one in the GPC sources, sorry no. These are Pascal specific patches. Genuine GCC problems should not be fixed here. Unless there are problems with the patch, I expect it to be included in the current GCC snapshot or one of the next ones ...
Frank