sd's picture

Hi,

i've encountered a problem concerning the detection of the boost extension.

On my Gentoo system configure detected '-mt-s' as boost extension. This results in the following error while building:

/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.2/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib/libboost_thread-mt-s.a(thread.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
/usr/lib/libboost_thread-mt-s.a: could not read symbols: Bad value

The following patch disables the alphabetic sorting of 'ls'. Configure now detects '-mt' as boost extension. Thus the linker links against boost's shared objects and make builds without any error.

Regards,
Stefan

--- pion-net-0.5.6/configure 2008-05-03 01:36:23.000000000 +0200
+++ pion-net-0.5.6.new/configure 2008-05-19 13:06:39.000000000 +0200
@@ -23615,3 +23615,3 @@
echo $ECHO_N "checking boost library extension... $ECHO_C" >&6; }
-for boost_thread_library in `ls $BOOST_HOME_DIR/lib/libboost_thread*-mt*{dylib,dll,so,a}* 2>/dev/null` ;
+for boost_thread_library in `ls -U $BOOST_HOME_DIR/lib/libboost_thread*-mt*{dylib,dll,so,a}* 2>/dev/null` ;
do

Mike Dickey's picture
Boost extension override

Unfortunately, adding -U to the ls command does not work on other platforms. Instead, it just gives you an error message that the parameter is not supported.

I opted instead to add an option to the ./configure script that allows you to override the boost extension autodetection: --with-boost-extension

Try using "./configure --with-boost-extension='-mt' ..." with the latest SVN code to see if that works for you.

Here is the ticket for the change:

http://trac.atomiclabs.com/ticket/217

Here is the patch itself via websvn:

http://websvn.atomiclabs.com/diff.php?repname=pion-common&path=%2Ftrunk%...

Take care,
-Mike

Submitted by Mike Dickey on Thu, 06/05/2008 - 16:12.