How do you build OpenSC for 64-bit Solaris Sparcv9?

View: New views
3 Messages — Rating Filter:   Alert me  

How do you build OpenSC for 64-bit Solaris Sparcv9?

by Matthew Ball :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Folks,

I'm trying to build OpenSC for the 64-bit Sparcv9 target on Solaris 10,
and am running into various issues.

Before diving into details, is there a good instruction guide for
selecting 64-bit sparcv9 when running configure?

Here's my story (so far):

Not knowing better, I just tried the obvious approach of doing an
'export CFLAGS="-m64"' before running ./configure.  This worked until
getting a link error against libltdl.  On my Solaris system, libltdl is
installed at /opt/csw/share/libtool for the source and /opt/csw/lib for
the library (libltdl.so).  Unfortunately, the Blastwave libtool package
seems to only install a 32-bit version of the libltdl.so library, so I
went ahead and reconfigured the source at /opt/csw/share/libtool to
build a 64-bit target (by again setting CFLAGS="-m64" before running
./configure).

After that, I was able to point the LTLIB environment variables at the
new ltdl setup.

export LTLIB_LIBS="-L/new/ltdl/lib/path -lltdl"
export LTLIB_CFLAGS="-I/opt/csw/share/libtool/libltdl"
export CFLAGS="-m64"
./configure

This seemed to work okay, but when I attempted to run the pkcs11-spy.so
library, I got a 32-bit link error.  Here's the ldd of pkcs11-spy.so:

$ ldd libtest.so
        libssl.so.0.9.7 =>       /usr/sfw/lib/libssl.so.0.9.7  - wrong
ELF class: ELFCLASS32
        libcrypto.so.0.9.7 =>    /usr/sfw/lib/libcrypto.so.0.9.7  -
wrong ELF class: ELFCLASS32
        libnsl.so.1 =>   /lib/64/libnsl.so.1
        libltdl.so.3 =>  /usr/local/lib/libltdl.so.3
        libdl.so.1 =>    /lib/64/libdl.so.1
        libsocket.so.1 =>        /lib/64/libsocket.so.1
        libresolv.so.2 =>        /lib/64/libresolv.so.2
        libc.so.1 =>     /lib/64/libc.so.1
        libgcc_s.so.1 =>         /usr/sfw/lib/libgcc_s.so.1  - wrong ELF
class: ELFCLASS32
        libmp.so.2 =>    /lib/64/libmp.so.2
        libmd.so.1 =>    /lib/64/libmd.so.1
        libscf.so.1 =>   /lib/64/libscf.so.1
        libgcc_s.so.1 =>         /usr/sfw/lib/libgcc_s.so.1  - wrong ELF
class: ELFCLASS32
        libdoor.so.1 =>  /lib/64/libdoor.so.1
        libuutil.so.1 =>         /lib/64/libuutil.so.1
        libgen.so.1 =>   /lib/64/libgen.so.1
        libm.so.2 =>     /lib/64/libm.so.2
        /platform/SUNW,Sun-Fire-V210/lib/sparcv9/libc_psr.so.1
        /platform/SUNW,Sun-Fire-V210/lib/sparcv9/libmd_psr.so.1


The problem appears to be the /usr/sfw/lib stuff.  If the system instead
chose to link against the /usr/sfw/lib/sparcv9 libraries, then it would
work.  I'm going to try to hack that in tomorrow, but would appreciate
any pointers to past experience with getting 64-bit sparcv9 working!

--
Thanks!
Matt Ball, Staff Engineer, Sun Microsystems, Inc.
500 Eldorado Blvd, Bldg 5, Broomfield, CO 80021
Office: 303-272-7580  Cell: 303-717-2717  Fax: 303-272-3023

_______________________________________________
opensc-devel mailing list
opensc-devel@...
http://www.opensc-project.org/mailman/listinfo/opensc-devel

Re: How do you build OpenSC for 64-bit Solaris Sparcv9?

by Douglas E. Engert :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

The building of both 32 and 64 bit versions of programs and libs
on various OSes might be a good modification for OpenSC 0.12...

Matthew Ball wrote:
> Hi Folks,
>
> I'm trying to build OpenSC for the 64-bit Sparcv9 target on Solaris 10,
> and am running into various issues.
>
> Before diving into details, is there a good instruction guide for
> selecting 64-bit sparcv9 when running configure?

Not that I know of. Sounds like you are on the right track,
In place of the pkg, you can set a number of *_LIBS and *_CFLAGS
for OPENSSL, ZLIB, PCSC, LTLIB to point to 64 bit versions.

And/or LDFLAGS could include -L/usr/sfw/lib/sparcv9
You may also want to configure with --bindir, --sbindir --libexecdir
to store your 64 bit versions in a sparc9 subdirectory too.

>
> Here's my story (so far):
>
> Not knowing better, I just tried the obvious approach of doing an
> 'export CFLAGS="-m64"' before running ./configure.  This worked until
> getting a link error against libltdl.  On my Solaris system, libltdl is
> installed at /opt/csw/share/libtool for the source and /opt/csw/lib for
> the library (libltdl.so).  Unfortunately, the Blastwave libtool package
> seems to only install a 32-bit version of the libltdl.so library, so I
> went ahead and reconfigured the source at /opt/csw/share/libtool to
> build a 64-bit target (by again setting CFLAGS="-m64" before running
> ./configure).
>
> After that, I was able to point the LTLIB environment variables at the
> new ltdl setup.
>
> export LTLIB_LIBS="-L/new/ltdl/lib/path -lltdl"
> export LTLIB_CFLAGS="-I/opt/csw/share/libtool/libltdl"
> export CFLAGS="-m64"
> ./configure
>
> This seemed to work okay, but when I attempted to run the pkcs11-spy.so
> library, I got a 32-bit link error.  Here's the ldd of pkcs11-spy.so:
>
> $ ldd libtest.so
>         libssl.so.0.9.7 =>       /usr/sfw/lib/libssl.so.0.9.7  - wrong
> ELF class: ELFCLASS32
>         libcrypto.so.0.9.7 =>    /usr/sfw/lib/libcrypto.so.0.9.7  -
> wrong ELF class: ELFCLASS32
>         libnsl.so.1 =>   /lib/64/libnsl.so.1
>         libltdl.so.3 =>  /usr/local/lib/libltdl.so.3
>         libdl.so.1 =>    /lib/64/libdl.so.1
>         libsocket.so.1 =>        /lib/64/libsocket.so.1
>         libresolv.so.2 =>        /lib/64/libresolv.so.2
>         libc.so.1 =>     /lib/64/libc.so.1
>         libgcc_s.so.1 =>         /usr/sfw/lib/libgcc_s.so.1  - wrong ELF
> class: ELFCLASS32
>         libmp.so.2 =>    /lib/64/libmp.so.2
>         libmd.so.1 =>    /lib/64/libmd.so.1
>         libscf.so.1 =>   /lib/64/libscf.so.1
>         libgcc_s.so.1 =>         /usr/sfw/lib/libgcc_s.so.1  - wrong ELF
> class: ELFCLASS32
>         libdoor.so.1 =>  /lib/64/libdoor.so.1
>         libuutil.so.1 =>         /lib/64/libuutil.so.1
>         libgen.so.1 =>   /lib/64/libgen.so.1
>         libm.so.2 =>     /lib/64/libm.so.2
>         /platform/SUNW,Sun-Fire-V210/lib/sparcv9/libc_psr.so.1
>         /platform/SUNW,Sun-Fire-V210/lib/sparcv9/libmd_psr.so.1
>
>
> The problem appears to be the /usr/sfw/lib stuff.  If the system instead
> chose to link against the /usr/sfw/lib/sparcv9 libraries, then it would
> work.  I'm going to try to hack that in tomorrow, but would appreciate
> any pointers to past experience with getting 64-bit sparcv9 working!
>

--

  Douglas E. Engert  <DEEngert@...>
  Argonne National Laboratory
  9700 South Cass Avenue
  Argonne, Illinois  60439
  (630) 252-5444
_______________________________________________
opensc-devel mailing list
opensc-devel@...
http://www.opensc-project.org/mailman/listinfo/opensc-devel

Re: How do you build OpenSC for 64-bit Solaris Sparcv9?

by Matthew Ball :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks Douglas!

See below:

On 11/06/09 08:30, Douglas E. Engert wrote:
The building of both 32 and 64 bit versions of programs and libs
on various OSes might be a good modification for OpenSC 0.12...

Matthew Ball wrote:
  
Hi Folks,

I'm trying to build OpenSC for the 64-bit Sparcv9 target on Solaris 10,
and am running into various issues.

Before diving into details, is there a good instruction guide for
selecting 64-bit sparcv9 when running configure?
    

Not that I know of. Sounds like you are on the right track,
In place of the pkg, you can set a number of *_LIBS and *_CFLAGS
for OPENSSL, ZLIB, PCSC, LTLIB to point to 64 bit versions.

And/or LDFLAGS could include -L/usr/sfw/lib/sparcv9
You may also want to configure with --bindir, --sbindir --libexecdir
to store your 64 bit versions in a sparc9 subdirectory too.

  
For the record, I got the 64-bit Solaris sparcv9 build of OpenSC 0.11.11 by doing the following:

Install libtool (in this example, using pkgutil):

sudo pkgutil -y -u libtool

This installed the 1.5.26 (2008.12.22) version of libtool from BlastWave on my system, in the /opt/csw directory.  Unfortunately, this version doesn't seem to include the 64-bit versions of the libraries, so I had to build them myself (in this example, using BASH):

cp -r /opt/csw/share/libtool /myworkdir
cd /myworkdir/libtool/libltdl
export CFLAGS='-m64'
export LDFLAGS='-L/usr/sfw/lib/sparcv9 -R/usr/sfw/lib/sparcv9'

./configure --prefix=/opt/csw --bindir=/opt/csw/bin/sparcv9 --sbindir=/opt/csw/sbin/sparcv9 --libexecdir=/opt/csw/libexec/sparcv9 --libdir=/opt/csw/lib/sparcv9

make && sudo make install

Next, I installed opensc (to /opt/opensc):

gtar xvzf opensc-0.11.11.tar.gz
cd opensc-0.11.11
export CFLAGS="-m64"
export LDFLAGS='-L/usr/sfw/lib/sparcv9 -R/usr/sfw/lib/sparcv9'
./configure --prefix=/opt/opensc --bindir=/opt/opensc/bin/sparcv9 --sbindir=/opt/opensc/sbin/sparcv9 --libexecdir=/opt/opensc/libexec/sparcv9 --libdir=/opt/opensc/lib/sparcv9
dmake
cp etc/opensc.conf.in etc/opensc.conf
sudo make install

I didn't need to set the LTLIB_CFLAGS and LTLIB_LIBS environment variables this time, having installed the sparcv9 version of libtool in locations that the configure script could find.

An ldd on pkcs11-spy.so shows that the libraries are all correctly linked to 64-bit sparcv9 versions:

$ ldd /opt/opensc/lib/sparcv9/pkcs11-spy.so
        libssl.so.0.9.7 =>       /usr/sfw/lib/sparcv9/libssl.so.0.9.7
        libcrypto.so.0.9.7 =>    /usr/sfw/lib/sparcv9/libcrypto.so.0.9.7
        libnsl.so.1 =>   /lib/64/libnsl.so.1
        libltdl.so.3 =>  /usr/local/lib/libltdl.so.3
        libdl.so.1 =>    /lib/64/libdl.so.1
        libsocket.so.1 =>        /lib/64/libsocket.so.1
        libresolv.so.2 =>        /lib/64/libresolv.so.2
        libc.so.1 =>     /lib/64/libc.so.1
        libgcc_s.so.1 =>         /usr/sfw/lib/sparcv9/libgcc_s.so.1
        libmp.so.2 =>    /lib/64/libmp.so.2
        libmd.so.1 =>    /lib/64/libmd.so.1
        libscf.so.1 =>   /lib/64/libscf.so.1
        libdoor.so.1 =>  /lib/64/libdoor.so.1
        libuutil.so.1 =>         /lib/64/libuutil.so.1
        libgen.so.1 =>   /lib/64/libgen.so.1
        libssl_extra.so.0.9.7 =>         /usr/sfw/lib/sparcv9/libssl_extra.so.0.9.7
        libcrypto_extra.so.0.9.7 =>      /usr/sfw/lib/sparcv9/libcrypto_extra.so.0.9.7
        libm.so.2 =>     /lib/64/libm.so.2
        /platform/SUNW,Sun-Fire-V210/lib/sparcv9/libc_psr.so.1
        /platform/SUNW,Sun-Fire-V210/lib/sparcv9/libmd_psr.so.1


Cheers,
-Matt


  
Here's my story (so far):

Not knowing better, I just tried the obvious approach of doing an
'export CFLAGS="-m64"' before running ./configure.  This worked until
getting a link error against libltdl.  On my Solaris system, libltdl is
installed at /opt/csw/share/libtool for the source and /opt/csw/lib for
the library (libltdl.so).  Unfortunately, the Blastwave libtool package
seems to only install a 32-bit version of the libltdl.so library, so I
went ahead and reconfigured the source at /opt/csw/share/libtool to
build a 64-bit target (by again setting CFLAGS="-m64" before running
./configure).

After that, I was able to point the LTLIB environment variables at the
new ltdl setup.

export LTLIB_LIBS="-L/new/ltdl/lib/path -lltdl"
export LTLIB_CFLAGS="-I/opt/csw/share/libtool/libltdl"
export CFLAGS="-m64"
./configure

This seemed to work okay, but when I attempted to run the pkcs11-spy.so
library, I got a 32-bit link error.  Here's the ldd of pkcs11-spy.so:

$ ldd libtest.so
        libssl.so.0.9.7 =>       /usr/sfw/lib/libssl.so.0.9.7  - wrong
ELF class: ELFCLASS32
        libcrypto.so.0.9.7 =>    /usr/sfw/lib/libcrypto.so.0.9.7  -
wrong ELF class: ELFCLASS32
        libnsl.so.1 =>   /lib/64/libnsl.so.1
        libltdl.so.3 =>  /usr/local/lib/libltdl.so.3
        libdl.so.1 =>    /lib/64/libdl.so.1
        libsocket.so.1 =>        /lib/64/libsocket.so.1
        libresolv.so.2 =>        /lib/64/libresolv.so.2
        libc.so.1 =>     /lib/64/libc.so.1
        libgcc_s.so.1 =>         /usr/sfw/lib/libgcc_s.so.1  - wrong ELF
class: ELFCLASS32
        libmp.so.2 =>    /lib/64/libmp.so.2
        libmd.so.1 =>    /lib/64/libmd.so.1
        libscf.so.1 =>   /lib/64/libscf.so.1
        libgcc_s.so.1 =>         /usr/sfw/lib/libgcc_s.so.1  - wrong ELF
class: ELFCLASS32
        libdoor.so.1 =>  /lib/64/libdoor.so.1
        libuutil.so.1 =>         /lib/64/libuutil.so.1
        libgen.so.1 =>   /lib/64/libgen.so.1
        libm.so.2 =>     /lib/64/libm.so.2
        /platform/SUNW,Sun-Fire-V210/lib/sparcv9/libc_psr.so.1
        /platform/SUNW,Sun-Fire-V210/lib/sparcv9/libmd_psr.so.1


The problem appears to be the /usr/sfw/lib stuff.  If the system instead
chose to link against the /usr/sfw/lib/sparcv9 libraries, then it would
work.  I'm going to try to hack that in tomorrow, but would appreciate
any pointers to past experience with getting 64-bit sparcv9 working!

    

  

-- 
Thanks!
Matt Ball, Staff Engineer, Sun Microsystems, Inc.
500 Eldorado Blvd, Bldg 5, Broomfield, CO 80021
Office: 303-272-7580  Cell: 303-717-2717  Fax: 303-272-3023

_______________________________________________
opensc-devel mailing list
opensc-devel@...
http://www.opensc-project.org/mailman/listinfo/opensc-devel