discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] mblock linking error


From: Tim Meehan
Subject: Re: [Discuss-gnuradio] mblock linking error
Date: Thu, 1 Mar 2007 12:11:41 -0500

Hi Johnathan

I think I am beginning to understand  now.  I am no expert with the gnu linker

when I run

$g++ -g -O2 -Wall -Woverloaded-virtual -o .libs/test_mblock
test_mblock.o  -pthread ./.libs/libmblock-qa.so  .libs/libmblock.so
-Wl,--rpath -Wl,/usr/local/lib

I do not get an error

NOTE the addition of .libs/libmblock.so to the g++ line

Also if I run

$g++ -g -O2 -Wall -Woverloaded-virtual -o .libs/test_mblock
test_mblock.o  -pthread ./.libs/libmblock-qa.so   -Wl

Note here I do not inlude .libs/libmblock.so but I remove the --rpath
-Wl,/usr/local/lib

I guess the `--rpath ....'  steps on whatever RPATH is in libmblock-qa.so


I have included the dumps you requested below.

I am rebuilding with /etc/ld.so.conf mod that Eric requested.

$ grep dependency libmblock-qa.la
dependency_libs='
/home/meehan/workspace/gnuradio/mblock/src/lib/libmblock.la
/home/meehan/workspace/gnuradio/omnithread/libgromnithread.la -lrt
/home/meehan/workspace/gnuradio/pmt/src/lib/libpmt.la
/usr/lib/gcc-lib/i486-linux/3.3.5/../../..//libcppunit.la -ldl '

$ objdump -x .libs/libmblock-qa.so | grep NEEDED
 NEEDED      libmblock.so
 NEEDED      libcppunit-1.10.so.0
 NEEDED      libdl.so.2
 NEEDED      libstdc++.so.5
 NEEDED      libm.so.6
 NEEDED      libc.so.6
 NEEDED      libgcc_s.so.1


$objdump -x .libs/libmblock-qa.so   | grep RPATH
 RPATH       /home/meehan/workspace/gnuradio/mblock/src/lib/.libs:/usr/local/lib

$ grep dependency libmblock.la
dependency_libs='
/home/meehan/workspace/gnuradio/omnithread/libgromnithread.la -lrt
/home/meehan/workspace/gnuradio/pmt/src/lib/libpmt.la  '

$ objdump -x .libs/libmblock.so | grep NEEDED
 NEEDED      libgromnithread.so
 NEEDED      libpmt.so
 NEEDED      libstdc++.so.5
 NEEDED      libm.so.6
 NEEDED      libc.so.6
 NEEDED      libgcc_s.so.1

$ objdump -x .libs/libmblock.so | grep RPATH
 RPATH       
/home/meehan/workspace/gnuradio/omnithread/.libs:/home/meehan/workspace/gnuradio/pmt/src/lib/.libs:/usr/local/lib


On 3/1/07, Johnathan Corgan <address@hidden> wrote:
Tim Meehan wrote:

> tim /etc/ld.so.conf
>
> /usr/X11R6/lib
> /usr/lib/atlas
>
> /usr/lib/libc5-compat
> /lib/libc5-compat
> /usr/i486-linuxlibc1/lib

Here is mine:

/usr/local/lib
/lib/i486-linux-gnu
/usr/lib/i486-linux-gnu
/usr/X11R6/lib

I don't recall if the first line is something I added or if it is the
stock configuration.

> Some more possibly usefull infromation
>
> g++ -g -O2 -Wall -Woverloaded-virtual -o .libs/test_mblock
> test_mblock.o  -pthread ./.libs/libmblock-qa.so -Wl,--rpath
> -Wl,/usr/local/lib

On my Ubuntu 6.10 system:

g++ -g -O2 -Wall -Woverloaded-virtual -pthread -o .libs/test_mblock
test_mblock.o  ./.libs/libmblock-qa.so

This is the key difference, as I think was worked out by Bob McGwier
some weeks ago--your libtool has the '-Wl,--rpath -Wl,/usr/local/lib'
arguments appended, mine does not. I have 1.5.22-4.

On my system, in the build tree, this results in:

$ grep dependency libmblock-qa.la

dependency_libs='
/home/jcorgan/gnuradio/trunk/mblock/src/lib/libmblock.la
/home/jcorgan/gnuradio/trunk/omnithread/libgromnithread.la -lrt
/home/jcorgan/gnuradio/trunk/pmt/src/lib/libpmt.la
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../..//libcppunit.la -ldl '

$ objdump -x libmblock-qa.so | grep NEEDED

  NEEDED      libmblock.so
  NEEDED      libcppunit-1.10.so.2
  NEEDED      libdl.so.2
  NEEDED      libstdc++.so.6
  NEEDED      libm.so.6
  NEEDED      libc.so.6
  NEEDED      libgcc_s.so.1

$ objdump -x libmblock-qa.so | grep RPATH

  RPATH       /home/jcorgan/gnuradio/trunk/mblock/src/lib/.libs

$ grep dependency libmblock.la

dependency_libs='
/home/jcorgan/gnuradio/trunk/omnithread/libgromnithread.la -lrt
/home/jcorgan/gnuradio/trunk/pmt/src/lib/libpmt.la  '

$ objdump -x libmblock.so | grep NEEDED

  NEEDED      libgromnithread.so
  NEEDED      libpmt.so
  NEEDED      libstdc++.so.6
  NEEDED      libm.so.6
  NEEDED      libc.so.6
  NEEDED      libgcc_s.so.1

$ objdump -x libmblock.so | grep RPATH

  RPATH
/home/jcorgan/gnuradio/trunk/omnithread/.libs:/home/jcorgan/gnuradio/trunk/pmt/src/lib/.libs


So the net of all this is that in the correctly completed build, both
the .la files and the .so files have all the information needed to
resolve all the interlibrary dependencies from within the build tree.

Can you compare the above to what you see in your tree?

--
Johnathan Corgan
Corgan Enterprises LLC
http://corganenterprises.com





reply via email to

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