Any GCC experts out there?

Russel Winder russel.winder at concertant.com
Mon Aug 25 07:08:28 BST 2008


Compiling the bzr-svn plugin on Mac OS X Leopard and Ubuntu Hardy seems
to work fine.  However on Solaris 10 with packages from Sunfreeware, I
am getting the following problem that means the plugin does not work.

The build creates a number of shared objects, all get compiled in the
same way, for example:

gcc -shared build/temp.solaris-2.10-sun4u-2.5/wc.o build/temp.solaris-2.10-sun4u-2.5/util.o build/temp.solaris-2.10-sun4u-2.5/editor.o -L/usr/local/lib -lsvn_wc-1 -lsvn_subr-1 -o ./wc.so -L/usr/local/apr/lib -lapr-1

The compilation succeeds and wc.so is created.  However:

|> ldd wc.so
        libsvn_wc-1.so.0 =>      /usr/local/lib/libsvn_wc-1.so.0
        libsvn_subr-1.so.0 =>    /usr/local/lib/libsvn_subr-1.so.0
        libapr-1.so.0 =>         (file not found)
        libgcc_s.so.1 =>         /usr/local/lib/libgcc_s.so.1
        libsvn_delta-1.so.0 =>   /usr/local/lib/libsvn_delta-1.so.0
        libsvn_diff-1.so.0 =>    /usr/local/lib/libsvn_diff-1.so.0
        libaprutil-1.so.0 =>     (file not found)
        libexpat.so.0 =>         /usr/local/lib/libexpat.so.0
        libiconv.so.2 =>         /usr/local/lib/libiconv.so.2
        libapr-1.so.0 =>         (file not found)
        libuuid.so.1 =>  /usr/lib/libuuid.so.1
        libsendfile.so.1 =>      /usr/lib/libsendfile.so.1
        librt.so.1 =>    /usr/lib/librt.so.1
        libnsl.so.1 =>   /usr/lib/libnsl.so.1
        libpthread.so.1 =>       /usr/lib/libpthread.so.1
        libsocket.so.1 =>        /usr/lib/libsocket.so.1
        libz.so =>       /usr/local/lib/libz.so
        libc.so.1 =>     /usr/lib/libc.so.1
        libaprutil-1.so.0 =>     (file not found)
        libapr-1.so.0 =>         (file not found)
        libaprutil-1.so.0 =>     (file not found)
        libapr-1.so.0 =>         (file not found)
        libaprutil-1.so.0 =>     (file not found)
        libapr-1.so.0 =>         (file not found)
        libaio.so.1 =>   /lib/libaio.so.1
        libmd5.so.1 =>   /lib/libmd5.so.1
        libmp.so.2 =>    /lib/libmp.so.2
        libscf.so.1 =>   /lib/libscf.so.1
        libdoor.so.1 =>  /lib/libdoor.so.1
        libuutil.so.1 =>         /lib/libuutil.so.1
        libm.so.2 =>     /lib/libm.so.2
        /platform/SUNW,Sun-Blade-100/lib/libc_psr.so.1
        /platform/SUNW,Sun-Blade-100/lib/libmd5_psr.so.1

which means that the plugin fails to load when asked.  The files are
there though:

|> ll /usr/local/apr/lib
total 10055
drwxr-xr-x 3 root bin      512 2008-08-24 07:44 ./
drwxr-xr-x 7 root bin      512 2008-08-24 07:44 ../
-rw-r--r-- 1 root bin     7656 2005-12-30 08:28 apr.exp
-rw-r--r-- 1 root bin     3907 2005-12-31 07:02 aprutil.exp
-rw-r--r-- 1 root bin  3259896 2005-12-30 08:28 libapr-1.a
-rwxr-xr-x 1 root bin     1050 2005-12-30 08:28 libapr-1.la*
lrwxrwxrwx 1 root root      17 2008-08-24 07:44 libapr-1.so -> libapr-1.so.0.2.2*
lrwxrwxrwx 1 root root      17 2008-08-24 07:44 libapr-1.so.0 -> libapr-1.so.0.2.2*
-rwxr-xr-x 1 root bin  3207252 2005-12-30 08:28 libapr-1.so.0.2.2*
-rw-r--r-- 1 root bin  1896176 2005-12-31 07:02 libaprutil-1.a
-rwxr-xr-x 1 root bin     1251 2005-12-31 07:02 libaprutil-1.la*
lrwxrwxrwx 1 root root      21 2008-08-14 13:13 libaprutil-1.so -> libaprutil-1.so.0.2.2*
lrwxrwxrwx 1 root root      21 2008-08-14 13:13 libaprutil-1.so.0 -> libaprutil-1.so.0.2.2*
-rwxr-xr-x 1 root bin  1864704 2005-12-31 07:02 libaprutil-1.so.0.2.2*
drwxr-xr-x 2 root bin      512 2008-08-24 07:44 pkgconfig/

Setting LD_LIBRARY_PATH=/usr/local/apr/lib does solve the problem but:

a) setting LD_LIBRARY_PATH is generally considered the wrong thing to do
in all cases.

b) should not be needed since the compilation stage set -L and this
should have been remembered. in the shared object.

 |> gcc -v
Reading specs from /usr/local/lib/gcc/sparc-sun-solaris2.10/3.4.6/specs
Configured with: ../configure --with-as=/usr/ccs/bin/as --with-ld=/usr/ccs/bin/ld --enable-shared --enable-languages=c,c++,f77
Thread model: posix
gcc version 3.4.6

If anyone has any insight into this problem, I would appreciate it.

Thanks.

-- 
Russel.
====================================================
Dr Russel Winder                 Partner

Concertant LLP                   t: +44 20 7585 2200, +44 20 7193 9203
41 Buckmaster Road,              f: +44 8700 516 084
London SW11 1EN, UK.             m: +44 7770 465 077
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20080825/54ad362a/attachment-0001.pgp 


More information about the bazaar mailing list