Library mapping question

2008-07-11 Thread Unga
Hi all

I have same name libraries in two different locations, eg. /usr/lib/libXXX.so 
and /usr/local/lib/libXXX.so. They were created using same sources and the same 
compiler.

The app1 is linked with /usr/lib/libXXX.so and app2 is linked with 
/usr/local/lib/libXXX.so.

When app2 is run, the dynamic linker (ld-elf.so.1) finds /usr/lib/libXXX.so 
first and ends up with following error:
undefined reference to `_myxxx'

This is not an issue with Linux's dynamic linker but it seems FreeBSD's 
function look up is very specific. I cannot change the dynamic linker's search 
path, then app1 fails.

How do I get the app2 to refer to /usr/local/lib/libXXX.so?

In FreeBSD, is there a way to instruct the dynamic linker (ld-elf.so.1) to 
continue to search for the same library name in different locations?

What are the other possible options?

Appreciate your reply.

Kind regards
Unga





  
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Library mapping question

2008-07-11 Thread Polytropon
Hi.

On Fri, 11 Jul 2008 01:22:21 -0700 (PDT), Unga [EMAIL PROTECTED] wrote:
 How do I get the app2 to refer to /usr/local/lib/libXXX.so?
 
 In FreeBSD, is there a way to instruct the dynamic linker
 (ld-elf.so.1) to continue to search for the same library
 name in different locations?

Maybe an entry in /etc/libmap.conf (man 5 libmap.conf) will
reveal a possible solution?


-- 
Polytropon
From Magdeburg, Germany
Happy FreeBSD user since 4.0
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Library mapping question

2008-07-11 Thread Unga
--- On Fri, 7/11/08, Polytropon [EMAIL PROTECTED] wrote:

 From: Polytropon [EMAIL PROTECTED]
 Subject: Re: Library mapping question
 To: freebsd-questions@freebsd.org
 Cc: [EMAIL PROTECTED]
 Date: Friday, July 11, 2008, 5:09 PM
 Hi.
 
 On Fri, 11 Jul 2008 01:22:21 -0700 (PDT), Unga
 [EMAIL PROTECTED] wrote:
  How do I get the app2 to refer to
 /usr/local/lib/libXXX.so?
  
  In FreeBSD, is there a way to instruct the dynamic
 linker
  (ld-elf.so.1) to continue to search for the same
 library
  name in different locations?
 
 Maybe an entry in /etc/libmap.conf (man 5 libmap.conf) will
 reveal a possible solution?
 
Hi 

I was just now trying it after reading the libmap.conf(5).

I specified following in /etc/libmap.conf:

[/usr/bin/app2/]
libXXX.so   /usr/local/lib/libXXX.so

Now when run app2 it does not say anymore undefined references but it says 
Shared object /usr/local/lib/libXXX.so not found

ls -l /usr/local/lib/libXXX.so shows its there.

Is /etc/libmap.conf specification correct?

Regards
Unga


  
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Library mapping question

2008-07-11 Thread Mel
On Friday 11 July 2008 10:22:21 Unga wrote:
 Hi all

 I have same name libraries in two different locations, eg.
 /usr/lib/libXXX.so and /usr/local/lib/libXXX.so. They were created using
 same sources and the same compiler.

 The app1 is linked with /usr/lib/libXXX.so and app2 is linked with
 /usr/local/lib/libXXX.so.

 When app2 is run, the dynamic linker (ld-elf.so.1) finds /usr/lib/libXXX.so
 first and ends up with following error: undefined reference to `_myxxx'

 This is not an issue with Linux's dynamic linker but it seems FreeBSD's
 function look up is very specific. I cannot change the dynamic linker's
 search path, then app1 fails.

 How do I get the app2 to refer to /usr/local/lib/libXXX.so?

 In FreeBSD, is there a way to instruct the dynamic linker (ld-elf.so.1) to
 continue to search for the same library name in different locations?

 What are the other possible options?

The best option is to bump version number of the shared library with the more 
functions. FreeBSD doesn't link with .so, it links with .so.$VERSION. It 
would be easier to help you though, if we wouldn't be talking about libXXX 
but the actual libraries. Maybe it can be done by adding small changes to the 
port that installs /usr/local/lib/libXXX.so (if this isn't your own library).

-- 
Mel

Problem with today's modular software: they start with the modules
and never get to the software part.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Library mapping question

2008-07-11 Thread N. Raghavendra
At 2008-07-11T02:18:21-07:00, Unga wrote:

 [/usr/bin/app2/]
 libXXX.so   /usr/local/lib/libXXX.so

 Now when run app2 it does not say anymore undefined references but
 it says Shared object /usr/local/lib/libXXX.so not found

 ls -l /usr/local/lib/libXXX.so shows its there.

 Is /etc/libmap.conf specification correct?

In all the examples I've seen, the mapping entries in
libmap.conf(5), i.e., the ones in the second column, are relative to
the search path for libraries.  Further, it is better to use only the
basename of the executable in the constraint of the mapping --- the
part enclosed by square brackets.  So, the following may work:

  cd /usr/local/lib  ln -s libXXX.so libFOO.so 

to distinguish it from the one in `/usr/lib', which directory comes
earlier in the search path.  Then, append these two lines to
`/etc/libmap.conf':

[app2]
libXXX.so   libFOO.so

HTH,
Raghavendra.

-- 
N. Raghavendra [EMAIL PROTECTED] | http://www.retrotexts.net/
Harish-Chandra Research Institute   | http://www.mri.ernet.in/
See message headers for contact and OpenPGP information.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Library mapping question

2008-07-11 Thread Unga
--- On Fri, 7/11/08, N. Raghavendra [EMAIL PROTECTED] wrote:

 From: N. Raghavendra [EMAIL PROTECTED]
 Subject: Re: Library mapping question
 To: [EMAIL PROTECTED]
 Cc: freebsd-questions@freebsd.org
 Date: Friday, July 11, 2008, 9:22 PM
 At 2008-07-11T02:18:21-07:00, Unga wrote:
 
  [/usr/bin/app2/]
  libXXX.so   /usr/local/lib/libXXX.so
 
  Now when run app2 it does not say anymore
 undefined references but
  it says Shared object
 /usr/local/lib/libXXX.so not found
 
  ls -l /usr/local/lib/libXXX.so shows its there.
 
  Is /etc/libmap.conf specification correct?
 
 In all the examples I've seen, the mapping
 entries in
 libmap.conf(5), i.e., the ones in the second column, are
 relative to
 the search path for libraries.  Further, it is better to
 use only the
 basename of the executable in the constraint of the mapping
 --- the
 part enclosed by square brackets.  So, the following may
 work:
 
   cd /usr/local/lib  ln -s libXXX.so libFOO.so 
 
 to distinguish it from the one in `/usr/lib', which
 directory comes
 earlier in the search path.  Then, append these two lines
 to
 `/etc/libmap.conf':
 
 [app2]
 libXXX.so libFOO.so
 
 HTH,
 Raghavendra.
 

Hi Raghavendra

Thanks for the reply. It's most promising for the moment. Mel's method may be 
used next time when I build the app.

Best Regards
Unga


  
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]