[csw-maintainers] Sun Studio 12 outputs v8plus code instead of v8 code under Solaris 10

Yann Rouillard yann at pleiades.fr.eu.org
Sat Nov 27 22:33:03 CET 2010


Hi,

I am currently building openssl under Solaris 10 to test the pkcs11
patch [1] and I've discovered a strange bug: Sun Studio 12 seems to
generate v8plus code instead of v8 code when compiling assembly code.

You can easily reproduce the bug using the attached file (sparcv8.S)
under current10s:

$ /opt/SUNWspro/bin/cc -I.. -I../.. -I../../include -KPIC -DOPENSSL_PIC
-DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -xarch=v8 -xO5
-xstrconst -xdepend -Xa -DB_ENDIAN -DBN_DIV2W -c sparcv8.S && elfdump
sparcv8.o | grep machine
  e_machine:  EM_SPARC32PLUS      e_version:    EV_CURRENT

The machine identifier is EM_SPARC32PLUS, it should be EM_SPARC.

$ /opt/studio/SOS11/SUNWspro/bin/cc -I.. -I../.. -I../../include -KPIC
-DOPENSSL_PIC -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H
-xarch=v8 -xO5 -xstrconst -xdepend -Xa -DB_ENDIAN -DBN_DIV2W -c
sparcv8.S && elfdump sparcv8.o | grep machine
  e_machine:  EM_SPARC            e_version:    EV_CURRENT

The bug doesn't happen with Sun Studio 12.1 et Sun Studio 12.2:

$ /opt/SUNWspro/bin/cc -I.. -I../.. -I../../include -KPIC -DOPENSSL_PIC
-DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -xarch=v8 -xO5
-xstrconst -xdepend -Xa -DB_ENDIAN -DBN_DIV2W -c sparcv8.S  && elfdump
sparcv8.o | grep machine
  e_machine:  EM_SPARC            e_version:    EV_CURRENT

$ /opt/solstudio12.2/bin/cc -I.. -I../.. -I../../include -KPIC
-DOPENSSL_PIC -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H
-xarch=v8 -xO5 -xstrconst -xdepend -Xa -DB_ENDIAN -DBN_DIV2W -c
sparcv8.S && elfdump sparcv8.o | grep machine
  e_machine:  EM_SPARC            e_version:    EV_CURRENT

The bug doesn't happen on current9s using the same command lines.

I will switch to Sun Studio 12.1 for now (BTW it seems it's not
installed on current9s) but if someone has a clue on this issue, I would
be interested.

BTW I've noticed this bug thanks to Maciej's package checking code.

Thanks in advance for your answers.

Yann

[1] http://blogs.sun.com/janp/entry/pkcs_11_engine_patch_including





-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: sparcv8.S
URL: <http://lists.opencsw.org/pipermail/maintainers/attachments/20101127/c320894b/attachment-0001.ksh>


More information about the maintainers mailing list