Re: [../../gpc/gcc-3.4.4/gcc/p/Make-lang.in:634 : p/declarations.o] Erreur 1

Waldek Hebisch <[email protected]> Mon, 1 Mar 2021 17:26:56 +0100
Newsgroups gmane.comp.compilers.gpc
Message-ID <[email protected]>
--1yeeQ81UyVL57Vl7
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

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.

-- 
                              Waldek Hebisch

--1yeeQ81UyVL57Vl7
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename="pp2.diff"

diff -ru ../cur2/gcc-3.4.6/gcc/Makefile.in gcc-3.4.6.pp2/gcc/Makefile.in
--- ../cur2/gcc-3.4.6/gcc/Makefile.in	2005-02-24 09:26:59.000000000 +0000
+++ gcc-3.4.6.pp2/gcc/Makefile.in	2020-05-15 16:58:19.414762304 +0000
@@ -2350,6 +2350,7 @@
   -DLOCAL_INCLUDE_DIR=\"$(local_includedir)\" \
   -DCROSS_INCLUDE_DIR=\"$(CROSS_SYSTEM_HEADER_DIR)\" \
   -DTOOL_INCLUDE_DIR=\"$(gcc_tooldir)/include\" \
+  -DTARGET_MACHINE=\"x86_64-linux-gnu\" \
   @TARGET_SYSTEM_ROOT_DEFINE@
 
 LIBCPP_OBJS =	cpplib.o cpplex.o cppmacro.o cppexp.o cppfiles.o cpptrad.o \
diff -ru ../cur2/gcc-3.4.6/gcc/config/linux.h gcc-3.4.6.pp2/gcc/config/linux.h
--- ../cur2/gcc-3.4.6/gcc/config/linux.h	2003-11-29 03:08:13.000000000 +0000
+++ gcc-3.4.6.pp2/gcc/config/linux.h	2020-05-15 17:02:19.730751731 +0000
@@ -48,12 +48,12 @@
    crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
 #elif defined HAVE_LD_PIE
 #define STARTFILE_SPEC \
-  "%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \
-   crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
+  "%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:/usr/lib/x86_64-linux-gnu/crt1.o%s}} \
+   /usr/lib/x86_64-linux-gnu/crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
 #else
 #define STARTFILE_SPEC \
-  "%{!shared: %{pg|p|profile:gcrt1.o%s;:crt1.o%s}} \
-   crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
+  "%{!shared: %{pg|p|profile:gcrt1.o%s;:/usr/lib/x86_64-linux-gnu/crt1.o%s}} \
+   /usr/lib/x86_64-linux-gnu/crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
 #endif
 
 /* Provide a ENDFILE_SPEC appropriate for GNU/Linux.  Here we tack on
@@ -64,7 +64,7 @@
 
 #undef	ENDFILE_SPEC
 #define ENDFILE_SPEC \
-  "%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
+  "%{shared|pie:crtendS.o%s;:crtend.o%s} /usr/lib/x86_64-linux-gnu/crtn.o%s"
 
 /* This is for -profile to use -lc_p instead of -lc.  */
 #ifndef CC1_SPEC
diff -ru ../cur2/gcc-3.4.6/gcc/cppdefault.c gcc-3.4.6.pp2/gcc/cppdefault.c
--- ../cur2/gcc-3.4.6/gcc/cppdefault.c	2003-03-01 14:31:21.000000000 +0000
+++ gcc-3.4.6.pp2/gcc/cppdefault.c	2020-05-15 16:58:19.286762310 +0000
@@ -29,6 +29,14 @@
 #define STANDARD_INCLUDE_DIR "/usr/include"
 #endif
 
+#ifndef MULTIARCH_STANDARD_INCLUDE_DIR
+#define MULTIARCH_STANDARD_INCLUDE_DIR STANDARD_INCLUDE_DIR "/" TARGET_MACHINE
+#endif
+
+#ifndef MULTIARCH_LOCAL_INCLUDE_DIR
+#define MULTIARCH_LOCAL_INCLUDE_DIR LOCAL_INCLUDE_DIR "/" TARGET_MACHINE
+#endif
+
 #ifndef STANDARD_INCLUDE_COMPONENT
 #define STANDARD_INCLUDE_COMPONENT 0
 #endif
@@ -62,6 +70,10 @@
     /* /usr/local/include comes before the fixincluded header files.  */
     { LOCAL_INCLUDE_DIR, 0, 0, 1, 1 },
 #endif
+#ifdef MULTIARCH_LOCAL_INCLUDE_DIR
+    /* /usr/local/include/$target_alias comes before the fixincluded header files.  */
+    { MULTIARCH_LOCAL_INCLUDE_DIR, 0, 0, 1, 1 },
+#endif
 #ifdef PREFIX_INCLUDE_DIR
     { PREFIX_INCLUDE_DIR, 0, 0, 1, 0 },
 #endif
@@ -81,6 +93,9 @@
     /* Some systems have an extra dir of include files.  */
     { SYSTEM_INCLUDE_DIR, 0, 0, 0, 1 },
 #endif
+#ifdef MULTIARCH_STANDARD_INCLUDE_DIR
+    { MULTIARCH_STANDARD_INCLUDE_DIR, STANDARD_INCLUDE_COMPONENT, 0, 0, 1 },
+#endif
 #ifdef STANDARD_INCLUDE_DIR
     /* /usr/include comes dead last.  */
     { STANDARD_INCLUDE_DIR, STANDARD_INCLUDE_COMPONENT, 0, 0, 1 },
diff -ru gcc-3.4.6.p1/gcc/unwind-dw2.c gcc-3.4.6.p2/gcc/unwind-dw2.c
--- gcc-3.4.6.p1/gcc/unwind-dw2.c	2021-03-01 15:47:17.184912026 +0100
+++ gcc-3.4.6.p2/gcc/unwind-dw2.c	2021-03-01 16:19:33.752959838 +0100
@@ -1027,7 +1027,8 @@
       /* Couldn't find frame unwind info for this function.  Try a
 	 target-specific fallback mechanism.  This will necessarily
 	 not provide a personality routine or LSDA.  */
-#ifdef MD_FALLBACK_FRAME_STATE_FOR
+#if 0
+/* #ifdef MD_FALLBACK_FRAME_STATE_FOR */
       MD_FALLBACK_FRAME_STATE_FOR (context, fs, success);
       return _URC_END_OF_STACK;
     success:
Only in gcc-3.4.6.p2/gcc: unwind-dw2.c~

--1yeeQ81UyVL57Vl7
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Gpc mailing list
[email protected]
https://www.g-n-u.de/mailman/listinfo/gpc

--1yeeQ81UyVL57Vl7--