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


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 via email to