zsh-workers
 help / color / mirror / code / Atom feed
* Library linkage portability?
@ 2007-04-29 12:34 Phil Pennock
  2007-04-29 15:44 ` Bart Schaefer
  0 siblings, 1 reply; 3+ messages in thread
From: Phil Pennock @ 2007-04-29 12:34 UTC (permalink / raw)
  To: zsh-workers

I've been playing around with embedding ruby into zsh, for no particular
reason beyond my own education.  In so doing, I found "issues" with
headers such as "regex.h" which are also in the ruby directory which has
ruby.h.

I ended up giving mdd files the ability to state per-module cflags and
linkage flags.  I then decided to get rid of the linkage of zsh against
pcre by resetting LIBS and CPPFLAGS in configure.ac after the test for
the pcre functions and just having pcre.mdd include:

  modincflags="`pcre-config --cflags`"
  modlibflags="`pcre-config --libs`"

Now I can run ldd against zsh and not see libpcre, but still have all
the PCRE functionality once I zmodload zsh/pcre.  I suspect that this
gets rid of the objections to building against pcre for systems where
zsh is on the root partition.

However, I also suspect that this is not portable to older a.out systems
and my memory's suggesting something about all library dependencies
having to be on the main executable, not being resolvable as libraries
are loaded.

Can someone please educate me as to the issues, or have I summed it up?
What about the stranger platforms, AIX etc?

Thanks,
-Phil


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Library linkage portability?
  2007-04-29 12:34 Library linkage portability? Phil Pennock
@ 2007-04-29 15:44 ` Bart Schaefer
  2007-04-29 16:09   ` Andrey Borzenkov
  0 siblings, 1 reply; 3+ messages in thread
From: Bart Schaefer @ 2007-04-29 15:44 UTC (permalink / raw)
  To: Phil Pennock, zsh-workers

On Apr 29,  5:34am, Phil Pennock wrote:
}
} Can someone please educate me as to the issues, or have I summed it up?
} What about the stranger platforms, AIX etc?

Search the zsh-workers archives for the years 1996-1998 for the terms
"dynamic;link" "dynamic;load" and "dynamic;library".  E.g.:

    http://tinyurl.com/3355m6

In particular start here:

    http://tinyurl.com/37gaqe

My recollection is that Cygwin and some other environments require not
that dynamic modules be linked from the main executable, but that they
be linked from another library, which is why the zsh/main module exists.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Library linkage portability?
  2007-04-29 15:44 ` Bart Schaefer
@ 2007-04-29 16:09   ` Andrey Borzenkov
  0 siblings, 0 replies; 3+ messages in thread
From: Andrey Borzenkov @ 2007-04-29 16:09 UTC (permalink / raw)
  To: zsh-workers

[-- Attachment #1: Type: text/plain, Size: 1892 bytes --]

On Sunday 29 April 2007, Bart Schaefer wrote:
> On Apr 29,  5:34am, Phil Pennock wrote:
> }
> } Can someone please educate me as to the issues, or have I summed it up?
> } What about the stranger platforms, AIX etc?
>
> Search the zsh-workers archives for the years 1996-1998 for the terms
> "dynamic;link" "dynamic;load" and "dynamic;library".  E.g.:
>
>     http://tinyurl.com/3355m6
>
> In particular start here:
>
>     http://tinyurl.com/37gaqe
>
> My recollection is that Cygwin and some other environments require not
> that dynamic modules be linked from the main executable, but that they
> be linked from another library, which is why the zsh/main module exists.
>

More precisely - some systems cannot export dynamic symbols (necessary for 
run-time linking) from main executable; they can be exported only from 
another dynamic module; library just being special case of dynamic module. I 
have been using such system for some time. Because on Win32 you actually link 
DLL against stub for another DLL, and such stub exists for DLL only, not for 
exe, I guess it is true for Cygwin as well (modern Cygwin can generate stub 
on the fly, but it is still required).

Also there are systems that do not support chained libraries (i.e. main 
executable requires library liba.so which requires libb.so. In this case 
libb.so won't be loaded unless explicitly listed during linking of main 
executable. Whether linker does not put NEEDED entries or rtld ignores them, 
does not matter - I believe on my system it was the latter). That is actually 
what gave rise to something like "pkgcofig --libs ..."; also libtool should 
cope with this too - it has full information about all requirements and links 
main executable against all need libraries on systems that need it.

I do not know if you can find any such system in the wild today.

-andrey

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-04-29 16:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-04-29 12:34 Library linkage portability? Phil Pennock
2007-04-29 15:44 ` Bart Schaefer
2007-04-29 16:09   ` Andrey Borzenkov

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).