Re: linker questions.
- From: Dave <foo@xxxxxxx>
- Date: Fri, 26 Jun 2009 15:25:58 +0100
Dennis Handly wrote:
Dave wrote:I don't run HP-UX, but are looking to find out what flags would be used to build a shared library on HP-UX.
1) Do most people use the GNU linker, or HP's linker?
You can only use HP's linker.
You use -b to build a shlib.
2) Can someone post the output of 'man ld'
http://docs.hp.com/en/B2355-60130/ld_ia.1.html
http://docs.hp.com/en/B2355-60130/ld_pa.1.html
Thank you for those links. I'll take a look, but if you could make some suggestions I would appreciate it. Despite knowing Solaris pretty well, with access to the man pages, I could not work out what the the Sun equivalent were.
FWIW, I'm trying to help the developer of Automatically Tuned Linear Algebra Software (ATLAS) library build in better shared library support. It is currently broken on Solaris if the Sun linker is used, so I found what options the Sun linker needed. It would be good to add them for other operating systems too. So I'm trying to found out what they are for HP-UX and AIX. I think covering the GNU, Sun, HP and IBM linkers would cover 99% of users. At the moment, it only works for the GNU linker.
As a Solaris user, I'm fed up with too many GNUisms - I'm sure you HP-UX guys must be too!
Perhaps if they do get added, we could convince someone to try to build ATLAS on HP-UX and see if it builds.
I won't try to explain what they do, as I don't fully understand it myself. But here is the text from the 'Options' section of the GNU linker manual.3) Does anyone know the HP linkers equivalent of these GNU linker flags
-shared -soname
--whole-archive --no-whole-archive
You'll have to explain what they do. Do the last two extract ALL of an archive?
I think:
-shared == -b
-soname X == +h X
http://sourceware.org/binutils/docs-2.19/ld/Options.html#Options
--whole-archive
For each archive mentioned on the command line after the --whole-archive option, include every object file in the archive in the link, rather than searching the archive for the required object files. This is normally used to turn an archive file into a shared library, forcing every object to be included in the resulting shared library. This option may be used more than once.
Two notes when using this option from gcc: First, gcc doesn't know about this option, so you have to use -Wl,-whole-archive. Second, don't forget to use -Wl,-no-whole-archive after your list of archives, because gcc will add its own list of archives to your link and you may not want this flag to affect those as well.
--no-whole-archive
Turn off the effect of the --whole-archive option for subsequent archive files.
--
I respectfully request that this message is not archived by companies as
unscrupulous as 'Experts Exchange' . In case you are unaware,
'Experts Exchange' take questions posted on the web and try to find
idiots stupid enough to pay for the answers, which were posted freely
by others. They are leeches.
.
- Follow-Ups:
- Re: linker questions.
- From: Dennis Handly
- Re: linker questions.
- From: Michael Kraemer
- Re: linker questions.
- From: Dave
- Re: linker questions.
- References:
- linker questions.
- From: Dave
- Re: linker questions.
- From: Dennis Handly
- linker questions.
- Prev by Date: Re: linker questions.
- Next by Date: Re: linker questions.
- Previous by thread: Re: linker questions.
- Next by thread: Re: linker questions.
- Index(es):
Relevant Pages
|