[bind10-dev] (no subject)

Nathanael Hoyle bind at hoyletech.com
Tue Jun 29 04:31:32 UTC 2010


On 6/28/2010 9:36 PM, Jeremy C. Reed wrote:
> On Tue, 29 Jun 2010, BIND 10 Tests wrote:
> 
>> http://bind10.isc.org/~tester/builder//BIND10/20100629004001-Debian5Linux-i686/logs/build.out
>>
>> http://bind10.isc.org/~tester/builder//builder.html
> 
> 
> So in commit r2316, I did:
> "
> I noticed this because libcfgclient's tests only linked with cc/data.o
> but build using Sunstudio showed it used libcc's session also.
> So instead of just linking with cc/session.o (which does work),
> I chose to link with libcc -- and noticed it was not using libtool.
> "
> 
> Testing on NetBSD with g++ and Solaris with sunstudio I never noticed.
> 
> But the build error above on Debian Linux with g++ is:
> 
> g++ -DHAVE_CONFIG_H -I. -I../../../..  -I../../../../src/lib 
> -I/usr/include -I/usr/include -I../../../../ext/asio -Wall -Wextra 
> -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare -Werror -fPIC 
> -Wno-unused-parameter -g -MT run_unittests-run_unittests.o -MD -MP -MF 
> .deps/run_unittests-run_unittests.Tpo -c -o 
> run_unittests-run_unittests.o `test -f 'run_unittests.cc' || echo 
> './'`run_unittests.cc
> mv -f .deps/run_unittests-run_unittests.Tpo 
> .deps/run_unittests-run_unittests.Po
> /bin/sh ../../../../libtool --tag=CXX   --mode=link g++ -Wall -Wextra 
> -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare -Werror -fPIC 
> -Wno-unused-parameter -g  -L/usr/lib -L/opt/pkg/lib -o run_unittests 
> run_unittests-ccsession_unittests.o 
> run_unittests-module_spec_unittests.o 
> run_unittests-config_data_unittests.o run_unittests-run_unittests.o 
> -lgtest ../../../../src/lib/exceptions/libexceptions.la 
> libfake_session.la ../../../../src/lib/config/libcfgclient.la 
> ../../../../src/lib/cc/libcc.la 
> libtool: link: g++ -Wall -Wextra -Wwrite-strings -Woverloaded-virtual 
> -Wno-sign-compare -Werror -fPIC -Wno-unused-parameter -g -o 
> .libs/run_unittests run_unittests-ccsession_unittests.o 
> run_unittests-module_spec_unittests.o 
> run_unittests-config_data_unittests.o run_unittests-run_unittests.o  
> -L/usr/lib -L/opt/pkg/lib /usr/lib/libgtest.so 
> ../../../../src/lib/exceptions/.libs/libexceptions.so 
> ./.libs/libfake_session.so 
> ../../../../src/lib/config/.libs/libcfgclient.so 
> ../../../../src/lib/cc/.libs/libcc.so -Wl,-rpath 
> -Wl,/home/tester/builder/builder/work/BIND10/20100629004001-Debian5Linux-i686/install/lib
> ../../../../src/lib/cc/.libs/libcc.so: undefined reference to 
> `pthread_key_create'
> ../../../../src/lib/cc/.libs/libcc.so: undefined reference to 
> `pthread_key_delete'
> collect2: ld returned 1 exit status
> make[5]: *** [run_unittests] Error 1
> 
> 
> I will revert this run_unittests_LDADD += 
> $(top_builddir)/src/lib/cc/libcc.la change but first want to see if 
> anyone knows of the correct fix for this.
> 

I haven't tested this, but it looks to me like you're missing
"-lpthread" in the linking step that fails. I notice (referring to the
full build log) that previous linking steps in the build log for other
modules do include this, and build cleanly. Inclusion of the pthread.h
file defines the referenced API calls at compile time, but at link time
the pthread library is required in order to resolve the symbols' entry
points. I think (and it's consistent with other experience compiling on
the respective platforms) that Debian's g++ version is simply being more
pedantic about not automatically including code you didn't explicitly
ask for.

-Nathanael



More information about the bind10-dev mailing list