bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-gnulib] Multiple definitions of symbol _xalloc_die


From: Simon Josefsson
Subject: [Bug-gnulib] Multiple definitions of symbol _xalloc_die
Date: Fri, 15 Oct 2004 15:02:28 +0200
User-agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3.50 (gnu/linux)

I'm now using the xalloc-die approach on two of my libraries, GSS and
Shishi.  But MacOS X doesn't seem to like this (see link error below).

The Shishi version is:

/* If non-NULL, call this function when memory is exhausted. */
void (*shishi_alloc_fail_function) (void) = 0;

void
xalloc_die (void)
{
  if (shishi_alloc_fail_function)
    (*shishi_alloc_fail_function) ();
  fflush (stdout);
  fprintf (stderr, _("%s: Memory allocation failed\n"), PACKAGE);
  abort ();
}

And the GSS version is:

/* If non-NULL, call this function when memory is exhausted. */
void (*gss_alloc_fail_function) (void) = 0;

void
xalloc_die (void)
{
  if (gss_alloc_fail_function)
    (*gss_alloc_fail_function) ();
  fflush (stdout);
  fprintf (stderr, _("%s: Memory allocation failed\n"), PACKAGE);
  abort ();
}

Do you know if there is a solution to this?

I guess I could AC_DEFINE([xalloc_die], [gss_xalloc_die]) or
something.

Hm.  Should the xalloc_die's be static?  But then libgnu.la wouldn't
find it, right?

Thanks.

if /bin/sh ../libtool --mode=compile --tag=CC gcc 
-DLOCALEDIR=\"/tmp/jas4711/share/locale\" -DHAVE_CONFIG_H -I. -I. -I..  -I../gl 
-I/tmp/jas4711/include  -g -O2 -MT version.lo -MD -MP -MF ".deps/version.Tpo" 
-c -o version.lo version.c; \
then mv -f ".deps/version.Tpo" ".deps/version.Plo"; else rm -f 
".deps/version.Tpo"; exit 1; fi
 gcc -DLOCALEDIR=\"/tmp/jas4711/share/locale\" -DHAVE_CONFIG_H -I. -I. -I.. 
-I../gl -I/tmp/jas4711/include -g -O2 -MT version.lo -MD -MP -MF 
.deps/version.Tpo -c version.c  -fno-common -DPIC -o .libs/version.o
 gcc -DLOCALEDIR=\"/tmp/jas4711/share/locale\" -DHAVE_CONFIG_H -I. -I. -I.. 
-I../gl -I/tmp/jas4711/include -g -O2 -MT version.lo -MD -MP -MF 
.deps/version.Tpo -c version.c -o version.o >/dev/null 2>&1
/bin/sh ../libtool --mode=link --tag=CC gcc  -g -O2  -L/tmp/jas4711/lib -o 
libgss.la -rpath /tmp/jas4711/lib -version-info 0:14:0 meta.lo context.lo 
cred.lo error.lo misc.lo msg.lo name.lo obsolete.lo oid.lo asn1.lo ext.lo 
version.lo ../gl/libgl.la krb5/libgss-shishi.la -lshishi
gcc -dynamiclib -flat_namespace -undefined suppress -o 
.libs/libgss.0.0.14.dylib  .libs/meta.o .libs/context.o .libs/cred.o 
.libs/error.o .libs/misc.o .libs/msg.o .libs/name.o .libs/obsolete.o 
.libs/oid.o .libs/asn1.o .libs/ext.o .libs/version.o -all_load  
../gl/.libs/libgl.a krb5/.libs/libgss-shishi.a  -L/tmp/jas4711/lib 
/tmp/jas4711/lib/libidn.dylib /tmp/jas4711/lib/libshishi.dylib -install_name  
/tmp/jas4711/lib/libgss.0.dylib -compatibility_version 1 -current_version 1.14
ld: multiple definitions of symbol _xalloc_die
.libs/ext.o definition of _xalloc_die in section (__TEXT,__text)
/tmp/jas4711/lib/libshishi.dylib(utils.o) definition of _xalloc_die
/usr/bin/libtool: internal link edit command failed
make[2]: *** [libgss.la] Error 1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]