- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Confused about static link
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
Forums
Discussions
Discussions
Discussions
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
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
05-22-2003 06:18 PM
05-22-2003 06:18 PM
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2003 07:18 PM
05-22-2003 07:18 PM
Re: Confused about static link
-a archive
or you can change the shared library search path you have all you'r static library somewhere else say in /usr/contrib/lib with -L option
Rajeev
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2003 08:50 PM
05-22-2003 08:50 PM
Re: Confused about static link
If I use:
cc -Wl,-a,archive -c x1.c
cc -Wl,-a,archive -c x2.c
cc -o x x1.o x2.o -Wl,-a,archive -lXt,-lX11,-lc
I get unsatisfied symbols from ld:
shl_load
shl_unload
shl_findsym
which are to do with shared library loading I think.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2003 02:02 AM
05-23-2003 02:02 AM
Re: Confused about static link
You assume correct.
These are functions from libdld.sl, which is library to manage dynamic library linking.
However mayby this helps?
man ld
-noshared This option forces the linker to create a fully
archive bound program.
Good luck
Adam
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-25-2003 09:38 PM
05-25-2003 09:38 PM
Re: Confused about static link
you can suspect libc.a:
nm /usr/lib/libc.a | grep shl_load
--
ranga
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-25-2003 09:38 PM
05-25-2003 09:38 PM
Re: Confused about static link
you can suspect libc.a:
nm /usr/lib/libc.a | grep shl_load
--
ranga
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-25-2003 09:38 PM
05-25-2003 09:38 PM
Re: Confused about static link
--
ranga
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-25-2003 09:39 PM
05-25-2003 09:39 PM
Re: Confused about static link
--
ranga
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-25-2003 09:41 PM
05-25-2003 09:41 PM
Re: Confused about static link
--
ranga
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-25-2003 09:44 PM
05-25-2003 09:44 PM
Re: Confused about static link
--
ranga
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-25-2003 09:44 PM
05-25-2003 09:44 PM
Re: Confused about static link
--
ranga
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2003 08:21 PM
05-27-2003 08:21 PM
Re: Confused about static link
Then again, the programs in /slib should all be static. I assume that most of them are programs linked against libc so how do they get to be non-shared if libc has shared library dependancies?????
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2003 01:41 AM
05-28-2003 01:41 AM
Re: Confused about static link
As far as I know, libc.a doesnt depend on any other shared library. It shouldnt be also.
For your problem, check the executable with chatr or ldd. Use the option as Adam said. This will work fine.
HTH
Umapathy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2003 07:30 AM
05-28-2003 07:30 AM
Re: Confused about static link
One comment which would fit here.
The difference between shared library and archive library (I realized it also reading some comment from other smarter guy, but I cannot recall the thread):
When you use shared library everything from it must be attached, as every program is allowed to use anything that was declared for it.
However archive libaries are resolved at compile time and thats the moment when everything is clear - what is used by the programmer, and what is not.
Basing on this knowledge linker is able to attach only really needed code, not always the whole library.
What I'm going to say is that:
Are there any references to shl_ functions inside libc.a? So what? It doesn't mean any of it will be really needed or linked to your executable.
Good luck
Adam
P.S.: Thanks to that Smart Someone who said it explicity in that some thread. I guess it was unbeatable A. Clay and the problem was related to the fact that size of executable compiled as shared version was bigger than executable compiled as compliete stand-alone (like yours).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2003 07:43 AM
05-28-2003 07:43 AM
Re: Confused about static link
but the bigger problem is I cannot find archive versions of X libraries.
If you want to use them it looks like you have no choice.
Good luck
Adam
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2003 07:57 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2003 02:54 PM
05-28-2003 02:54 PM
Re: Confused about static link
After pulling the program apart, with the Xt, Xlib and libc functions seperated, nothing I was using in libc requires a shared library
so the -Wl,-shared,-a,archive options built a fully static image. The culprit appears to be Xlib. Xlib references setlocale and it appears there is virtually no Xlib function you can call without requiring the load of a shared library.
You cannot even use -l:libdld.sl. The link works with this but the first Xlib call you hit (like XOpenDisplay) causes a segmentation fault. So it appears than under HP-UX it's shared or it's nothing!