I'm trying to provide some short term relief for bug 6330877.  This bug
is caused by the new /usr/ccs/bin/as in snv_24 of Solaris Nevada.

The new /usr/ccs/bin/as automatically tags .o files with HWCAP sections
if it finds code like SSE and MMX.

The pkcs11_softtoken and kernel/crypto/rsa modules for i386 are built
with a .o file that does contain SSE and MMX instructions.  However we
do a runtime check to determine if we can use that code or not.  We did
this because $HWCAP searching wasn't available at the time and it still
isn't available to krtld.

The longer term fix for pkcs11_softtoken.so.1 is to break out the crypto
into a private lib and use $HWCAP variants of that.  Its coming but we
need a fix ASAP and this is too much work for a bandaid.

The new /usr/ccs/bin/as has a -nH flag but of course not all build
machines are running snv_24 yet and of course the older versions of
/usr/ccs/bin/as don't understand -nH - rock hard place!

I thought I should be able to use a linker mapfile to override the
content that goes into .SUNW_cap but it doesn't seem to be working.

I created cap_mapfile with this content:

hwcap_1: OVERRIDE;

I then arrange via DYNFLAGS for -M cap_mapfile

trigati:pts/3$ {6330877} make
/usr/ccs/bin/ld -r -dy -Ncrypto/md5 -M cap_mapfile -o debug32/rsa
debug32/rsa.o debug32/bignumimpl.o debug32/rsa_impl.o
debug32/bignum_i386.o debug32/bignum_i386_asm.o
/opt/onbld/bin/i386/ctfmerge -L VERSION -d
../../intel/genunix/debug32/genunix -o debug32/rsa debug32/rsa.o
debug32/bignumimpl.o debug32/rsa_impl.o debug32/bignum_i386.o
debug32/bignum_i386_asm.o
WARNING: ctfmerge: Uniquification file
../../intel/genunix/debug32/genunix couldn't be opened and will be
ignored.
/usr/bin/elfsign sign   -k
/export/build/darrenm/6330877/usr/src/cmd/cmd-crypto/etc/keys/SUNWosnet
-c
/export/build/darrenm/6330877/usr/src/cmd/cmd-crypto/etc/certs/SUNWosnet
-e debug32/rsa
trigati:pts/3$ {6330877}
trigati:pts/3$ {6330877} file debug32/*
debug32/bignum_i386.o:  ELF 32-bit LSB relocatable 80386 Version 1
debug32/bignum_i386_asm.o:      ELF 32-bit LSB relocatable 80386 Version
1 [SSE2 MMX]
debug32/bignumimpl.o:   ELF 32-bit LSB relocatable 80386 Version 1
debug32/rsa:    ELF 32-bit LSB relocatable 80386 Version 1 [SSE2 MMX]
debug32/rsa.o:  ELF 32-bit LSB relocatable 80386 Version 1
debug32/rsa_impl.o:     ELF 32-bit LSB relocatable 80386 Version 1

You can see from that that cap_mapfile was passed to ld(1) but that the
resulting rsa module still has SSE2 MMX tags in its .SUNW_cap section.

What am I doing wrong ?

It would be very helpful if:

http://docs.sun.com/app/docs/doc/817-1984/6mhm7pl19?a=view#chapter2-19

had an example of using OVERRIDE because the language is very confusing
about using 0 and OVERRIDE - which BTW results in a syntax error if I
do:  hwcap_1: 0 OVERRIDE.
Which is how I read the english description and the synopsis.

-- 
Darren J Moffat 


Reply via email to