Question about detecting LD

Christopher Browne cbbrowne-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org
Tue Sep 7 22:50:23 UTC 2010


An irritating situation has come up with a bug we've run into with Slony-I...

We're looking to detect if a particular function is available, and the
easiest way of testing for this seems to be to have autoconf/configure
generate a C program consisting of a call to that function
(PQisthreadsafe()).

What turns out to be rather evil about the process is that varying
platforms need varying flags passed to LD.  What is further
unfortunate is that this doesn't map anywhere near 1-to-1 against OS
platforms.

- On AIX, there's a hugely customized variation on ld, and that's pretty 1-to-1.
- On Linux, almost always GNU ld is in use.  (Except perhaps on
embedded-ish distributions ala uclinux, which isn't much of a concern
for us)
- On Solaris, there are a couple of ld options.  GNU versus, erm,
something by, erm, Oracle ;-).
- On BSD, there's usually a BSD-ish flavour of ld.  (Though that might
differ on Debian/kFreeBSD :-)).
- It looks as though ld implementations try to follow GNU, for the
most part, which mostly works, except when it doesn't.

I'm not sure there are any other Unixes that anyone much cares about
anymore (HP/UX, I suppose).

The question is, has anyone found consistent ways to detect which ld
flavour is in place?  That seems to be an inherent part of the recipe.

We've got a workaround that's working for now, that's not *too*
heinously ugly, and that's not a zillion lines of crud, but in the
world of "portably building stuff," I'd rather like to understand this
one a little better.
-- 
http://linuxfinances.info/info/linuxdistributions.html
--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list