The prototype of memmem in flower/include/libc-extension.hh doesn't
match its invocations elsewhere, since Byte and `char' aren't
compatible types.  I've changed it to use `void' instead of `Byte'.

lily/GNUmakefile has some incorrect dependencies for main.o

A couple of files failed to compile on alpha platforms, with gcc
2.95.1, apparently because of bug in handling functions that don't
return (i.e., marked with __atribute__ ((__noreturn__))).  I've
managed to work around the problems by introducing a kludge, that will
only be enabled on the affected platforms.  Hopefully this problem
will be fixed in gcc 2.95.2.

Here's the patch for these problems.  Please note that there are
additional problems described after the patch, for which I don't have
fixes.

--- flower/include/libc-extension.hh~	Wed Sep  1 21:17:49 1999
+++ flower/include/libc-extension.hh	Sat Sep  4 05:38:37 1999
@@ -19,8 +19,8 @@
 char* strnupr (char* start_l, int n);
 
 #if !HAVE_MEMMEM		// GNU extension.
-Byte *memmem (Byte const * haystack, int haystack_len,
-	     Byte const *needle, int needle_len);
+void *memmem (void const * haystack, int haystack_len,
+	     void const *needle, int needle_len);
 #endif HAVE_MEMMEM
 
 #if !HAVE_SNPRINTF		// GNU extension.
--- flower/libc-extension.cc~	Wed Sep  1 21:17:49 1999
+++ flower/libc-extension.cc	Sat Sep  4 05:38:17 1999
@@ -47,25 +47,27 @@
   The prototype is not in accordance with the Linux Programmer's
   Manual v1.15, but it is with /usr/include/string.h   */
 
-Byte *
-memmem (Byte const *haystack, int haystack_len,
-	Byte const *needle,int needle_len)
+void *
+memmem (void const *haystack_, int haystack_len,
+	void const *needle_,int needle_len)
 {
-  Byte const * end_haystack = haystack + haystack_len - needle_len + 1;
-  Byte const * end_needle = needle + needle_len ;
+  char const * haystack = (char const *)haystack_;
+  char const * needle = (char const *)needle_;
+  char const * end_haystack = haystack + haystack_len - needle_len + 1;
+  char const * end_needle = needle + needle_len ;
 
   /* Ahhh ... Some minimal lowlevel stuff. This *is* nice; Varation
      is the spice of life */
   while (haystack < end_haystack) 
     {
-      Byte const *subneedle_l = needle;
-      Byte const *subhaystack_l = haystack;
+      char const *subneedle_l = needle;
+      char const *subhaystack_l = haystack;
       while (subneedle_l < end_needle) 
         if (*subneedle_l++ != *subhaystack_l++)
 	  goto next;
 	
       // completed the needle. Gotcha.
-      return (Byte *) haystack;
+      return (void *)haystack;
       next:
 	haystack++;
     }
--- lily/GNUmakefile~	Fri Sep  3 10:18:28 1999
+++ lily/GNUmakefile	Sat Sep  4 05:53:27 1999
@@ -20,7 +20,7 @@
 $(outdir)/my-lily-lexer.o: $(outdir)/parser.hh
 $(outdir)/lexer.o: $(outdir)/parser.hh
 $(outdir)/lily-version.o: $(outdir)/version.hh
-$(outdir)/main.o: $(outdir)/BLURB.hh $(outdir)/COPERTINA.hh $(outdir)/FLAPTEKST.hh
+$(outdir)/main.o: $(outdir)/BLURB.hh
 
 
 
--- flower/data-file.cc~	Sat Sep  4 06:51:37 1999
+++ flower/data-file.cc	Sat Sep  4 07:01:41 1999
@@ -116,12 +116,38 @@
   message (_ ("warning: ") + s);
 }
 
+#if __alpha__ && __GNUC__ == 2 && __GNUC_MINOR__ == 95
+/* On alpha (OSF and GNU/Linux), GCC 2.95.1 crashes if exit() is
+   called directly within Data_file::error (String), or even if
+   exit_wrapper is inlined, so define it only after it is called.  */
+#ifndef USE_EXIT_WRAPPER
+#define USE_EXIT_WRAPPER 1
+#endif
+#endif
+
+#if USE_EXIT_WRAPPER
+static void
+exit_wrapper
+(int i);
+#define exit exit_wrapper
+#endif
+
 void
 Data_file::error (String s)
 {
   message (s);
   exit (1);    
 }
+
+#if USE_EXIT_WRAPPER
+#undef exit
+static void
+exit_wrapper
+(int i)
+{
+  exit(i);
+}
+#endif
 
 String
 Data_file::gulp ()
--- lib/warn.cc~	Wed Sep  1 21:17:49 1999
+++ lib/warn.cc	Sat Sep  4 07:01:33 1999
@@ -1,6 +1,22 @@
 #include "warn.hh"
 #include <stream.h>
 
+#if __alpha__ && __GNUC__ == 2 && __GNUC_MINOR__ == 95
+/* On alpha (OSF and GNU/Linux), GCC 2.95.1 crashes if exit() is
+   called directly within error (String), or even if exit_wrapper is
+   inlined, so define it only after it is called.  */
+#ifndef USE_EXIT_WRAPPER
+#define USE_EXIT_WRAPPER 1
+#endif
+#endif
+
+#if USE_EXIT_WRAPPER
+static void
+exit_wrapper
+(int i);
+#define exit exit_wrapper
+#endif
+
 void
 error (String s)
 {
@@ -8,6 +24,16 @@
 
   exit (1);
 }
+
+#if USE_EXIT_WRAPPER
+#undef exit
+static void
+exit_wrapper
+(int i)
+{
+  exit(i);
+}
+#endif
 
 void
 non_fatal_error (String s)
--- lily/mixed-qp.cc~	Wed Sep  1 21:17:49 1999
+++ lily/mixed-qp.cc	Sat Sep  4 07:51:50 1999
@@ -10,11 +10,37 @@
 #include "qlp.hh"
 
 
+#if __alpha__ && __GNUC__ == 2 && __GNUC_MINOR__ == 95
+/* On alpha (OSF and GNU/Linux), GCC 2.95.1 crashes if __eprintf() is
+   called directly from assert, or even if __eprintf_wrapper is inlined,
+   so define it only after it is called.  */
+#ifndef USE___EPRINTF_WRAPPER
+#define USE___EPRINTF_WRAPPER 1
+#endif
+#endif
+
+#if USE___EPRINTF_WRAPPER
+static void
+__eprintf_wrapper
+(const char *, const char *, unsigned, const char *);
+#define __eprintf __eprintf_wrapper
+#endif
+
 void
 Mixed_qp::add_equality_cons (Vector , double)
 {
   assert (false);
 }
+
+#if USE___EPRINTF_WRAPPER
+#undef __eprintf
+static void
+__eprintf_wrapper
+(const char *fmt, const char *file, unsigned line, const char *expr)
+{
+  __eprintf(fmt, file, line, expr);
+}
+#endif
 
 void
 Mixed_qp::add_fixed_var (int i, Real r)
--- midi2ly/midi-parser.cc~	Wed Sep  1 21:17:49 1999
+++ midi2ly/midi-parser.cc	Sat Sep  4 08:15:29 1999
@@ -28,13 +28,41 @@
   info_l_ = 0;
 }
 
+#if __alpha__ && __GNUC__ == 2 && __GNUC_MINOR__ == 95
+/* On alpha (OSF and GNU/Linux), GCC 2.95.1 crashes if exit() is
+   called directly within Midi_parser::exit (String), or even if
+   exit_wrapper is inlined, so define it only after it is called.  */
+#ifndef USE_EXIT_WRAPPER
+#define USE_EXIT_WRAPPER 1
+#endif
+#endif
+
+#if USE_EXIT_WRAPPER
+static void
+exit_wrapper
+(int i);
+#endif
+
 int
 Midi_parser::exit (String str)
 {
   error (str);
+#if USE_EXIT_WRAPPER
+#define exit exit_wrapper
+#endif
   ::exit (1);
   return 0;
 }
+
+#if USE_EXIT_WRAPPER
+#undef exit
+static void
+exit_wrapper
+(int i)
+{
+  exit(i);
+}
+#endif
 
 void
 Midi_parser::error (String str)


I've also had trouble with libintl.h on DU 4.0: it wasn't available in
/usr/include, so I had to copy libintl.h into flower/include for it to
be used.  Shouldn't this take place automatically?

Two other problems came up only at install time.  First,
Documentation/nt would try to run the program @YODL2MSLESS@, because
YODL2MSLESS was not AC_SUBSTed.  Unfortunately, even when running
yodl2msless by hand, it failed to create a non-empty out/index.txt,
because it would try to run the file index.ms, instead of running it
through troff.  But that's an yodl 1.31.0 bug.

The final problem was that ly2dvi wouldn't find titledefs.tex when run
by help2man.  The solution was to point TEXINPUTS into the tex
directory of the distribution when running make install.  This should
probably be taken care of automatically, but I don't know how to do it
within the stepmake framework.

Cheers,

-- 
Alexandre Oliva http://www.dcc.unicamp.br/~oliva IC-Unicamp, Bra[sz]il
oliva@{dcc.unicamp.br,guarana.{org,com}} aoliva@{acm.org,computer.org}
oliva@{gnu.org,kaffe.org,{egcs,sourceware}.cygnus.com,samba.org}
** I may forward mail about projects to mailing lists; please use them

Reply via email to