This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: GCC 4.5 build error: undefined reference to `libc_name_p'


On Fri, 30 Oct 2009, Ian Lance Taylor wrote:

> added the __gnu_inline__ attribute to libc_name_p in cfns.h.  That
> means that if the function can not be inlined, no definition will
> emitted.  Evidently it was not inlined on your system.  Since the
> definition in cfns.h is the only definition, this means that the
> function must be marked always_inline, or that __gnu_inline__ should
> be removed and the function should be marked static.
> 
> Joseph, did gperf add the __gnu_inline__ attribute here?  That is, do
> we need to get gperf to generate different output?

The checked-in regenerated output was just what I got out of my installed 
system (Ubuntu) gperf.  This appears in unmodified gperf 3.0.3:

    printf ("#ifdef __GNUC__\n"
            "__inline\n"
            "#ifdef __GNUC_STDC_INLINE__\n"
            "__attribute__ ((__gnu_inline__))\n"
            "#endif\n"
            "#endif\n");

and in 3.0.4 with slightly different conditions:

    printf ("#ifdef __GNUC__\n"
            "__inline\n"
            "#if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__\n"
            "__attribute__ ((__gnu_inline__))\n"
            "#endif\n"
            "#endif\n");

Since GCC is itself built in gnu89 mode (by virtue of GCC defaulting to 
that mode and the bootstrap process not changing this default), the 
presence or absence of this attribute should make no difference to the 
semantics.  The function was inline even before my checkin.

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]