[Help-gnutls] Re: duplicate symbols complaint on Mac OS X 10.5.2

Ludovic Courtès ludo at gnu.org
Thu Apr 10 10:00:03 CEST 2008


Hi,

Simon Josefsson <simon at josefsson.org> writes:

> I'm still not sure whether this is a guile or gnutls problem.  Before
> making changes in gnutls to override gnulib's gnu99 default, or adding
> thinks like -fgnu89-inline, I want to understand the problem better.
> Adding workarounds like that is easy to do, but years later the
> workaround often start to cause new problems and it will be difficult to
> know what to do.  (Compare the -D_REENTRANT flag..)
>
> Would this problem go away if we removed all 'inline' tags from
> functions in GnuTLS?

No.  What happens is that GMP declares/defines various functions as
"extern inline" and expects the GNU semantics [0].  It properly guards
against the C99 semantic change (at least GMP 4.2.2 does) using the
recommended method [1].

However, it all looks as though Apple's GCC implemented C99 "extern
inline" without defining `__GNUC_STDC_INLINE__', thereby defeating said
method.

A useful code snippet seems to confirm this hypothesis:

  https://svn.r-project.org/R/trunk/src/include/Rinlinedfuns.h

  /* Apple's gcc build >5400 (since Xcode 3.0) doesn't support GNU inline in C99 mode */
  #if __APPLE_CC__ > 5400 && !defined(C99_INLINE_SEMANTICS) && __STDC_VERSION__ >= 199901L
  #define C99_INLINE_SEMANTICS 1
  #endif

So I suppose GMP and Guile just have to go ahead and duplicate this?

Thanks,
Ludovic.

[0] A nice summary of the "extern inline" mess:
    http://gcc.gnu.org/ml/gcc/2006-11/msg00006.html .

[1] http://gcc.gnu.org/gcc-4.3/porting_to.html






More information about the Gnutls-help mailing list