>>> cc -g -xs -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE -DNE_LFS -o
>>> .libs/rpmconstant constant.o -L/usr/local/lib -L/usr/local/ssl/lib
>>> ./.libs/librpmconstant.so -ldl -lm -lpopt -lbeecrypt -lpthread
>>> /usr/local/lib/libneon.so -lssl -lcrypto -lnsl -lsocket -lz
>>> /usr/local/lib/libexpat.so -R/usr/local/lib -R/usr/local/ssl/lib
>>> Undefined first referenced
>>> symbol in file
>>> rpmdsInit constant.o
>>> rpmdsNext constant.o
>>> rpmdsTagN constant.o
>>> rpmHeaderFormats constant.o
>>> hdrVec constant.o
>>> rpmTagTable constant.o
>>> rpmdsSearch constant.o
>>> rpmdsResult constant.o
>>> rpmTags constant.o
>>> rpmdsIx constant.o
>>> rpmdsDNEVR constant.o
>>> rpmdsSetResult constant.o
>>> ld: fatal: Symbol referencing errors. No output written to
>>> .libs/rpmconstant
>>>
>>> Any thoughts?
>>
>> Weird. None of those symbols are used (or needed by) rpmconstant.
>> [...]
>>
>> Here's what I see on linux/i386 w gcc:
>> [...]
>
> Same for me. I even tried under sparc64-solaris9 today myself and at
> least with the "./devtool standalone" procedure and CC=gcc I *CANNOT*
> reproduce the problem. Either it is related to the used C compiler
> (perhaps Sun Studio?) or some other local problem.
>
> Ralf S. Engelschall
> rse@engelschall.com
> www.engelschall.com
>
I figured out what is going on here. Like I originally thought, Sun Studio
is including the functions it finds through included headers, but since
you're using GCC I'm guessing that's why you don't have the same issue.
The functions aren't actually needed, so they're not linked, and thus we
have the missing symbols. I started looking through the included headers
in rpmconstant.h and it seems (to me at least) that most of these aren't
necessary and are included by default. All the symbols that are missing
can be traced back to these, so as a test I removed all the
unecessarily included headers and *poof* the rpmconstant Makefile
builds and completes without missing symbols! ;)
I'm going to see how the rest of the package builds now. Would it be
possible to get the extra includes taken out of rpmconstant.h?
Thanks,
-Dave
Received on Mon Nov 19 20:04:00 2007