On Sat, 2013 Oct 12 11:52-0700, Paul Eggert wrote:
>
> Thanks, can you look at the generated 'configure' and see why that is?
> It should contain something like this:
>
> if test $ac_cv_func_realloc_0_nonnull = yes; then :
> $as_echo "#define HAVE_REALLOC_GNU 1" >>confdefs.h
> else
> $as_echo "#define HAVE_REALLOC_GNU 0" >>confdefs.h
> REPLACE_REALLOC=1
> fi
> if test $REPLACE_REALLOC = 1; then
> gl_LIBOBJS="$gl_LIBOBJS realloc.$ac_objext"
> fi
>
> You're reporting that HAVE_REALLOC_GNU=0, which means REPLACE_REALLOC
> should be 1 and gl_LIBOBJS should contain realloc.o; evidently this is
> not taking place. Perhaps you can put some 'echo' statements into
> 'configure' to see what's going wrong.
I looked through the configure script. It appears that realloc.o is
added to gl_LIBOBJS if a non-POSIX realloc() is found. However, if
realloc() is non-GNU, realloc.o is added to gltests_LIBOBJS, not
gl_LIBOBJS.
$ grep realloc configure.out
checking whether malloc, realloc, calloc are POSIX compliant... yes
checking for GNU libc compatible realloc... no
$ fgrep realloc.o gllib/Makefile
gltests_LIBOBJS = putenv.o realloc.o usleep.o
> > This link needs to be done with -mt to pull in the pthreads library.
>
> Wouldn't -lpthread work as well? pthreadlib.m4 says it would.
To a degree, yes, but there's also some preprocessor symbols that should
be defined. From the cc(1) man page:
-mt Sets various -D flags to enable multi-threading and
also sets -lpthread. For details see HP C Online Help.
> I pushed this patch to try to fix that:
That did address the link error, but -mt would be the better way.
--Danny
--
Daniel Richard G. || [email protected]
My ASCII-art .sig got a bad case of Times New Roman.