Hi!
Just tried to compiled gpc.
Used http://www.gnu-pascal.de/alpha/gpc-20050331-minimal.tar.bz2
and http://www.gnu-pascal.de/alpha/gcc-core-3.4.4.tar.bz2
Using:
paul@jacko:~/gpc-build$ gcc --version
gcc (Ubuntu 10.2.0-13ubuntu1) 10.2.0
And got:
[...]
In file included from ../../gpc/gcc-3.4.4/gcc/p/declarations.c:29:
../../gpc/gcc-3.4.4/gcc/p/declarations.c: In function ‘pushdecl_import’:
../../gpc/gcc-3.4.4/gcc/p/gpc.h:68:68: warning: ISO C does not support ‘__PRETTY_FUNCTION__’ predefined identifier [-Wpedantic]
68 | ((void) ((expression) ? 0 : (assert_fail (#expression, __FILE__, __PRETTY_FUNCTION__, __LINE__), 0)))
| ^~~~~~~~~~~~~~~~~~~
../../gpc/gcc-3.4.4/gcc/p/declarations.c:1062:3: note: in expansion of macro ‘gcc_assert’
1062 | gcc_assert (!PASCAL_DECL_WEAK (x));
| ^~~~~~~~~~
../../gpc/gcc-3.4.4/gcc/p/declarations.c:1076:30: warning: comparison between ‘enum tree_code’ and ‘enum pascal_tree_code’ [-Wenum-compare]
1076 | if (old && TREE_CODE (old) == OPERATOR_DECL && TREE_CODE (x) == OPERATOR_DECL)
| ^~
../../gpc/gcc-3.4.4/gcc/p/declarations.c:1076:64: warning: comparison between ‘enum tree_code’ and ‘enum pascal_tree_code’ [-Wenum-compare]
1076 | if (old && TREE_CODE (old) == OPERATOR_DECL && TREE_CODE (x) == OPERATOR_DECL)
| ^~
In file included from ../../gpc/gcc-3.4.4/gcc/p/declarations.c:29:
../../gpc/gcc-3.4.4/gcc/p/declarations.c: In function ‘declare_label’:
../../gpc/gcc-3.4.4/gcc/p/gpc.h:68:68: warning: ISO C does not support ‘__PRETTY_FUNCTION__’ predefined identifier [-Wpedantic]
68 | ((void) ((expression) ? 0 : (assert_fail (#expression, __FILE__, __PRETTY_FUNCTION__, __LINE__), 0)))
| ^~~~~~~~~~~~~~~~~~~
../../gpc/gcc-3.4.4/gcc/p/declarations.c:1142:3: note: in expansion of macro ‘gcc_assert’
1142 | gcc_assert (!EM (label));
| ^~~~~~~~~~
../../gpc/gcc-3.4.4/gcc/p/declarations.c: In function ‘lookup_name’:
../../gpc/gcc-3.4.4/gcc/p/declarations.c:1324:31: warning: comparison between ‘enum tree_code’ and ‘enum pascal_tree_code’ [-Wenum-compare]
1324 | if (t && (TREE_CODE (t) == OPERATOR_DECL && PASCAL_BUILTIN_OPERATOR (t)))
| ^~
In file included from ../../gpc/gcc-3.4.4/gcc/p/declarations.c:29:
../../gpc/gcc-3.4.4/gcc/p/declarations.c: In function ‘get_unique_identifier’:
../../gpc/gcc-3.4.4/gcc/p/gpc.h:68:68: warning: ISO C does not support ‘__PRETTY_FUNCTION__’ predefined identifier [-Wpedantic]
68 | ((void) ((expression) ? 0 : (assert_fail (#expression, __FILE__, __PRETTY_FUNCTION__, __LINE__), 0)))
| ^~~~~~~~~~~~~~~~~~~
../../gpc/gcc-3.4.4/gcc/p/declarations.c:1490:3: note: in expansion of macro ‘gcc_assert’
1490 | gcc_assert (*template >= 'a' && *template <= 'z');
| ^~~~~~~~~~
../../gpc/gcc-3.4.4/gcc/p/declarations.c: In function ‘check_identifier’:
../../gpc/gcc-3.4.4/gcc/p/gpc.h:68:68: warning: ISO C does not support ‘__PRETTY_FUNCTION__’ predefined identifier [-Wpedantic]
68 | ((void) ((expression) ? 0 : (assert_fail (#expression, __FILE__, __PRETTY_FUNCTION__, __LINE__), 0)))
| ^~~~~~~~~~~~~~~~~~~
../../gpc/gcc-3.4.4/gcc/p/declarations.c:1557:7: note: in expansion of macro ‘gcc_assert’
1557 | gcc_assert (DECL_INITIAL (decl));
| ^~~~~~~~~~
../../gpc/gcc-3.4.4/gcc/p/declarations.c: In function ‘lookup_c_type’:
../../gpc/gcc-3.4.4/gcc/p/gpc.h:70:71: warning: ISO C does not support ‘__PRETTY_FUNCTION__’ predefined identifier [-Wpedantic]
70 | #define gcc_unreachable() (assert_fail ("unreachable code", __FILE__, __PRETTY_FUNCTION__, __LINE__))
| ^~~~~~~~~~~~~~~~~~~
../../gpc/gcc-3.4.4/gcc/p/declarations.c:1625:3: note: in expansion of macro ‘gcc_unreachable’
1625 | gcc_unreachable ();
| ^~~~~~~~~~~~~~~
../../gpc/gcc-3.4.4/gcc/p/declarations.c: In function ‘make_real’:
../../gpc/gcc-3.4.4/gcc/p/gpc.h:68:68: warning: ISO C does not support ‘__PRETTY_FUNCTION__’ predefined identifier [-Wpedantic]
68 | ((void) ((expression) ? 0 : (assert_fail (#expression, __FILE__, __PRETTY_FUNCTION__, __LINE__), 0)))
| ^~~~~~~~~~~~~~~~~~~
../../gpc/gcc-3.4.4/gcc/p/declarations.c:1636:3: note: in expansion of macro ‘gcc_assert’
1636 | gcc_assert (r > 0);
| ^~~~~~~~~~
../../gpc/gcc-3.4.4/gcc/p/gpc.h:68:68: warning: ISO C does not support ‘__PRETTY_FUNCTION__’ predefined identifier [-Wpedantic]
68 | ((void) ((expression) ? 0 : (assert_fail (#expression, __FILE__, __PRETTY_FUNCTION__, __LINE__), 0)))
| ^~~~~~~~~~~~~~~~~~~
../../gpc/gcc-3.4.4/gcc/p/declarations.c:1638:3: note: in expansion of macro ‘gcc_assert’
1638 | gcc_assert (TREE_TYPE (res) == double_type_node);
| ^~~~~~~~~~
../../gpc/gcc-3.4.4/gcc/p/declarations.c: In function ‘init_decl_processing’:
../../gpc/gcc-3.4.4/gcc/p/declarations.c:1816:3: error: ‘set_word_size’ undeclared (first use in this function); did you mean ‘set_mem_size’?
1816 | set_word_size = set_alignment = TYPE_PRECISION (long_unsigned_type_node);
| ^~~~~~~~~~~~~
| set_mem_size
../../gpc/gcc-3.4.4/gcc/p/declarations.c:1816:3: note: each undeclared identifier is reported only once for each function it appears in
../../gpc/gcc-3.4.4/gcc/p/declarations.c:1817:3: error: ‘set_words_big_endian’ undeclared (first use in this function)
1817 | set_words_big_endian = 0;
| ^~~~~~~~~~~~~~~~~~~~
In file included from ../../gpc/gcc-3.4.4/gcc/p/declarations.c:29:
../../gpc/gcc-3.4.4/gcc/p/declarations.c: In function ‘find_duplicate_fields’:
../../gpc/gcc-3.4.4/gcc/p/gpc.h:68:68: warning: ISO C does not support ‘__PRETTY_FUNCTION__’ predefined identifier [-Wpedantic]
68 | ((void) ((expression) ? 0 : (assert_fail (#expression, __FILE__, __PRETTY_FUNCTION__, __LINE__), 0)))
| ^~~~~~~~~~~~~~~~~~~
../../gpc/gcc-3.4.4/gcc/p/declarations.c:2082:9: note: in expansion of macro ‘gcc_assert’
2082 | gcc_assert (dup);
| ^~~~~~~~~~
../../gpc/gcc-3.4.4/gcc/p/declarations.c: In function ‘declare_routine’:
../../gpc/gcc-3.4.4/gcc/p/gpc.h:68:68: warning: ISO C does not support ‘__PRETTY_FUNCTION__’ predefined identifier [-Wpedantic]
68 | ((void) ((expression) ? 0 : (assert_fail (#expression, __FILE__, __PRETTY_FUNCTION__, __LINE__), 0)))
| ^~~~~~~~~~~~~~~~~~~
../../gpc/gcc-3.4.4/gcc/p/declarations.c:2419:3: note: in expansion of macro ‘gcc_assert’
2419 | gcc_assert (!EM (d));
| ^~~~~~~~~~
../../gpc/gcc-3.4.4/gcc/p/declarations.c: In function ‘build_operator_heading’:
../../gpc/gcc-3.4.4/gcc/p/declarations.c:2530:34: warning: implicit conversion from ‘enum pascal_tree_code’ to ‘enum tree_code’ [-Wenum-conversion]
2530 | placeholder_decl = build_decl (OPERATOR_DECL, name, void_type_node);
| ^~~~~~~~~~~~~
In file included from ../../gpc/gcc-3.4.4/gcc/p/declarations.c:29:
../../gpc/gcc-3.4.4/gcc/p/declarations.c: In function ‘start_routine’:
../../gpc/gcc-3.4.4/gcc/p/gpc.h:68:68: warning: ISO C does not support ‘__PRETTY_FUNCTION__’ predefined identifier [-Wpedantic]
68 | ((void) ((expression) ? 0 : (assert_fail (#expression, __FILE__, __PRETTY_FUNCTION__, __LINE__), 0)))
| ^~~~~~~~~~~~~~~~~~~
../../gpc/gcc-3.4.4/gcc/p/declarations.c:2714:9: note: in expansion of macro ‘gcc_assert’
2714 | gcc_assert (IDENTIFIER_IS_BUILT_IN (TREE_VALUE (dir), p_attribute));
| ^~~~~~~~~~
../../gpc/gcc-3.4.4/gcc/p/gpc.h:68:68: warning: ISO C does not support ‘__PRETTY_FUNCTION__’ predefined identifier [-Wpedantic]
68 | ((void) ((expression) ? 0 : (assert_fail (#expression, __FILE__, __PRETTY_FUNCTION__, __LINE__), 0)))
| ^~~~~~~~~~~~~~~~~~~
../../gpc/gcc-3.4.4/gcc/p/declarations.c:2753:3: note: in expansion of macro ‘gcc_assert’
2753 | gcc_assert (!EM (decl));
| ^~~~~~~~~~
../../gpc/gcc-3.4.4/gcc/p/gpc.h:68:68: warning: ISO C does not support ‘__PRETTY_FUNCTION__’ predefined identifier [-Wpedantic]
68 | ((void) ((expression) ? 0 : (assert_fail (#expression, __FILE__, __PRETTY_FUNCTION__, __LINE__), 0)))
| ^~~~~~~~~~~~~~~~~~~
../../gpc/gcc-3.4.4/gcc/p/declarations.c:2798:7: note: in expansion of macro ‘gcc_assert’
2798 | gcc_assert (!DECL_RTL_SET_P (parm));
| ^~~~~~~~~~
../../gpc/gcc-3.4.4/gcc/p/gpc.h:68:68: warning: ISO C does not support ‘__PRETTY_FUNCTION__’ predefined identifier [-Wpedantic]
68 | ((void) ((expression) ? 0 : (assert_fail (#expression, __FILE__, __PRETTY_FUNCTION__, __LINE__), 0)))
| ^~~~~~~~~~~~~~~~~~~
../../gpc/gcc-3.4.4/gcc/p/declarations.c:2824:5: note: in expansion of macro ‘gcc_assert’
2824 | gcc_assert (!resvar);
| ^~~~~~~~~~
../../gpc/gcc-3.4.4/gcc/p/gpc.h:68:68: warning: ISO C does not support ‘__PRETTY_FUNCTION__’ predefined identifier [-Wpedantic]
68 | ((void) ((expression) ? 0 : (assert_fail (#expression, __FILE__, __PRETTY_FUNCTION__, __LINE__), 0)))
| ^~~~~~~~~~~~~~~~~~~
../../gpc/gcc-3.4.4/gcc/p/declarations.c:2851:11: note: in expansion of macro ‘gcc_assert’
2851 | gcc_assert (TREE_CODE (v) == COMPONENT_REF);
| ^~~~~~~~~~
../../gpc/gcc-3.4.4/gcc/p/declarations.c: In function ‘finish_routine’:
../../gpc/gcc-3.4.4/gcc/p/gpc.h:74:101: warning: right-hand operand of comma expression has no effect [-Wunused-value]
74 | #define abort_confused() (error ("confused by previous errors, bailing out"), exit (FATAL_EXIT_CODE), 0)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
../../gpc/gcc-3.4.4/gcc/p/declarations.c:2952:5: note: in expansion of macro ‘abort_confused’
2952 | abort_confused ();
| ^~~~~~~~~~~~~~
../../gpc/gcc-3.4.4/gcc/p/declarations.c: In function ‘declare_types’:
../../gpc/gcc-3.4.4/gcc/p/gpc.h:68:68: warning: ISO C does not support ‘__PRETTY_FUNCTION__’ predefined identifier [-Wpedantic]
68 | ((void) ((expression) ? 0 : (assert_fail (#expression, __FILE__, __PRETTY_FUNCTION__, __LINE__), 0)))
| ^~~~~~~~~~~~~~~~~~~
../../gpc/gcc-3.4.4/gcc/p/declarations.c:3110:9: note: in expansion of macro ‘gcc_assert’
3110 | gcc_assert (!EM (decl));
| ^~~~~~~~~~
../../gpc/gcc-3.4.4/gcc/p/declarations.c: In function ‘shadow_one_level’:
../../gpc/gcc-3.4.4/gcc/p/gpc.h:68:68: warning: ISO C does not support ‘__PRETTY_FUNCTION__’ predefined identifier [-Wpedantic]
68 | ((void) ((expression) ? 0 : (assert_fail (#expression, __FILE__, __PRETTY_FUNCTION__, __LINE__), 0)))
| ^~~~~~~~~~~~~~~~~~~
../../gpc/gcc-3.4.4/gcc/p/declarations.c:3129:3: note: in expansion of macro ‘gcc_assert’
3129 | gcc_assert (TYPE_SIZE (TREE_TYPE (element)) && !PASCAL_TYPE_UNDISCRIMINATED_SCHEMA (TREE_TYPE (element)));
| ^~~~~~~~~~
../../gpc/gcc-3.4.4/gcc/p/declarations.c: In function ‘declare_variables’:
../../gpc/gcc-3.4.4/gcc/p/gpc.h:68:68: warning: ISO C does not support ‘__PRETTY_FUNCTION__’ predefined identifier [-Wpedantic]
68 | ((void) ((expression) ? 0 : (assert_fail (#expression, __FILE__, __PRETTY_FUNCTION__, __LINE__), 0)))
| ^~~~~~~~~~~~~~~~~~~
../../gpc/gcc-3.4.4/gcc/p/declarations.c:3451:11: note: in expansion of macro ‘gcc_assert’
3451 | gcc_assert (!init);
| ^~~~~~~~~~
../../gpc/gcc-3.4.4/gcc/p/gpc.h:68:68: warning: ISO C does not support ‘__PRETTY_FUNCTION__’ predefined identifier [-Wpedantic]
68 | ((void) ((expression) ? 0 : (assert_fail (#expression, __FILE__, __PRETTY_FUNCTION__, __LINE__), 0)))
| ^~~~~~~~~~~~~~~~~~~
../../gpc/gcc-3.4.4/gcc/p/declarations.c:3578:7: note: in expansion of macro ‘gcc_assert’
3578 | gcc_assert (!EM (d));
| ^~~~~~~~~~
../../gpc/gcc-3.4.4/gcc/p/declarations.c: In function ‘new_string_by_model’:
../../gpc/gcc-3.4.4/gcc/p/gpc.h:68:68: warning: ISO C does not support ‘__PRETTY_FUNCTION__’ predefined identifier [-Wpedantic]
68 | ((void) ((expression) ? 0 : (assert_fail (#expression, __FILE__, __PRETTY_FUNCTION__, __LINE__), 0)))
| ^~~~~~~~~~~~~~~~~~~
../../gpc/gcc-3.4.4/gcc/p/declarations.c:3659:7: note: in expansion of macro ‘gcc_assert’
3659 | gcc_assert (isstring);
| ^~~~~~~~~~
make[1]: *** [../../gpc/gcc-3.4.4/gcc/p/Make-lang.in:634 : p/declarations.o] Erreur 1
make[1] : on quitte le répertoire « /home/paul/gpc-build/gcc »
make: *** [Makefile:23375 : all-gcc] Erreur 2
paul@jacko:~/gpc-build$
So isstring is undefined?
On Sun, Feb 28, 2021 at 01:37:20PM -0500, Paul Dufresne wrote:
Hi!
Just tried to compiled gpc.
Used http://www.gnu-pascal.de/alpha/gpc-20050331-minimal.tar.bz2
That is old version. Current one is at github:
https://github.com/hebisch/gpc
Using:
paul@jacko:~/gpc-build$ gcc --version
gcc (Ubuntu 10.2.0-13ubuntu1) 10.2.0
I did not try using gcc-10 for build.
That is old version. Current one is at github: https://github.com/hebisch/gpc
Is there any chance that this would work on macOS?
Tom
Thomas D. Schneider, Ph.D. Senior Investigator National Institutes of Health National Cancer Institute Center for Cancer Research RNA Biology Laboratory Biological Information Theory Group Frederick, Maryland 21702-1201 schneidt@mail.nih.gov https://alum.mit.edu/www/toms
On Sun, Feb 28, 2021 at 05:45:21PM -0500, Thomas Schneider wrote:
That is old version. Current one is at github: https://github.com/hebisch/gpc
Is there any chance that this would work on macOS?
Porobably no. gpc can only use realtively old backends, and macOS broke them. Somebody would have to provide patches to adapt old gcc backend to macOS or adapt gpc to new backend. Also, even in best gpc times building on macOS was tricky.
---- Le dim., 28 févr. 2021 17:11:48 -0500 Waldek Hebisch hebisch@math.uni.wroc.pl écrit ----
That is old version. Current one is at github: https://github.com/hebisch/gpc
Yeah... I seems to get the same errors with your version as the one I had downloaded priorly.
And I get errors with compiling such old gcc with the version 10 of gcc. I could easily try version 9.
With which newer version of gcc you build the gpc+older gcc?
On Sun, Feb 28, 2021 at 06:22:05PM -0500, Paul Dufresne wrote:
---- Le dim., 28 f=C3=A9vr. 2021 17:11:48 -0500 Waldek Hebisch <hebisch@mat= h.uni.wroc.pl> =C3=A9crit ----
=20 That is old version. Current one is at github:=20 https://github.com/hebisch/gpc=20 =20
Yeah... I seems to get the same errors with your version as the one I had = downloaded priorly.
And I get errors with compiling such old gcc with the version 10 of gcc. I could easily try version 9.
With which newer version of gcc you build the gpc+older gcc?
My development machine runs Debian 8. System gcc is version 4.9. Gpc builds and works using gcc-3.4.6 as a backend. I also build on Debian 9 with 8.3.0 as system compiler, but ATM I am not sure if all needed changes are at github.
On Sun, Feb 28, 2021 at 06:22:05PM -0500, Paul Dufresne wrote:
---- Le dim., 28 f=C3=A9vr. 2021 17:11:48 -0500 Waldek Hebisch <hebisch@mat= h.uni.wroc.pl> =C3=A9crit ----
=20 That is old version. Current one is at github:=20 https://github.com/hebisch/gpc=20 =20
Yeah... I seems to get the same errors with your version as the one I had = downloaded priorly.
And I get errors with compiling such old gcc with the version 10 of gcc. I could easily try version 9.
With which newer version of gcc you build the gpc+older gcc?
To build on Debian 10 using gcc-8.3 I needed attached patch. This patch is not included in github repository because it hardcodes paths to a few critical system files (if those files are in different place on your machine, then you need to change the patch). Change to 'unwind-dw2.c' is really crude hack disabling offending code. AFAIK offending code is only used by Java and C++ and only as fallback when normal handling does not work, so loss should be minimal.
To build: 1) put content of gpc repository and upacked gcc-3.4.6 in in parallel directories 2) create a symlink from 'gcc-3.4.6/gcc' to 'p' subdirectory from gpc repository so that the 'p' subdirectory is visible as 'gcc-3.4.6/gcc/p' like:
cd gcc-3.4.6/gcc ln -s ../../gpc/p p
3) from 'gcc-3.4.6/gcc' apply backend patch like
patch -p1 < p/diffs/gcc-3.4.4.diff
4) from 'gcc-3.4.6' directory apply attached patch, like
cd .. patch -p1 < ../pp2.diff
5) create build directory and cd to it
cd .. mkdir gpc-build cd gpc-build
6) configure and make
../gcc-3.4.6/configure --enable-languages=c,pascal --disable-multilib > clogg 2>&1 make > mlogg 2>&1
Note: that creates 'gpc' that is prepared to be installed in '/usr/local/bin'.
Many choices above are non-critical. However, it is critical that both backend patches are applied (and wrong command may lead to skipped patch). Also '--disable-multilib' is critical.