f build dies with: undefined reference to `lookup_name'

David Edelsohn dje@watson.ibm.com
Wed Mar 6 10:18:00 GMT 2002


>>>>> Andrew Cagney writes:

Andrew> Fortran?  The archive libbackend.a (which the fortran compiler linked 
Andrew> against) contains varasm.o but not contain c-decl.o.  Looking at 
Andrew> gcc/Makefile.in, C_AND_OBJC_OBJS includes c-decl.o but OBJS (used for 
Andrew> libbackend.a) does not.

	I am surprised that this did not cause any bootstrap problems
during all of the testing.

	The problem appears to be that all of the pragma and weak support
is in varasm.c, but it only is needed for C-like languages.  Because this
is tied with varasm, I don't think that one can separate it out into a
file only compiled for C-like languages.

	varasm.c includes c-tree.h, so there was no reason to believe that
those symbols were not safe.

	gcc/cp/decl.c defines lookup_name, but with an extra parameter
which currently is random garbage when this is used from the C++
front-end.  Sigh.

	gcc/f/com.c defines lookup_name_current_level, but not
lookup_name, copied directly from c-decl.c (even the comment referring to
lookup_name!)

	I think that one needs to define lookup_name in each language or
define a similar function in common code included in libbackend.a.  I
don't see how one can avoid referencing some symbol from varasm.c, even if
it never is called for some languages.

	Maybe someone else has a better idea which I am missing.

David



More information about the Gcc-patches mailing list