- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Creating a shared object
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
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
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- 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
тАО06-15-2008 11:53 PM
тАО06-15-2008 11:53 PM
Re: Creating a shared object
I just want to be sure of something that was mentioned before:
is "+z" is the the equivalent for "-fPIC" for HPUX compiler?!
=> the "+z" will compiled the code position independent?
tx
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-16-2008 02:11 AM
тАО06-16-2008 02:11 AM
Re: Creating a shared object
For all the other platform, I managed to create the shared lib without using the "-fpic" - only for HP-UX this was the only thing that fix the "invalis fix loader..." link error I got.
Do you have any clue why it worked for me for all the other unix platforms (with PIC) and here I'm required?? (is it something I missing here - or just a different and acceptable behavior?!)
tx,
shlom
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-16-2008 04:00 AM
тАО06-16-2008 04:00 AM
Re: Creating a shared object
I'm not sure which is +z and which is +Z. Try "-fpic" first.
>I managed to create the shared lib without using the "-fpic" - only for HP-UX this was ...
>Do you have any clue why it worked for me for all the other unix platforms (with PIC) and here I'm required??
Not sure. On IPF, +z/+Z is obsolete and the default is PIC. But for gcc is may not be.
>just a different and acceptable behavior?
Naturally. :-)
Non-PIC code is faster and better for executables.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-16-2008 04:43 AM
тАО06-16-2008 04:43 AM
Re: Creating a shared object
I'm trying to understand how I managed to create shared lib successfully WITHOUT "-fpic" in all the other UNIX platforms.
Actually I need to know:
1.Why only the HP-UX enforce me using the PIC?
2. For my knoladge, is there any way to create a shared lib in HPUX without compiling position independent objects at all?!
tx
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-16-2008 05:18 AM
тАО06-16-2008 05:18 AM
Re: Creating a shared object
The IPF HP-UX default is PIC, probably because of this. But I believe IPF Linux also defaults to non-PIC.
The HP-UX PA32 decision was made over 23+ years when there weren't shlibs on HP-UX.
>2. is there any way to create a shared lib in HP-UX without compiling position independent objects at all?
Of course not. PIC is required by shlibs. The whole purpose of a shlib is to map it in memory at any location and be used by many executables, both which needs PIC.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-17-2008 12:22 AM
тАО06-17-2008 12:22 AM
Re: Creating a shared object
I added the "-fpic" to all the libs the my sl is being linked with and this solved the problem!!!
Now I have some running problems, but this is for a different thread.
tx all for the good answers.
shlom
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-08-2008 07:02 PM
тАО12-08-2008 07:02 PM
Re: Creating a shared object
In response to the previous question:
"I will have to change the extension to "sl" - don't I?"
the response was:
"You don't "have" to but it is a good idea.
Otherwise ld won't find it with -ltest without extra work."
My application (for reasons I won't go into) depends on the shared library extensions to end in .so. As such, I don't want to change them to .sl. Can you please explain to me what "extra work" I need to do to make ld find my .so files? Right now, it can't find them unless I rename them to .sl.
Thank you so much!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-08-2008 07:18 PM
тАО12-08-2008 07:18 PM
Re: Creating a shared object
Oops, I don't know if this confused anyone but this should say:
On PA you use .sl. On IPF you use .so.
>Vineet: I know this thread is closed, but I have a question
You should create your own thread so you can assign points and if useful include a URL to point to this thread.
>I don't want to change them to .sl. Can you please explain to me what "extra work" I need to do to make ld find my .so files?
You could do two things:
1) Create a symlink that points the .sl to the .so.
2) Change your link line to have: -l:libtest.so
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-08-2008 07:42 PM
тАО12-08-2008 07:42 PM
Re: Creating a shared object
As for your suggestion, I actually tried to use -l:, but it didn't work. I suspect this is because of the last sentence in the following excerpt from a doc on ld:
-l: library Search the library specified. Similar to the -l option except the current state of the -a option is not important. The library name must contain the prefix lib and end with a suffix of .a or .sl.
I got this from:
http://www.informatik.uni-frankfurt.de/doc/man/hpux/ld.1.html
I think it will only look for .a or .sl...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-08-2008 08:10 PM
тАО12-08-2008 08:10 PM
Re: Creating a shared object
I have no problems with: -L. -l:libfoo.so
>I suspect this is because of the last sentence in the following excerpt from a doc on ld:
Only the recommended/official suffixes are listed. But your issue could be due to the change in the linker. ld(1) now says:
The library name can be any valid filename. (Note that previous releases required that the library name contain the prefix lib and end with a suffix of .a or .sl.)
- « Previous
- Next »