David Miller <da...@davemloft.net> writes:

> From: Rainer Orth <r...@cebitec.uni-bielefeld.de>
> Date: Mon, 21 Nov 2011 14:53:33 +0100
>
>> Right now, it is only possible to clear the hardware capabilities
>> completely, while the new v2 mapfile syntax supports selectively adding
>> and removing capabilities.  It is only available in Solaris 11 and
>> Solaris 10 Update 10, though, so I'm restricting us to the v1 syntax for
>> now.
>
> I really wish Sun had never added this hwcap checking, 99 times out of
> 100 it's a nuisance rather than a help in any way.

I beg to differ: I prefer a ld.so.1 message telling me that my
executable or library uses ISA extension x, but my machine doesn't
support that, over the same binary beginning to run, but crashing with a
SIGILL every time.  I posit that's similar to symbol versioning where
the runtime linker can tell me: you're trying to use interface x in
liby.so.3, but the library doesn't provide it.  That's far better than
letting the programs start and crash later with an unsupported insn or
missing symbol, perhaps losing work.  True, you may be lucky and not
hit that codepath, but I'd rather not depend on my luck if running
software ;-)

I suppose that everyone who's able to play cute tricks with code
selection at runtime depending on machine hardware capabilities is smart
enough to deal with the linker's hwcap stuff, too.

As an aside, in Solaris 10 Update 10 and Solaris 11, there's direct
support in ld and ld.so.1 to select different implementations of the
same interface, depending on hardware capabilites present:

http://docs.oracle.com/cd/E23824_01/html/819-0690/chapter2-13.html#giskh

        Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

Reply via email to