public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
To: Gaius Mulley <gaiusmod2@gmail.com>
Cc: Gaius Mulley via Gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: Modula-2: merge followup (brief update on the progress of the new linking implementation)
Date: Mon, 11 Jul 2022 22:36:54 +0200	[thread overview]
Message-ID: <yddk08j9yjd.fsf@CeBiTec.Uni-Bielefeld.DE> (raw)
In-Reply-To: <87o7xv4rjg.fsf@debian> (Gaius Mulley's message of "Mon, 11 Jul 2022 16:06:59 +0100")

[-- Attachment #1: Type: text/plain, Size: 4023 bytes --]

Hi Gaius,

> thanks for the report - the first bug report (above) is now fixed on
> devel/modula-2.

thanks, that got me closer, but not quite there yet:

* First, I get:

/vol/gcc/src/hg/master/modula-2/gcc/m2/gm2-libs-min/SYSTEM.mod:29:1: error: In implementation module 'SYSTEM': module 'M2RTS' does not export procedure 'RequestDependant'
/vol/gcc/src/hg/master/modula-2/libgm2/libm2min/../../gcc/m2/gm2-libs-min/M2RTS.mod:29:1: error: In implementation module 'M2RTS': module 'M2RTS' does not export procedure 'RegisterModule'
/vol/gcc/src/hg/master/modula-2/libgm2/libm2min/../../gcc/m2/gm2-libs-min/SYSTEM.mod:29:1: error: In implementation module 'SYSTEM': module 'M2RTS' does not export procedure 'RequestDependant'

  Fixed by adding dummy declarations/definitions as in the attached patch.

* Then, I run into

make[9]: Entering directory '/var/gcc/modula-2/11.4-gcc-modula-2/i386-pc-solaris2.11/amd64/libgm2/libm2pim'
Makefile:913: warning: ignoring prerequisites on suffix rule definition
make[9]: *** No rule to make target 'UnixArgs.c', needed by 'libm2pim_la-UnixArgs.lo'.
make[9]: *** No rule to make target 'Selective.c', needed by 'libm2pim_la-Selective.lo'.
make[9]: *** No rule to make target 'sckt.c', needed by 'libm2pim_la-sckt.lo'.
make[9]: *** No rule to make target 'errno.c', needed by 'libm2pim_la-errno.lo'.
make[9]: *** No rule to make target 'dtoa.c', needed by 'libm2pim_la-dtoa.lo'.
make[9]: *** No rule to make target 'ldtoa.c', needed by 'libm2pim_la-ldtoa.lo'.
make[9]: *** No rule to make target 'termios.c', needed by 'libm2pim_la-termios.lo'.
make[9]: *** No rule to make target 'SysExceptions.c', needed by 'libm2pim_la-SysExceptions.lo'.
make[9]: Target 'all-am' not remade because of errors.
make[9]: Leaving directory '/var/gcc/modula-2/11.4-gcc-modula-2/i386-pc-solaris2.11/amd64/libgm2/libm2pim'

  It turns out none of the generated auto* files had been regenerated in
  tree; fixed by running autoconf; autoheader; automake.

* Next, on Solaris only:

/vol/gcc/src/hg/master/modula-2/libgm2/libm2pim/dtoa.cc: In function 'int dtoa_calcmaxsig(char*, int)':
/vol/gcc/src/hg/master/modula-2/libgm2/libm2pim/dtoa.cc:139:7: error: 'index' was not declared in this scope; did you mean 'index_t'?
  139 |   e = index (p, 'E');
      |       ^~~~~
      |       index_t
/vol/gcc/src/hg/master/modula-2/libgm2/libm2pim/dtoa.cc: In function 'int dtoa_calcdecimal(char*, int, int)':
/vol/gcc/src/hg/master/modula-2/libgm2/libm2pim/dtoa.cc:171:7: error: 'index' was not declared in this scope; did you mean 'index_t'?
  171 |   e = index (p, 'E');
      |       ^~~~~
      |       index_t

  While index is declared in <strings.h>, the declaration is guarded by
  !_XPG7 || __EXTENSIONS__, but g++ defines _XPG7/_XOPEN_SOURCE=700 on
  Solaris.  I think it's better to just use the standard strchr instead,
  as the attached patch does.

* While this lets the build finish on all of i386-pc-solaris2.11,
  sparcv9-sun-solaris2.11, and x86_64-pc-linux-gnu, I get thousands of
  testsuite failures, all of the same kind:

Undefined                       first referenced
 symbol                             in file
RTco_signal                         /var/gcc/modula-2/11.4-gcc-modula-2/i386-pc-solaris2.11/./libgm2/libm2pim/.libs/libm2pim.so
RTco_select                         /var/gcc/modula-2/11.4-gcc-modula-2/i386-pc-solaris2.11/./libgm2/libm2pim/.libs/libm2pim.so
RTco_initSemaphore                  /var/gcc/modula-2/11.4-gcc-modula-2/i386-pc-solaris2.11/./libgm2/libm2pim/.libs/libm2pim.so
RTco_wait                           /var/gcc/modula-2/11.4-gcc-modula-2/i386-pc-solaris2.11/./libgm2/libm2pim/.libs/libm2pim.so
ld: fatal: symbol referencing errors
collect2: error: ld returned 1 exit status
compiler exited with status 1
FAIL: gm2/exceptions/run/pass/libexcept.mod compilation,  -g

  I haven't yet tried to fix those.

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: m2link.patch --]
[-- Type: text/x-patch, Size: 1897 bytes --]

diff --git a/gcc/m2/gm2-libs-min/M2RTS.def b/gcc/m2/gm2-libs-min/M2RTS.def
--- a/gcc/m2/gm2-libs-min/M2RTS.def
+++ b/gcc/m2/gm2-libs-min/M2RTS.def
@@ -31,11 +31,17 @@ DEFINITION MODULE M2RTS ;
 
 FROM SYSTEM IMPORT ADDRESS ;
 
+TYPE
+   ArgCVEnvP = PROCEDURE (INTEGER, ADDRESS, ADDRESS) ;
 
 (*
    all these procedures do nothing except satisfy the linker.
 *)
 
+PROCEDURE RegisterModule (name: ADDRESS;
+                          init, fini:  ArgCVEnvP;
+                          dependencies: PROC) ;
+PROCEDURE RequestDependant (modulename, dependantmodule: ADDRESS) ;
 PROCEDURE ExecuteTerminationProcedures ;
 PROCEDURE ExecuteInitialProcedures ;
 PROCEDURE HALT ;
diff --git a/gcc/m2/gm2-libs-min/M2RTS.mod b/gcc/m2/gm2-libs-min/M2RTS.mod
--- a/gcc/m2/gm2-libs-min/M2RTS.mod
+++ b/gcc/m2/gm2-libs-min/M2RTS.mod
@@ -70,4 +70,10 @@ BEGIN
 END DeconstructModules ;
 
 
+PROCEDURE RegisterModule (name: ADDRESS;
+                          init, fini:  ArgCVEnvP;
+                          dependencies: PROC) ;
+BEGIN
+END RegisterModule ;
+
 END M2RTS.
diff --git a/libgm2/libm2pim/dtoa.cc b/libgm2/libm2pim/dtoa.cc
--- a/libgm2/libm2pim/dtoa.cc
+++ b/libgm2/libm2pim/dtoa.cc
@@ -136,7 +136,7 @@ dtoa_calcmaxsig (char *p, int ndigits)
   char *o;
   int x;
 
-  e = index (p, 'E');
+  e = strchr (p, 'E');
   if (e == NULL)
     x = 0;
   else
@@ -145,7 +145,7 @@ dtoa_calcmaxsig (char *p, int ndigits)
       x = atoi (e + 1);
     }
 
-  o = index (p, '.');
+  o = strchr (p, '.');
   if (o == NULL)
     return strlen (p) + x;
   else
@@ -168,7 +168,7 @@ dtoa_calcdecimal (char *p, int str_size,
   int x;
   int l;
 
-  e = index (p, 'E');
+  e = strchr (p, 'E');
   if (e == NULL)
     x = 0;
   else
@@ -178,7 +178,7 @@ dtoa_calcdecimal (char *p, int str_size,
     }
 
   l = strlen (p);
-  o = index (p, '.');
+  o = strchr (p, '.');
   if (o == NULL)
     x += strlen (p);
   else

  reply	other threads:[~2022-07-11 20:36 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-09 10:31 Gaius Mulley
2022-07-11  8:21 ` Rainer Orth
2022-07-11 11:14   ` Rainer Orth
2022-07-11 15:06   ` Gaius Mulley
2022-07-11 20:36     ` Rainer Orth [this message]
2022-07-12 12:32       ` Gaius Mulley
2022-07-12 14:16         ` Rainer Orth
2022-07-25  9:42           ` Gaius Mulley
2022-07-26  7:45             ` Rainer Orth
2022-08-30 11:03 ` Gaius Mulley
2022-08-30 12:44   ` Martin Liška
2022-08-30 15:36     ` Gaius Mulley
2022-08-31  9:54       ` Martin Liška
2022-08-31 13:19         ` Gaius Mulley
2022-08-31 13:25           ` Martin Liška
2022-09-01 12:22             ` Gaius Mulley
2022-09-07 12:29             ` Martin Liška
2022-09-08 15:52               ` Gaius Mulley
2022-09-09 12:16                 ` Martin Liška
2022-09-09 15:40                   ` Gaius Mulley
  -- strict thread matches above, loose matches on Subject: below --
2022-06-11 19:15 Gaius Mulley
2022-06-17 17:08 ` Gaius Mulley
2022-06-17 19:02   ` Richard Biener
2022-06-27  7:24     ` Gaius Mulley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=yddk08j9yjd.fsf@CeBiTec.Uni-Bielefeld.DE \
    --to=ro@cebitec.uni-bielefeld.de \
    --cc=gaiusmod2@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).