This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Failure linking gengtype when using non-GCC stage1 compiler
- From: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- To: gcc-bugs at gcc dot gnu dot org, gcc at gcc dot gnu dot org
- Cc: per at bothner dot com
- Date: Sun, 15 Feb 2004 09:54:45 -0500 (EST)
- Subject: Failure linking gengtype when using non-GCC stage1 compiler
Per - I believe this change:
http://gcc.gnu.org/ml/gcc-patches/2004-02/msg01032.html
causes bootstrap to fail on any system where one uses cc (i.e. not
GCC) as the stage1 compiler. The failure I get on solaris2.7 is:
> cc -g -DIN_GCC -DHAVE_CONFIG_H -DGENERATOR_FILE -o gengtype gengtype.o
> gengtype-lex.o gengtype-yacc.o ../libiberty/libiberty.a
> ild: (undefined symbol) linemap_line_start -- referenced in the text
> segment of gengtype.o
> make[2]: *** [gengtype] Error 5
This happens because gengtype.c includes rtl.h which includes input.h
which includes line-map.h. In line-map.h you made a static inline
function linemap_position_for_column which calls linemap_line_start.
Now unless we have a C99 compiler or GCC >= 2.7, ansidecl.h defines
"inline" to be empty. So with my cc linemap_position_for_column
becomes simply static, then call to linemap_line_start must be
resolved and we don't link gengtype with the module where that
function is defined.
There are several obvious ways to fix a problem like this, I'd like
you to please figure out which one makes sense given you wrote the
code.
Thanks,
--Kaveh
--
Kaveh R. Ghazi ghazi@caip.rutgers.edu