public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* __eprintf problem in f77
@ 1997-12-09  2:57 Andrew Zabolotny
  1997-12-10 12:23 ` Dave Love
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew Zabolotny @ 1997-12-09  2:57 UTC (permalink / raw)
  To: egcs

There was a problem with __eprintf before in cc1/cc1plus, then it disappeared somewhere in last patches before
egcs-1.0 release. But it is still present in the f771 compiler.

problem:
 when building the entire bulk of compilers, make stops at gcc/f/fini.c with the ld diagnostics
 "undefined symbol __eprintf in fini.o"
cause:
 gcc/assert.h defines assert() to call __eprintf when assertion fails.
 fini.c includes some .h file which in turn includes assert.h.
 __eprintf is not present in default libraries when using cc
solution:
 define assert() in fini.c same way as in, for example, f/com.c, i.e:

/* This is used by the `assert' macro.  It is provided in libgcc.a,
   which `cc' doesn't know how to link.  Note that the C++ front-end
   no longer actually uses the `assert' macro (instead, it calls
   my_friendly_assert).  But all of the back-end files still need this.  */
void
__eprintf (string, expression, line, filename)
#ifdef __STDC__
     const char *string;
     const char *expression;
     unsigned line;
     const char *filename;
#else
     char *string;
     char *expression;
     unsigned line;
     char *filename;
#endif
{
  fprintf (stderr, string, expression, line, filename);
  fflush (stderr);
  abort ();
}

Greetings,
    _\ndy@teamOS/2


^ permalink raw reply	[flat|nested] 5+ messages in thread
* Re: __eprintf problem in f77
@ 1997-12-11  5:11 Andrew Zabolotny
  1997-12-12 10:18 ` Dave Love
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew Zabolotny @ 1997-12-11  5:11 UTC (permalink / raw)
  To: Dave Love; +Cc: egcs

On 10 Dec 1997 20:21:51 +0000, Dave Love wrote:

> Andrew>  "undefined symbol __eprintf in fini.o"
> Andrew> cause:
> Andrew>  gcc/assert.h defines assert() to call __eprintf when assertion fails.
> Andrew>  fini.c includes some .h file which in turn includes assert.h.
> Andrew>  __eprintf is not present in default libraries when using cc
>I'm not sure what exactly this comes from.  Do you mean you're
>building f771 not with gcc?  
Of course not. I'm building f771 in the whole egcs context.

Let me describe the problem more detailed:

When I run make in egcs/gcc subdirectory it compiles almost everything
with egcs/gcc being the current
directory. Since one of GCC options is -I. it will catch "assert.h" from
current directory, which will define
assert() to call __eprintf on failure. The system header file assert.h
defines assert in a different way, and the
system libraries doesn't contain __eprintf (although __eprintf is
contained in libgcc). However, egcs/gcc/f/fini.c is compiled/linked with
the _system_ compiler, which doesn't know where from to take __eprintf. So
fini.c compilation fails. (this is the only thing that fails diring
compilation -- other programs either doesn't use __eprintf,
or provide a __eprintf themself). So to resolve this problem it is needed
to define __eprintf inside f/fini.c

Greetings,
    _\ndy@teamOS/2


^ permalink raw reply	[flat|nested] 5+ messages in thread
* Re: __eprintf problem in f77
@ 1997-12-16  1:41 Andrew Zabolotny
  0 siblings, 0 replies; 5+ messages in thread
From: Andrew Zabolotny @ 1997-12-16  1:41 UTC (permalink / raw)
  To: egcs

On 12 Dec 1997 18:15:21 +0000, Dave Love wrote:

>Sorry, I see.  I'd forgotten what fini is, 
its used to prepare something for the Fortran compiler.

>but I'm puzzled why this
>hasn't emerged before on bug-g77...  For my information, on what
>platform does it show up?
i?86-ibm-os2 with gcc/emx 2.7.2.1.

Greetings,
    _\ndy@teamOS/2


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~1997-12-16  1:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-12-09  2:57 __eprintf problem in f77 Andrew Zabolotny
1997-12-10 12:23 ` Dave Love
1997-12-11  5:11 Andrew Zabolotny
1997-12-12 10:18 ` Dave Love
1997-12-16  1:41 Andrew Zabolotny

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).