Re: bootstrap/8122: severe build problems for i586-pc-linux-gnulibc1

Peter Breitenlohner <[email protected]>
Newsgroups gmane.comp.gcc.bugs,gmane.comp.gcc.prs
Message-ID <[email protected]>
On Tue, 11 Mar 2003, Hans-Peter Nilsson wrote:

> On 11 Mar 2003 [email protected] wrote:
> > Synopsis: severe build problems for i586-pc-linux-gnulibc1
> >
> > State-Changed-From-To: open->analyzed
> > State-Changed-By: ebotcazou
> > State-Changed-When: Tue Mar 11 16:56:06 2003
> > State-Changed-Why:
> >     Can this PR be closed now?
>
> Perhaps.  It won't be fixed in 3.2 series.  It will be fixed in
> 3.3.
>
> brgds, H-P

Although the sys/ucontext.h problem is indeed fixed in 3.3, some other
problems still persist.

With the attached patch 'make bootstrap' went fine (with lots of warnings)
and 'make -k check' was reasonably successful (quite a few of the unexpected
failures were due to the fact that libc5 fails to declare `__off64_t' as a
type).

The problem in gcc-3.3/include/libiberty.h is that the libc5 headers define
vasprintf differently, and the attempts to detect if vasprintf is declared
don't work (might be just a missing '#include "config.h"'?). Similarly, in
gcc-3.3/libiberty/strerror.c "ansidecl.h" and "libiberty.h" should be
included AFTER "config.h"!

In case you want some details:
	linux-2.4.18
	libc.so.5.4.38
	no distribution

regards
Peter Breitenlohner <[email protected]>
patch-01-config (text/plain, 1.9 KB)
	This is patch-01-config

	Fix for some (libc5 related?) config problems.

diff -ur -N gcc-3.3.orig/libiberty/strerror.c gcc-3.3/libiberty/strerror.c
--- gcc-3.3.orig/libiberty/strerror.c	2001-10-16 04:50:13.000000000 +0200
+++ gcc-3.3/libiberty/strerror.c	2003-05-30 16:57:11.000000000 +0200
@@ -2,9 +2,6 @@
    Written by Fred Fish.  [email protected]
    This file is in the public domain.  --Per Bothner.  */
 
-#include "ansidecl.h"
-#include "libiberty.h"
-
 #include "config.h"
 
 #ifdef HAVE_SYS_ERRLIST
@@ -25,6 +22,9 @@
 #undef sys_errlist
 #endif
 
+#include "ansidecl.h"
+#include "libiberty.h"
+
 /*  Routines imported from standard C runtime libraries. */
 
 #ifdef HAVE_STDLIB_H
diff -ur -N gcc-3.3.orig/include/libiberty.h gcc-3.3/include/libiberty.h
--- gcc-3.3.orig/include/libiberty.h	2003-02-27 21:29:53.000000000 +0100
+++ gcc-3.3/include/libiberty.h	2003-06-10 23:08:14.000000000 +0200
@@ -274,6 +274,19 @@
 
 extern int pwait PARAMS ((int, int *, int));
 
+/* Unfortunately libiberty.h is occasionally included before all system header
+   files (if any).  */
+#include <stdio.h>		/* Random thing to get __GNU_LIBRARY__.  */
+#ifndef __GNU_LIBRARY__
+/* These definitions are in conflict with glibc1:stdio.h
+
+   Actually the prototypes for all functions not compiled into libiberty
+   should be edited away from this file via configure!!!
+   See also the comment above in lines 29ff.
+
+   The tests for HAVE_DECL_ASPRINTF and HAVE_DECL_VASPRINTF try to do exactly
+   this, but unfortunately this does not yet work.  */
+
 #if !HAVE_DECL_ASPRINTF
 /* Like sprintf but provides a pointer to malloc'd storage, which must
    be freed by the caller.  */
@@ -289,6 +302,8 @@
   ATTRIBUTE_PRINTF(2,0);
 #endif
 
+#endif
+
 #define ARRAY_SIZE(a) (sizeof (a) / sizeof ((a)[0]))
 
 /* Drastically simplified alloca configurator.  If we're using GCC,
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.