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

Ludovic Courtès ludo at gnu.org
Wed Mar 19 16:55:16 CET 2008


Hi,

Simon Josefsson <simon at josefsson.org> writes:

> I have some vague memory about reading that the semantics of 'inline'
> has changed recently.  If you don't mark inline functions static, they
> will be exported as well, because they may be needed in other files.
> That would explain this problem.  I may be remembering incorrectly, but
> it may be that this new behaviour is actually correct.

GMP must be using "extern inline", whose C99 semantics may be different
from the original GCC semantics (though I don't recall the details).

Anyway, I see that GnuTLS is now compiled with `-std=c99', which may be
the reason for the semantic change.  In particular, for libguile, I see
a number of inline-related warnings, which did not show up earlier:

  .../libguile/inline.h:80: warning: C99 inline functions are not supported; using GNU89

This would suggest that GCC was able to automagically detect that
libguile isn't C99-aware, which it failed to do for GMP.

> I can't find this symbol in the GnuTLS sources, so I would suspect it is
> used in Guile?

It's from GMP, the GNU Multiple Precision arithmetic library
(http://gmplib.org), a dependency of Guile.

This should probably be reported as a GMP issue.  GMP should add some
C99 feature tests to adjust its use of "inline"---the easiest solution
being to use the `gnu_inline' attribute, but that won't fix things for
non-GCC C99 compilers.  Same for Guile.

> This reminds me, there is a bunch of warnings about use of inline
> functions in the gnutls-guile code, such as:
>
> core.c:1335: warning: function ‘set_certificate_file’ can never be inlined because it uses alloca (override using the always_inline attribute)
> core.c:1335: warning: inlining failed in call to ‘set_certificate_file’: function not inlinable

That's a mistake on my side: it shouldn't be inline since it uses
`alloca ()'.

I just pushed the two attached patches to `master' (I'll let you apply
them to whatever other branch may need it :-)).  The first one addresses
your warning, while the second one add `-fgnu89-inline' which should fix
both the warnings I'm seeing here (shown above) and David's compilation
problem.

David: can you confirm?  (You don't even have to apply the patch, you
can just try compiling the `guile' directory with
"make CFLAGS=-fgnu89-inline" I think.)

Thanks,
Ludovic.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-guile-Don-t-declare-inline-functions-that-use-al.patch
Type: text/x-patch
Size: 1536 bytes
Desc: The first patch
URL: </pipermail/attachments/20080319/7875dd53/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-guile-Compile-with-fgnu89-inline.patch
Type: text/x-patch
Size: 956 bytes
Desc: The second one
URL: </pipermail/attachments/20080319/7875dd53/attachment-0001.bin>


More information about the Gnutls-help mailing list