[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

libc6 status



libc6 snapshot 970928 seems to be broken :-((
I built libg++272 2.7.2.8 then tried a very small program:

#include <iostream.h>
main()
{
  cout << "hello\n";
}

Either it segfaults or does nothing :-(( depending on compilation flags
(-static/-ggdb/...).

Now, I'm debugging the following program:

#include <iostream.h>

main( int argc, char **argv, char **envp )
{
	for( int i = 0 ; i < argc ; i++ ) {
		cout << i;
		cout << ':';
		cout << argv[i];
		cout << endl;
	}
	cout << "Hello\n";
}

It segfaults when buffer is flushed at "cout << endl" in libio/fileops.c
from glibc, not from libg++ package (the latter one is not used because glibc
provides the same functionality).

Well, is there anyone who can try to build glibc & libg++ ?
I would want to be sure this is not an artefact of my environment.  I built
them using a cross-compiler running under Solaris because my sparc-linux
workstation fails to run programs randomly.  It could be damaged by hardware
developments I made on :-(

BTW, I applied the following patches to glibc:
  1/ rtld-sparc (disable profiling)
  2/ environ-sparc (bad argv/envp context)
  3/ init-sparc (segfault in init when programs are linker with libc_g.a)
  4/ termios-sparc (to distribute kernel_termios.h)

and this one to libg++:
  5/ strcspn-sparc (use implementation of strcspn from glibc)

All these patches are attached to this document in MIME format.
My ftp site also distributes an archive of Debian files needed to build glibc:
ftp://lix.polytechnique.fr/pub/Linux/debian/sparc/exp/glibc-2.0.90-970928.debian-tree.tar.gz

glibc sources can be downloaded from ftp://ftp.gre.ac.uk/pub/gnu-alpha/libc:
  get libc-970928.tar.gz, glibc-linuxthreads-970813.tar.gz,
  glibc-crypt-2.0.90.tar.gz & glibc-localedata-2.0.5.tar.gz.
libg++ sources are on any Debian ftp site.

I'd appreciate any help.
Bye.

-- 
 Eric Delaunay                 | "La guerre justifie l'existence des militaires.
 delaunay@lix.polytechnique.fr | En les supprimant." Henri Jeanson (1900-1970)
--- elf/dl-profile.c.orig	Fri Oct 10 22:41:48 1997
+++ elf/dl-profile.c	Fri Oct 10 22:07:46 1997
@@ -184,6 +184,7 @@
 void
 _dl_start_profile (struct link_map *map, const char *output_dir)
 {
+#if 0
   char *filename;
   int fd;
   struct stat st;
@@ -411,12 +412,14 @@
 
   /* Turn on profiling.  */
   state = GMON_PROF_ON;
+#endif
 }
 
 
 void
 _dl_mcount (ElfW(Addr) frompc, ElfW(Addr) selfpc)
 {
+#if 0
   uint16_t *topcindex;
   size_t i, fromindex;
   struct here_fromstruct *fromp;
@@ -519,4 +522,5 @@
 
  done:
   state = GMON_PROF_ON;
+#endif
 }
--- sysdeps/sparc/sparc32/dl-machine.h.orig	Tue Oct  7 15:47:16 1997
+++ sysdeps/sparc/sparc32/dl-machine.h	Tue Oct  7 15:31:41 1997
@@ -245,6 +245,8 @@
      need not be done during bootstrapping, since there are no threads.
      But we also can't tell if we _can_ use flush, so don't. */
 
+  extern unsigned long _dl_hwcap;
+
   reloc_addr[2] = OPCODE_JMP_G1 | (value & 0x3ff);
 #ifndef RTLD_BOOTSTRAP
   if (_dl_hwcap & HWCAP_SPARC_FLUSH)
--- sysdeps/sparc/sparc32/elf/start.S.edo	Sun Aug 24 18:52:19 1997
+++ sysdeps/sparc/sparc32/elf/start.S	Tue Oct 14 18:35:38 1997
@@ -54,7 +54,7 @@
      argument info starts after one register window (16 words) past the SP.  */
 	ld	[%sp+22*4], %o0
 	add	%sp, 23*4, %o1
-	sll	%o0, 4, %o2
+	sll	%o0, 2, %o2
 	add	%o2, %o1, %o2
 	sethi	%hi(__environ), %g2
 	add	%o2, 4, %o2
--- sysdeps/unix/sysv/linux/sparc/sparc32/init-first.h.edo	Sun Aug 24 18:53:08 1997
+++ sysdeps/unix/sysv/linux/sparc/sparc32/init-first.h	Fri Oct 17 13:12:50 1997
@@ -76,12 +76,12 @@
 	cmp	%g2, 0
 	beq	3f
 	 sethi	%hi(__libc_multiple_libcs), %g3
-	ld	[%g4+%g2], %g2
+	ld	[%g2], %g2
 	subcc	%g0, %g2, %g0
 	subx	%g0, -1, %g2
 3:	or	%g3, %lo(__libc_multiple_libcs), %g3
 	cmp	%g2, 0
-	st	%g2, [%g3+%g4]
+	st	%g2, [%g3]
 	/* If so, argc et al are in %o0-%o2 already.  Otherwise, load them.  */
 	bnz	" #INIT "
 	 nop
--- sysdeps/unix/sysv/linux/Makefile.edo	Thu Aug 28 00:13:30 1997
+++ sysdeps/unix/sysv/linux/Makefile	Thu Oct 16 15:28:46 1997
@@ -60,7 +60,7 @@
 endif
 
 ifeq ($(subdir),termios)
-sysdep_headers += termio.h
+sysdep_headers += termio.h kernel_termios.h
 endif
 
 ifeq ($(subdir),stdio-common)
diff -ur libg++272-2.7.2.8.orig/debian/rules libg++272-2.7.2.8/debian/rules
--- libg++272-2.7.2.8.orig/debian/rules	Fri Oct 17 11:42:39 1997
+++ libg++272-2.7.2.8/debian/rules	Wed Oct 15 23:50:00 1997
@@ -3,6 +3,8 @@
 
 dir = `pwd`
 
+SHELL=/bin/bash
+
 # The name of the package (for example, `emacs').
 # The version of the package (for example, `19.28').
 sover = 2.7.2
diff -ur libg++272-2.7.2.8/libg++/gperf/src/key-list.cc libg++272-2.7.2.8/libg++/gperf/src/key-list.cc
--- libg++272-2.7.2.8.orig/libg++/gperf/src/key-list.cc	Sat Jun 17 00:30:57 1995
+++ libg++272-2.7.2.8/libg++/gperf/src/key-list.cc	Wed Oct 15 23:44:23 1997
@@ -160,6 +160,7 @@
   return get_special_input ('%');
 }  
   
+#ifndef sparc
 /* strcspn - find length of initial segment of S consisting entirely
    of characters not from REJECT (borrowed from Henry Spencer's
    ANSI string package, when GNU libc comes out I'll replace this...). */
@@ -184,6 +185,7 @@
 
   return count;
 }
+#endif
 
 /* Sets up the Return_Type, the Struct_Tag type and the Array_Type
    based upon various user Options. */
diff -ur libg++272-2.7.2.8.orig/libg++/gperf/src/key-list.h libg++272-2.7.2.8/libg++/gperf/src/key-list.h
--- libg++272-2.7.2.8.orig/libg++/gperf/src/key-list.h	Sat Jun 17 00:30:59 1995
+++ libg++272-2.7.2.8/libg++/gperf/src/key-list.h	Wed Oct 15 23:44:40 1997
@@ -52,7 +52,9 @@
   int         total_keys;                            /* Total number of keys, counting duplicates. */
   static int  determined[ALPHA_SIZE];                /* Used in function reorder, below. */
   static int  get_occurrence (List_Node *ptr);
+#ifndef sparc
   static int  strcspn (const char *s, const char *reject);
+#endif
   static int  already_determined (List_Node *ptr);
   static void set_determined (List_Node *ptr);
   void        output_min_max (void);

Reply to: