I am trying to build with the most recent of gcc that I found that still use gcc-core:
ftp://gnu.mirror.iweb.com/gcc/gcc-4.6.4/gcc-core-4.6.4.tar.bz2
ftp://gcc.gnu.org/pub/gcc/infrastructure/gmp-4.3.2.tar.bz2
ftp://gcc.gnu.org/pub/gcc/infrastructure/mpfr-2.4.2.tar.bz2
ftp://gcc.gnu.org/pub/gcc/infrastructure/mpc-0.8.1.tar.gz
But I get:
[...]
| ^~~~~~~~~~
gengtype-lex.c: In function ‘yylex’:
gengtype-lex.c:364:15: warning: this statement may fall through [-Wimplicit-fallthrough=]
/home/jakub/gcc-4.6.4/gcc-4.6.4/gcc/gengtype-lex.l:130:1: note: in expansion of macro ‘YY_DO_BEFORE_ACTION’
/home/jakub/gcc-4.6.4/gcc-4.6.4/gcc/gengtype-lex.l:127:1: note: here
gcc -c -g -fkeep-inline-functions -DIN_GCC -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Wold-style-definition -Wc++-compat -fno-common -DHAVE_CONFIG_H -DGENERATOR_FILE -I. -Ibuild -I../../gpc2/gcc-4.6.4/gcc -I../../gpc2/gcc-4.6.4/gcc/build -I../../gpc2/gcc-4.6.4/gcc/../include -I../../gpc2/gcc-4.6.4/gcc/../libcpp/include -I../../gpc2/gcc-4.6.4/gcc/../libdecnumber -I../../gpc2/gcc-4.6.4/gcc/../libdecnumber/bid -I../libdecnumber \
-o build/gengtype-parse.o ../../gpc2/gcc-4.6.4/gcc/gengtype-parse.c
In file included from ../../gpc2/gcc-4.6.4/gcc/gengtype-parse.c:21:
../../gpc2/gcc-4.6.4/gcc/gengtype.h: In function ‘set_lang_bitmap’:
../../gpc2/gcc-4.6.4/gcc/system.h:636:55: warning: ISO C does not support ‘__FUNCTION__’ predefined identifier [-Wpedantic]
636 | ((void)(!(EXPR) ? fancy_abort (__FILE__, __LINE__, __FUNCTION__), 0 : 0))
| ^~~~~~~~~~~~
../../gpc2/gcc-4.6.4/gcc/gengtype.h:101:3: note: in expansion of macro ‘gcc_assert’
101 | gcc_assert (inpf);
| ^~~~~~~~~~
../../gpc2/gcc-4.6.4/gcc/gengtype-parse.c: In function ‘typedef_decl’:
../../gpc2/gcc-4.6.4/gcc/system.h:636:55: warning: ISO C does not support ‘__FUNCTION__’ predefined identifier [-Wpedantic]
636 | ((void)(!(EXPR) ? fancy_abort (__FILE__, __LINE__, __FUNCTION__), 0 : 0))
| ^~~~~~~~~~~~
../../gpc2/gcc-4.6.4/gcc/gengtype-parse.c:820:3: note: in expansion of macro ‘gcc_assert’
820 | gcc_assert (token () == TYPEDEF);
| ^~~~~~~~~~
gcc -c -g -fkeep-inline-functions -DIN_GCC -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Wold-style-definition -Wc++-compat -fno-common -DHAVE_CONFIG_H -DGENERATOR_FILE -I. -Ibuild -I../../gpc2/gcc-4.6.4/gcc -I../../gpc2/gcc-4.6.4/gcc/build -I../../gpc2/gcc-4.6.4/gcc/../include -I../../gpc2/gcc-4.6.4/gcc/../libcpp/include -I../../gpc2/gcc-4.6.4/gcc/../libdecnumber -I../../gpc2/gcc-4.6.4/gcc/../libdecnumber/bid -I../libdecnumber \
-o build/gengtype-state.o ../../gpc2/gcc-4.6.4/gcc/gengtype-state.c
In file included from ../../gpc2/gcc-4.6.4/gcc/gengtype-state.c:27:
../../gpc2/gcc-4.6.4/gcc/gengtype.h: In function ‘set_lang_bitmap’:
../../gpc2/gcc-4.6.4/gcc/system.h:636:55: warning: ISO C does not support ‘__FUNCTION__’ predefined identifier [-Wpedantic]
636 | ((void)(!(EXPR) ? fancy_abort (__FILE__, __LINE__, __FUNCTION__), 0 : 0))
| ^~~~~~~~~~~~
../../gpc2/gcc-4.6.4/gcc/gengtype.h:101:3: note: in expansion of macro ‘gcc_assert’
101 | gcc_assert (inpf);
| ^~~~~~~~~~
../../gpc2/gcc-4.6.4/gcc/gengtype-state.c: In function ‘type_lineloc’:
../../gpc2/gcc-4.6.4/gcc/system.h:656:61: warning: ISO C does not support ‘__FUNCTION__’ predefined identifier [-Wpedantic]
656 | #define gcc_unreachable() (fancy_abort (__FILE__, __LINE__, __FUNCTION__))
| ^~~~~~~~~~~~
../../gpc2/gcc-4.6.4/gcc/gengtype-state.c:46:7: note: in expansion of macro ‘gcc_unreachable’
46 | gcc_unreachable ();
| ^~~~~~~~~~~~~~~
../../gpc2/gcc-4.6.4/gcc/system.h:656:61: warning: ISO C does not support ‘__FUNCTION__’ predefined identifier [-Wpedantic]
656 | #define gcc_unreachable() (fancy_abort (__FILE__, __LINE__, __FUNCTION__))
| ^~~~~~~~~~~~
../../gpc2/gcc-4.6.4/gcc/gengtype-state.c:59:7: note: in expansion of macro ‘gcc_unreachable’
59 | gcc_unreachable ();
| ^~~~~~~~~~~~~~~
../../gpc2/gcc-4.6.4/gcc/gengtype-state.c: In function ‘write_state_fileloc’:
../../gpc2/gcc-4.6.4/gcc/system.h:636:55: warning: ISO C does not support ‘__FUNCTION__’ predefined identifier [-Wpedantic]
636 | ((void)(!(EXPR) ? fancy_abort (__FILE__, __LINE__, __FUNCTION__), 0 : 0))
| ^~~~~~~~~~~~
../../gpc2/gcc-4.6.4/gcc/gengtype-state.c:556:7: note: in expansion of macro ‘gcc_assert’
556 | gcc_assert (floc->file != NULL);
| ^~~~~~~~~~
../../gpc2/gcc-4.6.4/gcc/gengtype-state.c: In function ‘write_state_fields’:
../../gpc2/gcc-4.6.4/gcc/system.h:636:55: warning: ISO C does not support ‘__FUNCTION__’ predefined identifier [-Wpedantic]
636 | ((void)(!(EXPR) ? fancy_abort (__FILE__, __LINE__, __FUNCTION__), 0 : 0))
| ^~~~~~~~~~~~
../../gpc2/gcc-4.6.4/gcc/gengtype-state.c:585:3: note: in expansion of macro ‘gcc_assert’
585 | gcc_assert (nbpairs == nbfields);
| ^~~~~~~~~~
../../gpc2/gcc-4.6.4/gcc/gengtype-state.c: In function ‘write_state_lang_struct_type’:
../../gpc2/gcc-4.6.4/gcc/system.h:636:55: warning: ISO C does not support ‘__FUNCTION__’ predefined identifier [-Wpedantic]
636 | ((void)(!(EXPR) ? fancy_abort (__FILE__, __LINE__, __FUNCTION__), 0 : 0))
| ^~~~~~~~~~~~
../../gpc2/gcc-4.6.4/gcc/gengtype-state.c:827:7: note: in expansion of macro ‘gcc_assert’
827 | gcc_assert (UNION_OR_STRUCT_P (hty));
| ^~~~~~~~~~
../../gpc2/gcc-4.6.4/gcc/system.h:636:55: warning: ISO C does not support ‘__FUNCTION__’ predefined identifier [-Wpedantic]
636 | ((void)(!(EXPR) ? fancy_abort (__FILE__, __LINE__, __FUNCTION__), 0 : 0))
| ^~~~~~~~~~~~
../../gpc2/gcc-4.6.4/gcc/gengtype-state.c:828:7: note: in expansion of macro ‘gcc_assert’
828 | gcc_assert (hty->u.s.lang_struct == current);
| ^~~~~~~~~~
../../gpc2/gcc-4.6.4/gcc/system.h:636:55: warning: ISO C does not support ‘__FUNCTION__’ predefined identifier [-Wpedantic]
636 | ((void)(!(EXPR) ? fancy_abort (__FILE__, __LINE__, __FUNCTION__), 0 : 0))
| ^~~~~~~~~~~~
../../gpc2/gcc-4.6.4/gcc/gengtype-state.c:831:7: note: in expansion of macro ‘gcc_assert’
831 | gcc_assert (strcmp (homoname, hty->u.s.tag) == 0);
| ^~~~~~~~~~
../../gpc2/gcc-4.6.4/gcc/gengtype-state.c: In function ‘write_state_gc_used’:
../../gpc2/gcc-4.6.4/gcc/system.h:656:61: warning: ISO C does not support ‘__FUNCTION__’ predefined identifier [-Wpedantic]
656 | #define gcc_unreachable() (fancy_abort (__FILE__, __LINE__, __FUNCTION__))
| ^~~~~~~~~~~~
../../gpc2/gcc-4.6.4/gcc/gengtype-state.c:901:7: note: in expansion of macro ‘gcc_unreachable’
901 | gcc_unreachable ();
| ^~~~~~~~~~~~~~~
../../gpc2/gcc-4.6.4/gcc/gengtype-state.c: In function ‘write_state_typedefs’:
../../gpc2/gcc-4.6.4/gcc/system.h:636:55: warning: ISO C does not support ‘__FUNCTION__’ predefined identifier [-Wpedantic]
636 | ((void)(!(EXPR) ? fancy_abort (__FILE__, __LINE__, __FUNCTION__), 0 : 0))
| ^~~~~~~~~~~~
../../gpc2/gcc-4.6.4/gcc/gengtype-state.c:1030:3: note: in expansion of macro ‘gcc_assert’
1030 | gcc_assert (nbpairs == nbtypedefs);
| ^~~~~~~~~~
../../gpc2/gcc-4.6.4/gcc/gengtype-state.c: In function ‘write_state_variables’:
../../gpc2/gcc-4.6.4/gcc/system.h:636:55: warning: ISO C does not support ‘__FUNCTION__’ predefined identifier [-Wpedantic]
636 | ((void)(!(EXPR) ? fancy_abort (__FILE__, __LINE__, __FUNCTION__), 0 : 0))
| ^~~~~~~~~~~~
../../gpc2/gcc-4.6.4/gcc/gengtype-state.c:1082:3: note: in expansion of macro ‘gcc_assert’
1082 | gcc_assert (nbpairs == nbvars);
| ^~~~~~~~~~
../../gpc2/gcc-4.6.4/gcc/gengtype-state.c: In function ‘record_type’:
../../gpc2/gcc-4.6.4/gcc/system.h:636:55: warning: ISO C does not support ‘__FUNCTION__’ predefined identifier [-Wpedantic]
636 | ((void)(!(EXPR) ? fancy_abort (__FILE__, __LINE__, __FUNCTION__), 0 : 0))
| ^~~~~~~~~~~~
../../gpc2/gcc-4.6.4/gcc/gengtype-state.c:1249:3: note: in expansion of macro ‘gcc_assert’
1249 | gcc_assert (slot);
| ^~~~~~~~~~
../../gpc2/gcc-4.6.4/gcc/gengtype-state.c: In function ‘read_state_fileloc’:
../../gpc2/gcc-4.6.4/gcc/system.h:636:55: warning: ISO C does not support ‘__FUNCTION__’ predefined identifier [-Wpedantic]
636 | ((void)(!(EXPR) ? fancy_abort (__FILE__, __LINE__, __FUNCTION__), 0 : 0))
| ^~~~~~~~~~~~
../../gpc2/gcc-4.6.4/gcc/gengtype-state.c:1683:3: note: in expansion of macro ‘gcc_assert’
1683 | gcc_assert (floc != NULL);
| ^~~~~~~~~~
../../gpc2/gcc-4.6.4/gcc/system.h:636:55: warning: ISO C does not support ‘__FUNCTION__’ predefined identifier [-Wpedantic]
636 | ((void)(!(EXPR) ? fancy_abort (__FILE__, __LINE__, __FUNCTION__), 0 : 0))
| ^~~~~~~~~~~~
../../gpc2/gcc-4.6.4/gcc/gengtype-state.c:1684:3: note: in expansion of macro ‘gcc_assert’
1684 | gcc_assert (srcdir != NULL);
| ^~~~~~~~~~
../../gpc2/gcc-4.6.4/gcc/gengtype-state.c: In function ‘read_state_files_list’:
../../gpc2/gcc-4.6.4/gcc/gengtype-state.c:2344:34: warning: comparison of constant ‘4’ with boolean expression is always false [-Wbool-compare]
2344 | if (!state_token_kind (t0) == STOK_RIGHTPAR)
| ^~
../../gpc2/gcc-4.6.4/gcc/gengtype-state.c:2344:34: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses]
../../gpc2/gcc-4.6.4/gcc/gengtype-state.c:2344:11: note: add parentheses around left hand side expression to silence this warning
2344 | if (!state_token_kind (t0) == STOK_RIGHTPAR)
| ^~~~~~~~~~~~~~~~~~~~~~
| ( )
gcc -c -g -fkeep-inline-functions -DIN_GCC -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Wold-style-definition -Wc++-compat -fno-common -DHAVE_CONFIG_H -DGENERATOR_FILE -I. -Ibuild -I../../gpc2/gcc-4.6.4/gcc -I../../gpc2/gcc-4.6.4/gcc/build -I../../gpc2/gcc-4.6.4/gcc/../include -I../../gpc2/gcc-4.6.4/gcc/../libcpp/include -I../../gpc2/gcc-4.6.4/gcc/../libdecnumber -I../../gpc2/gcc-4.6.4/gcc/../libdecnumber/bid -I../libdecnumber \
-DBASEVER=""4.6.4"" -DDATESTAMP="""" \
-DREVISION="""" \
-DDEVPHASE="""" -DPKGVERSION=""(GCC) "" \
-DBUGURL=""http://gcc.gnu.org/bugs.html"" -o build/version.o ../../gpc2/gcc-4.6.4/gcc/version.c
gcc -g -fkeep-inline-functions -DIN_GCC -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Wold-style-definition -Wc++-compat -fno-common -DHAVE_CONFIG_H -DGENERATOR_FILE -o build/gengtype \
build/gengtype.o build/errors.o build/gengtype-lex.o build/gengtype-parse.o build/gengtype-state.o build/version.o ../build-x86_64-unknown-linux-gnu/libiberty/libiberty.a
/bin/bash ../../gpc2/gcc-4.6.4/gcc/../move-if-change tmp-gi.list gtyp-input.list
echo timestamp > s-gtyp-input
build/gengtype \
-S ../../gpc2/gcc-4.6.4/gcc -I gtyp-input.list -w gtype.state
../../gpc2/gcc-4.6.4/gcc/p/gpc.h:210: parse error: GTY must be specified before identifier
../../gpc2/gcc-4.6.4/gcc/p/gpc.h:222: parse error: GTY must be specified before identifier
../../gpc2/gcc-4.6.4/gcc/p/gpc.h:277: parse error: GTY must be specified before identifier
../../gpc2/gcc-4.6.4/gcc/p/gpc.h:295: parse error: GTY must be specified before identifier
../../gpc2/gcc-4.6.4/gcc/p/gpc.h:309: parse error: GTY must be specified before identifier
../../gpc2/gcc-4.6.4/gcc/p/gpc.h:518: parse error: GTY must be specified before identifier
../../gpc2/gcc-4.6.4/gcc/p/gpc.h:598: parse error: GTY must be specified before identifier
../../gpc2/gcc-4.6.4/gcc/p/gpc.h:841: parse error: GTY must be specified before identifier
../../gpc2/gcc-4.6.4/gcc/p/gpc.h:1439: parse error: GTY must be specified before identifier
../../gpc2/gcc-4.6.4/gcc/p/declarations.c:171: parse error: GTY must be specified before identifier
../../gpc2/gcc-4.6.4/gcc/p/declarations.c:3673: parse error: GTY must be specified before identifier
../../gpc2/gcc-4.6.4/gcc/p/module.c:285: parse error: GTY must be specified before identifier
make[3]: *** [Makefile:3825 : s-gtype] Erreur 1
make[3] : on quitte le répertoire « /home/paul/gpc-build2/gcc »
make[2]: *** [Makefile:5498 : all-stage1-gcc] Erreur 2
make[2] : on quitte le répertoire « /home/paul/gpc-build2 »
make[1]: *** [Makefile:19609 : stage1-bubble] Erreur 2
make[1] : on quitte le répertoire « /home/paul/gpc-build2 »
make: *** [Makefile:877 : all] Erreur 2
paul@jacko:~/gpc-build2$
After fixing those errors (not knowing what I do but obeying to the compiler) I get:
GENERATOR_FILE -o build/genpreds \
build/genpreds.o build/rtl.o build/read-rtl.o build/ggc-none.o build/vec.o build/min-insn-modes.o build/gensupport.o build/print-rtl.o build/read-md.o build/errors.o ../build-x86_64-unknown-linux-gnu/libiberty/libiberty.a
build/genpreds -h ../../gpc2/gcc-4.6.4/gcc/config/i386/i386.md > tmp-preds.h
/bin/bash ../../gpc2/gcc-4.6.4/gcc/../move-if-change tmp-preds.h tm-preds.h
echo timestamp > s-preds-h
rm -f tmp-all-tree.def
echo '#include "tree.def"' > tmp-all-tree.def
echo 'END_OF_BASE_TREE_CODES' >> tmp-all-tree.def
echo '#include "c-family/c-common.def"' >> tmp-all-tree.def
ltf="../../gpc2/gcc-4.6.4/gcc/p/p-tree.def"; for f in $ltf; do \
echo "#include "$f""; \
done | sed 's|../../gpc2/gcc-4.6.4/gcc/||' >> tmp-all-tree.def
/bin/bash ../../gpc2/gcc-4.6.4/gcc/../move-if-change tmp-all-tree.def all-tree.def
echo timestamp > s-alltree
gcc -c -g -DIN_GCC -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wc++-compat -fno-common -DHAVE_CONFIG_H -DGENERATOR_FILE -I. -Ibuild -I../../gpc2/gcc-4.6.4/gcc -I../../gpc2/gcc-4.6.4/gcc/build -I../../gpc2/gcc-4.6.4/gcc/../include -I../../gpc2/gcc-4.6.4/gcc/../libcpp/include -I../../gpc2/gcc-4.6.4/gcc/../libdecnumber -I../../gpc2/gcc-4.6.4/gcc/../libdecnumber/bid -I../libdecnumber \
-o build/gencheck.o ../../gpc2/gcc-4.6.4/gcc/gencheck.c
gcc -g -DIN_GCC -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wc++-compat -fno-common -DHAVE_CONFIG_H -DGENERATOR_FILE -o build/gencheck \
build/gencheck.o ../build-x86_64-unknown-linux-gnu/libiberty/libiberty.a
build/gencheck > tmp-check.h
/bin/bash ../../gpc2/gcc-4.6.4/gcc/../move-if-change tmp-check.h tree-check.h
echo timestamp > s-check
build/genpreds -c ../../gpc2/gcc-4.6.4/gcc/config/i386/i386.md > tmp-constrs.h
/bin/bash ../../gpc2/gcc-4.6.4/gcc/../move-if-change tmp-constrs.h tm-constrs.h
echo timestamp > s-constrs-h
gcc -c -g -DIN_GCC -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wc++-compat -fno-common -DHAVE_CONFIG_H -DGENERATOR_FILE -I. -Ibuild -I../../gpc2/gcc-4.6.4/gcc -I../../gpc2/gcc-4.6.4/gcc/build -I../../gpc2/gcc-4.6.4/gcc/../include -I../../gpc2/gcc-4.6.4/gcc/../libcpp/include -I../../gpc2/gcc-4.6.4/gcc/../libdecnumber -I../../gpc2/gcc-4.6.4/gcc/../libdecnumber/bid -I../libdecnumber \
-o build/gencondmd.o build/gencondmd.c
In file included from ../../gpc2/gcc-4.6.4/gcc/function.h:25,
from build/gencondmd.c:25:
../../gpc2/gcc-4.6.4/gcc/p/p-tree.def:43:14: error: redeclaration of enumerator ‘NAMESPACE_DECL’
43 | DEFTREECODE (NAMESPACE_DECL, "namespace_decl", "d", 0)
| ^~~~~~~~~~~~~~
../../gpc2/gcc-4.6.4/gcc/tree.h:39:49: note: in definition of macro ‘DEFTREECODE’
39 | #define DEFTREECODE(SYM, STRING, TYPE, NARGS) SYM,
| ^~~
../../gpc2/gcc-4.6.4/gcc/tree.def:363:14: note: previous definition of ‘NAMESPACE_DECL’ was here
363 | DEFTREECODE (NAMESPACE_DECL, "namespace_decl", tcc_declaration, 0)
| ^~~~~~~~~~~~~~
../../gpc2/gcc-4.6.4/gcc/tree.h:39:49: note: in definition of macro ‘DEFTREECODE’
39 | #define DEFTREECODE(SYM, STRING, TYPE, NARGS) SYM,
| ^~~
In file included from ../../gpc2/gcc-4.6.4/gcc/function.h:25,
from build/gencondmd.c:25:
../../gpc2/gcc-4.6.4/gcc/tree.h:3130:11: warning: identifier ‘thread_local’ conflicts with C++ keyword [-Wc++-compat]
3130 | unsigned thread_local : 1;
| ^~~~~~~~~~~~
In file included from build/gencondmd.c:33:
../../gpc2/gcc-4.6.4/gcc/recog.h:287:5: warning: this use of "defined" may not be portable [-Wexpansion-to-defined]
287 | #if HAVE_DESIGNATED_INITIALIZERS
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
make[3]: *** [Makefile:3847 : build/gencondmd.o] Erreur 1
make[3] : on quitte le répertoire « /home/paul/gpc-build2/gcc »
make[2]: *** [Makefile:5498 : all-stage1-gcc] Erreur 2
make[2] : on quitte le répertoire « /home/paul/gpc-build2 »
make[1]: *** [Makefile:19609 : stage1-bubble] Erreur 2
make[1] : on quitte le répertoire « /home/paul/gpc-build2 »
make: *** [Makefile:877 : all] Erreur 2
paul@jacko:~/gpc-build2$
=========================================================================
paul@jacko:~/gpc2/gcc-4.6.4/gcc/p$ diff -u gpc.h.orig gpc.h
--- gpc.h.orig 2021-02-28 15:12:28.881046603 -0500
+++ gpc.h 2021-02-28 15:25:41.684525601 -0500
@@ -206,7 +206,7 @@
often the same). */
#define PERMANENT_STRING(S) (IDENTIFIER_POINTER (get_identifier (S)))
-struct tree_inn GTY(())
+struct GTY(()) tree_inn
{
struct tree_common common;
struct interface_table_t * GTY((skip(""))) table;
@@ -218,7 +218,7 @@
typedef enum { IMPORT_USES, IMPORT_QUALIFIED, IMPORT_ISO } import_type;
-struct tree_import GTY(())
+struct GTY(()) tree_import
{
struct tree_common common;
gpi_int qualified;
@@ -273,7 +273,7 @@
#define KW_WEAK 32
#define KW_INFORMED 64
-struct predef GTY(())
+struct GTY(()) predef
{
const char *idname;
const char *rts_idname;
@@ -291,7 +291,7 @@
#define PD_ACTIVE(PD) ((PD) && (PD)->user_disabled < (!co->pascal_dialect || (co->pascal_dialect & (PD)->dialect)))
/* Language-dependent contents of an identifier. */
-struct lang_identifier GTY(())
+GTY(()) struct lang_identifier
{
struct tree_identifier ignore;
tree value;
@@ -303,12 +303,12 @@
int spelling_column;
};
-union lang_tree_node
- GTY((desc ("((TREE_CODE (&%h.generic) == IDENTIFIER_NODE) || (TREE_CODE (&%h.generic) == INTERFACE_NAME_NODE) || (TREE_CODE (&%h.generic) == IMPORT_NODE)) ? TREE_CODE (&%h.generic) : 0"),
+union GTY(()) lang_tree_node
+ ((desc ("((TREE_CODE (&%h.generic) == IDENTIFIER_NODE) || (TREE_CODE (&%h.generic) == INTERFACE_NAME_NODE) || (TREE_CODE (&%h.generic) == IMPORT_NODE)) ? TREE_CODE (&%h.generic) : 0"),
chain_next ("(union lang_tree_node *) TREE_CHAIN (&%h.generic)")))
{
union tree_node GTY ((tag ("0"), desc ("tree_node_structure (&%h)"))) generic;
- struct lang_identifier GTY ((tag ("IDENTIFIER_NODE"))) identifier;
+ struct GTY(()) lang_identifier ((tag ("IDENTIFIER_NODE"))) identifier;
struct tree_inn GTY ((tag ("INTERFACE_NAME_NODE"))) interface;
struct tree_import GTY ((tag ("IMPORT_NODE"))) import;
};
@@ -514,7 +514,7 @@
(see EP 6.10.2). Used in CONST_DECL nodes. */
#define PASCAL_CST_PRINCIPAL_ID(decl) DECL_LANG_FLAG_7 (decl)
-struct lang_decl GTY(())
+struct GTY(()) lang_decl
{
tree info1;
tree info2;
@@ -594,7 +594,7 @@
/* Set if the variants of a record have initializers. Used in RECORD_TYPE nodes. */
#define PASCAL_TYPE_INITIALIZER_VARIANTS(type) TYPE_LANG_FLAG_5 (type)
-struct lang_type GTY(())
+struct GTY(()) lang_type
{
int code;
tree info;
@@ -837,7 +837,7 @@
/* options.c */
-typedef struct string_list GTY(())
+typedef struct GTY(()) string_list
{
struct string_list *next;
char *string;
@@ -1435,7 +1435,7 @@
typedef enum { LF_UNIT, LF_COMPILED_UNIT, LF_OBJECT, LF_COMPILED_OBJECT } locate_file_t;
#define MODULE_T_FIRST_TREE_FIELD imports
-struct module GTY(())
+struct GTY(())module
{
tree imports; /* TREE_LIST of IMPORT_NODEs of imported interfaces for this module. */
tree exports; /* TREE_LIST of interfaces exported from this module
paul@jacko:~/gpc2/gcc-4.6.4/gcc/p$
==========================================================================================
paul@jacko:~/gpc2/gcc-4.6.4/gcc/p$ diff -u declarations.c.orig declarations.c
--- declarations.c.orig 2021-02-28 15:12:42.077046333 -0500
+++ declarations.c 2021-02-28 15:27:17.724422309 -0500
@@ -167,7 +167,7 @@
for the main level of statements.
- one (transparent) for each structured statement, see pushlevel_expand */
-struct binding_level GTY(())
+struct GTY(()) binding_level
{
/* A chain of declarations. These are in the reverse of the order supplied. */
tree names;
@@ -3669,7 +3669,7 @@
}
#ifdef GCC_3_3
-struct language_function GTY(())
+struct GTY(()) language_function
{
int unused;
};
paul@jacko:~/gpc2/gcc-4.6.4/gcc/p$
===================================================================================
paul@jacko:~/gpc2/gcc-4.6.4/gcc/p$ diff -u module.c.orig module.c
--- module.c.orig 2021-02-28 15:12:50.693045920 -0500
+++ module.c 2021-02-28 15:28:06.812307424 -0500
@@ -281,7 +281,7 @@
/* A table holding the nodes imported from all GPI files
together with their UIDs, so duplicates can be identified. */
-struct interface_table_t GTY(())
+struct GTY(()) interface_table_t
{
tree interface_name;
tree module_name;
paul@jacko:~/gpc2/gcc-4.6.4/gcc/p$
=================================================================
On Sun, Feb 28, 2021 at 03:37:50PM -0500, Paul Dufresne wrote:
I am trying to build with the most recent of gcc that I found that still use gcc-core:
ftp://gnu.mirror.iweb.com/gcc/gcc-4.6.4/gcc-core-4.6.4.tar.bz2
See README at
https://github.com/hebisch/gpc
To have any chance to build gpc you need a patch to gcc. Using gcc-core is irrelevant: it just saves download time compared to full gcc. It matters is gpc was adapted (ported) to given gcc backend.
Concerning your first message: most gpc build problem are in fact gcc build problems. Namely, building older gcc versions (needed by gpc) is getting tricky on modern systems. So as first step you may try just building old gcc (say 3.4.6 or 4.1.1). gpc contains patches for some build problems, but new ones appear...
Been building https://codeload.github.com/hebisch/gpc/zip/master with:
ftp://ftp.gnu.org/gnu/gcc/gcc-3.4.6/gcc-core-3.4.6.tar.bz2
I am getting:
gcc -g -O2 -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long -DHAVE_CONFIG_H -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long -pedantic -Wno-long-long -Wno-traditional -I. -I. -I../../gpc1/gcc-3.4.6/gcc -I../../gpc1/gcc-3.4.6/gcc/. -I../../gpc1/gcc-3.4.6/gcc/../include -DGPC -DGPC_UNITS_DIR="/usr/local/lib/gcc/x86_64-unknown-linux-gnu/3.4.6/units" -I../../gpc1/gcc-3.4.6/gcc/p -o gpc1 p/parse.o p/declarations.o p/expressions.o p/gpc-lex.o p/lang.o p/module.o p/objects.o p/options.o p/predef.o p/statements.o p/typecheck.o p/types.o p/convert.o p/dbxout.o p/dwarf2out.o p/expr.o p/fold-const.o p/function.o p/integrate.o p/optabs.o p/stor-layout.o p/toplev.o p/tree.o p/stmt.o p/emit-rtl.o p/varasm.o p/version.o p/gpcpp.o p/plant.o p/diagnostic.o attribs.o main.o libbackend.a ../libiberty/libiberty.a ../libiberty/libiberty.a
/home/paul/opt/GNAT/2020/bin/../libexec/gcc/x86_64-pc-linux-gnu/9.3.1/ld: ../libiberty/libiberty.a(choose-temp.o): in function `choose_temp_base':
/home/paul/gpc1-build/libiberty/../../gpc1/gcc-3.4.6/libiberty/choose-temp.c:68: warning: the use of `mktemp' is dangerous, better use `mkstemp' or `mkdtemp'
(SHLIB_LINK='/home/paul/gpc1-build/gcc/xgcc -B/home/paul/gpc1-build/gcc/ -B/usr/local/x86_64-unknown-linux-gnu/bin/ -B/usr/local/x86_64-unknown-linux-gnu/lib/ -isystem /usr/local/x86_64-unknown-linux-gnu/include -isystem /usr/local/x86_64-unknown-linux-gnu/sys-include -O2 -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wno-error -isystem ./include -fPIC -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -shared -nodefaultlibs -Wl,--soname=@shlib_so_name@.so.1 -Wl,--version-script=@shlib_map_file@ -o @shlib_dir@@shlib_so_name@.so.1.tmp @multilib_flags@ @shlib_objs@ -lc && rm -f @shlib_base_name@.so && if [ -f @shlib_dir@@shlib_so_name@.so.1 ]; then mv -f @shlib_dir@@shlib_so_name@.so.1 @shlib_dir@@shlib_so_name@.so.1.backup; else true; fi && mv @shlib_dir@@shlib_so_name@.so.1.tmp @shlib_dir@@shlib_so_name@.so.1 && ln -s @shlib_dir@@shlib_so_name@.so.1 @shlib_base_name@.so' \
SHLIB_MULTILIB=''; \
gcc -g -O2 -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long -Wno-error -DHAVE_CONFIG_H -I. -I. -I../../gpc1/gcc-3.4.6/gcc -I../../gpc1/gcc-3.4.6/gcc/. -I../../gpc1/gcc-3.4.6/gcc/../include \
-DSTANDARD_STARTFILE_PREFIX="../../../" -DSTANDARD_EXEC_PREFIX="/usr/local/lib/gcc/" -DSTANDARD_LIBEXEC_PREFIX="/usr/local/libexec/gcc/" -DDEFAULT_TARGET_VERSION="3.4.6" -DDEFAULT_TARGET_MACHINE="x86_64-unknown-linux-gnu" -DSTANDARD_BINDIR_PREFIX="/usr/local/bin/" -DTOOLDIR_BASE_PREFIX="../../../../" `test "X${SHLIB_LINK}" = "X" || test "yes" != "yes" || echo "-DENABLE_SHARED_LIBGCC"` `test "X${SHLIB_MULTILIB}" = "X" || echo "-DNO_SHARED_LIBGCC_MULTILIB"` \
-c ../../gpc1/gcc-3.4.6/gcc/gcc.c -o gcc.o)
../../gpc1/gcc-3.4.6/gcc/gcc.c: In function 'do_spec_1':
../../gpc1/gcc-3.4.6/gcc/gcc.c:5118:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
5118 | error ("warning: use of obsolete %%[ operator in specs");
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../gpc1/gcc-3.4.6/gcc/gcc.c:5119:4: note: here
5119 | case '(':
| ^~~~
(SHLIB_LINK='/home/paul/gpc1-build/gcc/xgcc -B/home/paul/gpc1-build/gcc/ -B/usr/local/x86_64-unknown-linux-gnu/bin/ -B/usr/local/x86_64-unknown-linux-gnu/lib/ -isystem /usr/local/x86_64-unknown-linux-gnu/include -isystem /usr/local/x86_64-unknown-linux-gnu/sys-include -O2 -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -fPIC -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -shared -nodefaultlibs -Wl,--soname=@shlib_so_name@.so.1 -Wl,--version-script=@shlib_map_file@ -o @shlib_dir@@shlib_so_name@.so.1.tmp @multilib_flags@ @shlib_objs@ -lc && rm -f @shlib_base_name@.so && if [ -f @shlib_dir@@shlib_so_name@.so.1 ]; then mv -f @shlib_dir@@shlib_so_name@.so.1 @shlib_dir@@shlib_so_name@.so.1.backup; else true; fi && mv @shlib_dir@@shlib_so_name@.so.1.tmp @shlib_dir@@shlib_so_name@.so.1 && ln -s @shlib_dir@@shlib_so_name@.so.1 @shlib_base_name@.so' \
SHLIB_MULTILIB=''; \
gcc -g -O2 -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long -DHAVE_CONFIG_H -I. -I. -I../../gpc1/gcc-3.4.6/gcc -I../../gpc1/gcc-3.4.6/gcc/. -I../../gpc1/gcc-3.4.6/gcc/../include \
-DSTANDARD_STARTFILE_PREFIX="../../../" -DSTANDARD_EXEC_PREFIX="/usr/local/lib/gcc/" -DSTANDARD_LIBEXEC_PREFIX="/usr/local/libexec/gcc/" -DDEFAULT_TARGET_VERSION="3.4.6" -DDEFAULT_TARGET_MACHINE="x86_64-unknown-linux-gnu" -DSTANDARD_BINDIR_PREFIX="/usr/local/bin/" -DTOOLDIR_BASE_PREFIX="../../../../" `test "X${SHLIB_LINK}" = "X" || test "yes" != "yes" || echo "-DENABLE_SHARED_LIBGCC"` `test "X${SHLIB_MULTILIB}" = "X" || echo "-DNO_SHARED_LIBGCC_MULTILIB"` \
-c ../../gpc1/gcc-3.4.6/gcc/gccspec.c -o gccspec.o)
gcc -g -O2 -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long -DHAVE_CONFIG_H -o xgcc gcc.o gccspec.o intl.o \
prefix.o version.o ../libiberty/libiberty.a
/home/paul/gpc1-build/gcc/xgcc -B/home/paul/gpc1-build/gcc/ -B/usr/local/x86_64-unknown-linux-gnu/bin/ -B/usr/local/x86_64-unknown-linux-gnu/lib/ -isystem /usr/local/x86_64-unknown-linux-gnu/include -isystem /usr/local/x86_64-unknown-linux-gnu/sys-include -dumpspecs > tmp-specs
mv tmp-specs specs
cd ../../gpc1/gcc-3.4.6/gcc/p/rts && make -f Makefile.in srcdir=. GCC_VERSION="3.4.6" SHELL="/bin/sh" CFLAGS="-g -O2" PFLAGS="" AR_FLAGS="rc" RTSFLAGS="" GPC_DESTDIR="../.." AR="ar" RANLIB="ranlib" RANLIB_TEST="" generated-files
make[2] : on entre dans le répertoire « /home/paul/gpc1/gcc-3.4.6/gcc/p/rts »
make[2]: rien à faire pour « generated-files ».
make[2] : on quitte le répertoire « /home/paul/gpc1/gcc-3.4.6/gcc/p/rts »
cd ../../gpc1/gcc-3.4.6/gcc/p/rts && make -f Makefile.in srcdir=. GCC_VERSION="3.4.6" SHELL="/bin/sh" CFLAGS="-g -O2" PFLAGS="" AR_FLAGS="rc" RTSFLAGS="" GPC_DESTDIR="../.." AR="ar" RANLIB="ranlib" RANLIB_TEST="" generated-files
make[2] : on entre dans le répertoire « /home/paul/gpc1/gcc-3.4.6/gcc/p/rts »
make[2]: rien à faire pour « generated-files ».
make[2] : on quitte le répertoire « /home/paul/gpc1/gcc-3.4.6/gcc/p/rts »
cd ../../gpc1/gcc-3.4.6/gcc/p/rts && make -f Makefile.in srcdir=. GCC_VERSION="3.4.6" SHELL="/bin/sh" CFLAGS="-g -O2" PFLAGS="" AR_FLAGS="rc" RTSFLAGS="" GPC_DESTDIR="../.." AR="ar" RANLIB="ranlib" RANLIB_TEST="" generated-files
make[2] : on entre dans le répertoire « /home/paul/gpc1/gcc-3.4.6/gcc/p/rts »
make[2]: rien à faire pour « generated-files ».
make[2] : on quitte le répertoire « /home/paul/gpc1/gcc-3.4.6/gcc/p/rts »
cd ../../gpc1/gcc-3.4.6/gcc/p/rts && make -f Makefile.in srcdir=. GCC_VERSION="3.4.6" SHELL="/bin/sh" CFLAGS="-g -O2" PFLAGS="" AR_FLAGS="rc" RTSFLAGS="" GPC_DESTDIR="../.." AR="ar" RANLIB="ranlib" RANLIB_TEST="" generated-files
make[2] : on entre dans le répertoire « /home/paul/gpc1/gcc-3.4.6/gcc/p/rts »
make[2]: rien à faire pour « generated-files ».
make[2] : on quitte le répertoire « /home/paul/gpc1/gcc-3.4.6/gcc/p/rts »
cd ../../gpc1/gcc-3.4.6/gcc/p/rts && make -f Makefile.in srcdir=. GCC_VERSION="3.4.6" SHELL="/bin/sh" CFLAGS="-g -O2" PFLAGS="" AR_FLAGS="rc" RTSFLAGS="" GPC_DESTDIR="../.." AR="ar" RANLIB="ranlib" RANLIB_TEST="" generated-files
make[2] : on entre dans le répertoire « /home/paul/gpc1/gcc-3.4.6/gcc/p/rts »
make[2]: rien à faire pour « generated-files ».
make[2] : on quitte le répertoire « /home/paul/gpc1/gcc-3.4.6/gcc/p/rts »
[ -d "../../gpc1/gcc-3.4.6/gcc/p/doc/info" ] || ../../gpc1/gcc-3.4.6/gcc/p/script/mkdir-p "../../gpc1/gcc-3.4.6/gcc/p/doc/info"
LANG=hr_HR LC_ALL=hr_HR makeinfo --split-size=5000000 -I ../../gpc1/gcc-3.4.6/gcc/p/doc -I ../../gpc1/gcc-3.4.6/gcc/p/doc/hr -I ../../gpc1/gcc-3.4.6/gcc/p/doc/generated -I ../../gpc1/gcc-3.4.6/gcc/p/doc/en -o ../../gpc1/gcc-3.4.6/gcc/p/doc/info/gpc-hr.info \
../../gpc1/gcc-3.4.6/gcc/p/doc/hr/gpc.texi
utf8 "\xE8" does not map to Unicode at /usr/share/texinfo/Texinfo/ParserNonXS.pm line 1796, <FH> line 3.
Malformed UTF-8 character: \xe8\x6e\x69 (unexpected non-continuation byte 0x6e, immediately after start byte 0xe8; need 3 bytes, got 1) in pattern match (m//) at /usr/share/texinfo/Texinfo/ParserNonXS.pm line 3364.
Malformed UTF-8 character (fatal) at /usr/share/texinfo/Texinfo/ParserNonXS.pm line 3364.
make[1]: *** [../../gpc1/gcc-3.4.6/gcc/p/Make-lang.in:844 : ../../gpc1/gcc-3.4.6/gcc/p/doc/info/gpc-hr.info] Erreur 25
make[1] : on quitte le répertoire « /home/paul/gpc1-build/gcc »
make: *** [Makefile:23375 : all-gcc] Erreur 2
paul@jacko:~/gpc1-build$
At first I had tought it was because I did not have hr locale, but I did "sudo dpkg-reconfigure locales" where I included hr locales.
On Fri, Mar 05, 2021 at 11:21:30PM -0500, Paul Dufresne wrote:
Been building https://codeload.github.com/hebisch/gpc/zip/master with:
ftp://ftp.gnu.org/gnu/gcc/gcc-3.4.6/gcc-core-3.4.6.tar.bz2
<snip>
LANG=hr_HR LC_ALL=hr_HR makeinfo --split-size=5000000?? -I ../../gpc1/gcc-3.4.6/gcc/p/doc -I ../../gpc1/gcc-3.4.6/gcc/p/doc/hr -I ../../gpc1/gcc-3.4.6/gcc/p/doc/generated -I ../../gpc1/gcc-3.4.6/gcc/p/doc/en -o ../../gpc1/gcc-3.4.6/gcc/p/doc/info/gpc-hr.info \
?????????????????? ../../gpc1/gcc-3.4.6/gcc/p/doc/hr/gpc.texi
utf8 "\xE8" does not map to Unicode at /usr/share/texinfo/Texinfo/ParserNonXS.pm line 1796, <FH> line 3.
Malformed UTF-8 character: \xe8\x6e\x69 (unexpected non-continuation byte 0x6e, immediately after start byte 0xe8; need 3 bytes, got 1) in pattern match (m//) at /usr/share/texinfo/Texinfo/ParserNonXS.pm line 3364.
Malformed UTF-8 character (fatal) at /usr/share/texinfo/Texinfo/ParserNonXS.pm line 3364.
<snip>
At first I had tought it was because I did not have hr locale, but I did "sudo dpkg-reconfigure locales" where I included hr locales.
GPC documentation was written using 8-bit codepages. At time were the files we written (and even now) on some (many???) systems documentation utilities worked only in 8-bit mode. Apparenly your system defaults everything to UTF-8. One workaround could be to try to modify
LANG=hr_HR LC_ALL=hr_HR
into something like:
LANG=hr_HR.ISO-8859-2 LC_ALL=hr_HR.ISO-8859-2
I do not know which ISO codepage is correct for hr.
Or just disable documentation build (configure tests for version of makeinfo, changing test one can disable documentation build).
Checking if documentation build works can be done by testing corresponding commands by hand (that can save a lot of time compared to repeated compilation of everthing).
I have fixed it with:
paul@jacko:~/gpc1/gcc-3.4.6/gcc$ diff -u ../../gpc-master/p/doc/hr/gpc.texi p/doc/hr/gpc.texi
--- ../../gpc-master/p/doc/hr/gpc.texi 2017-01-06 17:56:28.000000000 -0500
+++ p/doc/hr/gpc.texi 2021-03-06 07:33:22.993693828 -0500
@@ -1,9 +1,9 @@
\input texinfo
+@documentencoding iso-8859-2
@setfilename gpc-hr.info
@settitle GNU Pascal priru�nik.
@c We use Latin 2 charset for hr_HR language.
@set charset iso-8859-2
-@documentencoding iso-8859-2
@c Copyright (C) 1996-2006 Free Software Foundation, Inc.
@c This file is part of the GPC Manual.
paul@jacko:~/gpc1/gcc-3.4.6/gcc$
paul@jacko:~/gpc1/gcc-3.4.6/gcc$ diff -u ../../gpc-master/p/doc/es/gpcs.texi p/doc/es/gpcs.texi
--- ../../gpc-master/p/doc/es/gpcs.texi 2017-01-06 17:56:28.000000000 -0500
+++ p/doc/es/gpcs.texi 2021-03-06 07:58:40.895455259 -0500
@@ -1,7 +1,7 @@
\input texinfo
@setfilename gpcs.info
-@settitle Est�ndar de Codificaci�n GNU Pascal
@documentencoding iso-8859-1
+@settitle Est�ndar de Codificaci�n GNU Pascal
@c Copyright (C) 2001-2006 Free Software Foundation, Inc.
@c
paul@jacko:~/gpc1/gcc-3.4.6/gcc$