Waldek Hebisch wrote:
I have now "almost ready" experimental gcc-4.1.0 port. There are some minor problems but
basically 4.1.0 port should be now as good (or as bad...) as 4.0.3 port. I would > like to fix some extra problems (most of them not related to port) and add some feature before I make a new snapshot, so ATM I have made port available as patches:
Thanks for the new diffs for gcc-4.1.0 !
I tried them, but the build dies with:
../.././xgpc -B../.././ -c -I. -W -Wall -Wmissing-prototypes -Wmissing-declarations -g -DHAVE_DESIGNATED_INITIALIZERS=0 -DENABLE_CHECKING -DENABLE_ASSERT_CHECKING --unit-path=/Users/adriaan/gpc/gpc-20060325/gcc-41/gcc-4.1.0/gcc/p/rts --automake -DRTS_RELEASE_STRING="'`cat /Users/adriaan/gpc/gpc-20060325/gcc-41/gcc-4.1.0/gcc/p/rts/rts-version`'" -DGCC_VERSION="''" "/Users/adriaan/gpc/gpc-20060325/gcc-41/gcc-4.1.0/gcc/p/rts/files.pas" /Users/adriaan/gpc/gpc-20060325/gcc-41/gcc-4.1.0/gcc/p/rts/files.pas: In function `CanRead': /Users/adriaan/gpc/gpc-20060325/gcc-41/gcc-4.1.0/gcc/p/rts/files.pas:1878: error: invalid initializer for set /Users/adriaan/gpc/gpc-20060325/gcc-41/gcc-4.1.0/gcc/p/rts/files.pas:1878: error: invalid initializer for set /Users/adriaan/gpc/gpc-20060325/gcc-41/gcc-4.1.0/gcc/p/rts/files.pas: In function `CanWrite': /Users/adriaan/gpc/gpc-20060325/gcc-41/gcc-4.1.0/gcc/p/rts/files.pas:1884: error: invalid initializer for set /Users/adriaan/gpc/gpc-20060325/gcc-41/gcc-4.1.0/gcc/p/rts/files.pas:1884: error: invalid initializer for set /Users/adriaan/gpc/gpc-20060325/gcc-41/gcc-4.1.0/gcc/p/rts/files.pas: In procedure `GPC_BlockRead': /Users/adriaan/gpc/gpc-20060325/gcc-41/gcc-4.1.0/gcc/p/rts/files.pas:1894: error: invalid initializer for set /Users/adriaan/gpc/gpc-20060325/gcc-41/gcc-4.1.0/gcc/p/rts/files.pas:1893: error: invalid initializer for set make[3]: *** [files.o] Error 1 make[2]: *** [pascal.rts] Error 2 make[1]: *** [stage1_build] Error 2 make: *** [bootstrap] Error 2
Regards,
Adriaan van Os
Adriaan van Os wrote:
Waldek Hebisch wrote:
I have now "almost ready" experimental gcc-4.1.0 port. There are some minor problems but
basically 4.1.0 port should be now as good (or as bad...) as 4.0.3 port. I would > like to fix some extra problems (most of them not related to port) and add some feature before I make a new snapshot, so ATM I have made port available as patches:
Thanks for the new diffs for gcc-4.1.0 !
I tried them, but the build dies with:
../.././xgpc -B../.././ -c -I. -W -Wall -Wmissing-prototypes -Wmissing-declarations -g -DHAVE_DESIGNATED_INITIALIZERS=0 -DENABLE_CHECKING -DENABLE_ASSERT_CHECKING --unit-path=/Users/adriaan/gpc/gpc-20060325/gcc-41/gcc-4.1.0/gcc/p/rts --automake -DRTS_RELEASE_STRING="'`cat /Users/adriaan/gpc/gpc-20060325/gcc-41/gcc-4.1.0/gcc/p/rts/rts-version`'" -DGCC_VERSION="''" "/Users/adriaan/gpc/gpc-20060325/gcc-41/gcc-4.1.0/gcc/p/rts/files.pas" /Users/adriaan/gpc/gpc-20060325/gcc-41/gcc-4.1.0/gcc/p/rts/files.pas: In function `CanRead': /Users/adriaan/gpc/gpc-20060325/gcc-41/gcc-4.1.0/gcc/p/rts/files.pas:1878: error: invalid initializer for set
I can not reproduce the problem. Since the compiler semm to be build one can try to copy RTS (libgpc.a) compiled using different backend into build directory and run the testsuite to get more information.
Also, could you try the following patch (it should print internal information about failing set initializers):
--- gcc-4.1.0/gcc/tree.c.pp 2006-04-11 02:18:02.158210824 +0200 +++ gcc-4.1.0/gcc/tree.c 2006-04-11 02:18:24.782771368 +0200 @@ -6013,6 +6013,7 @@
if (lo_index < low_limit || hi_index >= bit_size) { + debug_tree (vals); error ("invalid initializer for set"); return NULL_TREE; } @@ -6031,6 +6032,7 @@ = tree_low_cst (TREE_VALUE (vals), 0) - domain_min; if (index < 0 || index >= bit_size) { + debug_tree (vals); error ("invalid initializer for set"); return NULL_TREE; }
Waldek Hebisch wrote:
I can not reproduce the problem. Since the compiler semm to be build one can try to copy RTS (libgpc.a) compiled using different backend into build directory and run the testsuite to get more information.
Also, could you try the following patch (it should print internal information about failing set initializers):
--- gcc-4.1.0/gcc/tree.c.pp 2006-04-11 02:18:02.158210824 +0200 +++ gcc-4.1.0/gcc/tree.c 2006-04-11 02:18:24.782771368 +0200 @@ -6013,6 +6013,7 @@
if (lo_index < low_limit || hi_index >= bit_size) {
debug_tree (vals); error ("invalid initializer for set"); return NULL_TREE; }
@@ -6031,6 +6032,7 @@ = tree_low_cst (TREE_VALUE (vals), 0) - domain_min; if (index < 0 || index >= bit_size) {
debug_tree (vals); error ("invalid initializer for set"); return NULL_TREE; }
This results in:
../.././xgpc -B../.././ -c -I. -W -Wall -Wmissing-prototypes -Wmissing-declarations -g -O2 --unit-path=/Users/adriaan/gpc/gpc-20060325/gcc-41/gcc-4.1.0/gcc/p/rts --automake -DRTS_RELEASE_STRING="'`cat /Users/adriaan/gpc/gpc-20060325/gcc-41/gcc-4.1.0/gcc/p/rts/rts-version`'" -DGCC_VERSION="''" "/Users/adriaan/gpc/gpc-20060325/gcc-41/gcc-4.1.0/gcc/p/rts/files.pas" <tree_list 0x44018080 purpose <integer_cst 0x44018060 type <enumeral_type 0x434e28c0 Ioselectevents> constant invariant tree_5 1> value <integer_cst 0x44018060 1>> /Users/adriaan/gpc/gpc-20060325/gcc-41/gcc-4.1.0/gcc/p/rts/files.pas: In function `CanRead': /Users/adriaan/gpc/gpc-20060325/gcc-41/gcc-4.1.0/gcc/p/rts/files.pas:1878: error: invalid initializer for set <tree_list 0x44018080 purpose <integer_cst 0x44018060 type <enumeral_type 0x434e28c0 Ioselectevents> constant invariant tree_5 1> value <integer_cst 0x44018060 1>> /Users/adriaan/gpc/gpc-20060325/gcc-41/gcc-4.1.0/gcc/p/rts/files.pas:1878: error: invalid initializer for set <tree_list 0x4401b280 purpose <integer_cst 0x4401b260 type <enumeral_type 0x434e28c0 Ioselectevents> constant invariant tree_5 3> value <integer_cst 0x4401b260 3>> /Users/adriaan/gpc/gpc-20060325/gcc-41/gcc-4.1.0/gcc/p/rts/files.pas: In function `CanWrite': /Users/adriaan/gpc/gpc-20060325/gcc-41/gcc-4.1.0/gcc/p/rts/files.pas:1884: error: invalid initializer for set <tree_list 0x4401b280 purpose <integer_cst 0x4401b260 type <enumeral_type 0x434e28c0 Ioselectevents> constant invariant tree_5 3> value <integer_cst 0x4401b260 3>> /Users/adriaan/gpc/gpc-20060325/gcc-41/gcc-4.1.0/gcc/p/rts/files.pas:1884: error: invalid initializer for set <tree_list 0x4401c6a0 purpose <integer_cst 0x4401c680 type <enumeral_type 0x434e28c0 Ioselectevents> constant invariant tree_5 0> value <integer_cst 0x4401c680 0>> /Users/adriaan/gpc/gpc-20060325/gcc-41/gcc-4.1.0/gcc/p/rts/files.pas: In procedure `GPC_BlockRead': /Users/adriaan/gpc/gpc-20060325/gcc-41/gcc-4.1.0/gcc/p/rts/files.pas:1894: error: invalid initializer for set <tree_list 0x4401c6a0 purpose <integer_cst 0x4401c680 type <enumeral_type 0x434e28c0 Ioselectevents> constant invariant tree_5 0> value <integer_cst 0x4401c680 0>> /Users/adriaan/gpc/gpc-20060325/gcc-41/gcc-4.1.0/gcc/p/rts/files.pas:1893: error: invalid initializer for set make[3]: *** [files.o] Error 1 make[2]: *** [pascal.rts] Error 2 make[1]: *** [all-gcc] Error 2 make: *** [all] Error 2
I haven't tried the testsuite yet.
Regards,
Adriaan van Os
Adriaan van Os wrote:
This results in:
<snip>
<tree_list 0x44018080 purpose <integer_cst 0x44018060 type <enumeral_type 0x434e28c0 Ioselectevents> constant invariant tree_5 1> value <integer_cst 0x44018060 1>>
That looks fine. I think I have identified the problem: get_set_constructor_bytes is missing the prototype. The following patch (will force full rebuild, for quick test one can add the prototype just to lang.c) should fix the problem:
--- gcc-4.1.0/gcc/tree.h.pp 2006-04-12 02:49:20.204667824 +0200 +++ gcc-4.1.0/gcc/tree.h 2006-04-12 02:49:23.218209696 +0200 @@ -3781,6 +3781,7 @@ extern unsigned crc32_string (unsigned, const char *); extern void clean_symbol_name (char *); extern tree get_file_function_name_long (const char *); +extern tree get_set_constructor_bytes (tree, unsigned char *, int); extern tree get_callee_fndecl (tree); extern void change_decl_assembler_name (tree, tree); extern int type_num_arguments (tree);
Waldek Hebisch wrote:
Adriaan van Os wrote:
This results in:
<snip> > <tree_list 0x44018080 > purpose <integer_cst 0x44018060 type <enumeral_type 0x434e28c0 Ioselectevents> constant > invariant tree_5 1> value <integer_cst 0x44018060 1>>
That looks fine. I think I have identified the problem: get_set_constructor_bytes is missing the prototype. The following patch (will force full rebuild, for quick test one can add the prototype just to lang.c) should fix the problem:
--- gcc-4.1.0/gcc/tree.h.pp 2006-04-12 02:49:20.204667824 +0200 +++ gcc-4.1.0/gcc/tree.h 2006-04-12 02:49:23.218209696 +0200 @@ -3781,6 +3781,7 @@ extern unsigned crc32_string (unsigned, const char *); extern void clean_symbol_name (char *); extern tree get_file_function_name_long (const char *); +extern tree get_set_constructor_bytes (tree, unsigned char *, int); extern tree get_callee_fndecl (tree); extern void change_decl_assembler_name (tree, tree); extern int type_num_arguments (tree);
Thanks, the patch gets me a step further
../.././xgpc -B../.././ -c -I. -W -Wall -Wmissing-prototypes -Wmissing-declarations -g -O2 --unit-path=/Users/adriaan/gpc/gpc-20060325/gcc-41/gcc-4.1.0/gcc/p/rts --automake -DRTS_RELEASE_STRING="'`cat /Users/adriaan/gpc/gpc-20060325/gcc-41/gcc-4.1.0/gcc/p/rts/rts-version`'" -DGCC_VERSION="''" "/Users/adriaan/gpc/gpc-20060325/gcc-41/gcc-4.1.0/gcc/p/rts/gpc.pas" /Users/adriaan/gpc/gpc-20060325/gcc-41/gcc-4.1.0/gcc/p/rts/gpc.pas:78: #error Trying to compile gpc.pas with a non-matching GPC version is likely to cause problems. In case you are building the RTS separately from GPC, make sure you install a current GPC version previously. If you are building GPC now and this message appears, something is wrong -- if you are overriding the GCC_FOR_TARGET or GPC_FOR_TARGET make variables, this might be the problem. If you are cross-building GPC, build and install a current GPC cross-compiler first, sorry. If that's not the case, please report it as a bug. If you are not building GPC or the RTS currently, you might have installed things in the wrong place, so the compiler and RTS versions do not match. make[3]: *** [gpc.o] Error 1 make[2]: *** [pascal.rts] Error 2 make[1]: *** [all-gcc] Error 2 make: *** [all] Error 2
This is solved by changing the version number in gcc/p/rts/gpc.pas at line 78.
Next problem is an error message
unknown spec-function `version-compare'
while compiling p/utils/binobj.pas with xgpc. The missing spec function is used in darwin.h in gcc-4.1. The problem is solved by the included patch. The diffs adds `version-compare' and (for completeness) also `replace-outfile' as spec-functions to gpc.c (both were added later to gcc.c).
Great, the compiler now builds !
[g5:gpc-20060325/gcc-41/build] adriaan% gpc -v Using built-in specs. Configured with: ../gcc-4.1.0/configure --enable-languages=c,pascal --enable-threads=posix --target=powerpc-apple-darwin8 --host=powerpc-apple-darwin8 --build=powerpc-apple-darwin8 --prefix=/Developer/Pascal/gpc410d1 Thread model: posix gpc version 20060325, based on gcc-4.1.0
One new feature that I noticed is that 64-bit gcc (multi)libs are automatically built. I will run the testsuite and report the results.
Regards,
Adriaan van Os