- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Use of -L/tmp -l on linux
Operating System - Linux
1754134
Members
3347
Online
108811
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2006 01:30 AM
04-10-2006 01:30 AM
Use of -L/tmp -l on linux
Hi all,
I'm porting some sw from HP-UX on Linux.
I understand is not possible to use when linking a shared library (.so) the following -L/tmp -l:test.so
Do you know how can I proceed? Do I have to rename test.so in libtest.so and use the following "-L/tmp -ltest"?
I'd prefer not to change all my libs names...
Can you please help?
Roy
I'm porting some sw from HP-UX on Linux.
I understand is not possible to use when linking a shared library (.so) the following -L/tmp -l:test.so
Do you know how can I proceed? Do I have to rename test.so in libtest.so and use the following "-L/tmp -ltest"?
I'd prefer not to change all my libs names...
Can you please help?
Roy
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2006 08:00 AM
04-11-2006 08:00 AM
Re: Use of -L/tmp -l on linux
Changing your library names to the lib*.so convention will be the least troublesome in the long run.
The linux ld does not have any way to combine the -L search path with arbitrarily named library files. You could link with /tmp/test.so. But if you try to link with absolute or relative paths to such files then ld will record the path by default. The ld.so runtime loader will then inflexibly look for the libraries at exactly the same paths without regard for LD_LIBRARY_PATH. It is possible to use "ld -soname test.so" when creating your shared library to make ld remember the plain file name instead of the path. Then you could link with /tmp/test.so and later install your shared library in a different directory.
If you choose to rename your libraries to match the lib*.so convention you could also consider using the versioning naming convention. That will allow you to create future versions that are incompatible with the current libraries but can be installed simultaneously on the same system. To use a version number you need to set the library name with "ld -soname" to include a version number and also provide a plain lib*.so symbolic link for ld to find when linking.
There is a good discussion of linux shared library conventions at http://www.faqs.org/docs/Linux-HOWTO/Program-Library-HOWTO.html
which discusses how to create and install shared libraries.
The linux ld does not have any way to combine the -L search path with arbitrarily named library files. You could link with /tmp/test.so. But if you try to link with absolute or relative paths to such files then ld will record the path by default. The ld.so runtime loader will then inflexibly look for the libraries at exactly the same paths without regard for LD_LIBRARY_PATH. It is possible to use "ld -soname test.so" when creating your shared library to make ld remember the plain file name instead of the path. Then you could link with /tmp/test.so and later install your shared library in a different directory.
If you choose to rename your libraries to match the lib*.so convention you could also consider using the versioning naming convention. That will allow you to create future versions that are incompatible with the current libraries but can be installed simultaneously on the same system. To use a version number you need to set the library name with "ld -soname" to include a version number and also provide a plain lib*.so symbolic link for ld to find when linking.
There is a good discussion of linux shared library conventions at http://www.faqs.org/docs/Linux-HOWTO/Program-Library-HOWTO.html
which discusses how to create and install shared libraries.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP