PSARC/2016/219 Coolkey PKCS#11 provider for smartcard devices
24657612 coolkey needs to deliver 32-bit libraries
--- a/components/coolkey/Makefile Tue Sep 13 13:44:00 2016 -0700
+++ b/components/coolkey/Makefile Wed Sep 14 07:52:16 2016 -0700
@@ -43,7 +43,7 @@
# Search for "failed" in testoutput.log to see the actual failures, then
# review any failed messages to determine if the test ran successfully or not.
-BUILD_BITS= 64
+BUILD_BITS= 64_and_32
include ../../make-rules/shared-macros.mk
COMPONENT_NAME= coolkey
@@ -59,12 +59,21 @@
include $(WS_MAKE_RULES)/common.mk
# configuration related patch needs aclocal to be regenerated
-COMPONENT_PREP_ACTION +=(cd $(@D); autoconf);
+COMPONENT_PREP_ACTION += (cd $(@D); autoconf);
-# do not add the SUNWspro area to the RUNPATH
-LD_UNSET += "-R$(SPRO_VROOT)/lib/$(MACH64)"
-COMPONENT_BUILD_ENV += LD_UNSET="$(LD_UNSET)"
-COMPONENT_INSTALL_ENV += LD_UNSET="$(LD_UNSET)"
+# Do not add the SUNWspro area to the RUNPATH. Follow exactly what CC does.
+LD_UNSET.32.i386 = -R$(SPRO_VROOT)/lib
+LD_UNSET.32.sparc = -R$(SPRO_VROOT)/lib/$(MACH):$(SPRO_VROOT)/lib
+LD_UNSET.32 = $(LD_UNSET.32.$(MACH))
+LD_UNSET.64 = -R$(SPRO_VROOT)/lib/$(MACH64)
+LD_UNSET += $(LD_UNSET.$(BITS))
+COMPONENT_BUILD_ENV += LD_UNSET="$(LD_UNSET)"
+COMPONENT_INSTALL_ENV += LD_UNSET="$(LD_UNSET)"
+
+# Propagate correct LDFLAGS to the linking phase.
+LDFLAGS += $(CC_BITS)
+COMPONENT_BUILD_ARGS += LDFLAGS="$(LDFLAGS)"
+COMPONENT_INSTALL_ARGS += LDFLAGS="$(LDFLAGS)"
# requires PC/SC headers and library
CONFIGURE_ENV += PCSC_CFLAGS="-I$(USRINCDIR)/PCSC"
@@ -77,4 +86,3 @@
REQUIRED_PACKAGES += library/security/pcsc/pcsclite
REQUIRED_PACKAGES += library/zlib
REQUIRED_PACKAGES += system/library/c++-runtime
-
--- a/components/coolkey/coolkey.p5m Tue Sep 13 13:44:00 2016 -0700
+++ b/components/coolkey/coolkey.p5m Wed Sep 14 07:52:16 2016 -0700
@@ -41,4 +41,9 @@
file path=usr/lib/$(MACH64)/libckyapplet.so.1.0.0
file path=usr/lib/$(MACH64)/libcoolkeypk11.so
link path=usr/lib/$(MACH64)/libcoolkeypk11.so.1 target=libcoolkeypk11.so
+link path=usr/lib/libckyapplet.so target=libckyapplet.so.1.0.0
+link path=usr/lib/libckyapplet.so.1 target=libckyapplet.so.1.0.0
+file path=usr/lib/libckyapplet.so.1.0.0
+file path=usr/lib/libcoolkeypk11.so
+link path=usr/lib/libcoolkeypk11.so.1 target=libcoolkeypk11.so
license coolkey.license license=LGPLv2.1
--- a/components/coolkey/patches/00-configuration.patch Tue Sep 13 13:44:00 2016 -0700
+++ b/components/coolkey/patches/00-configuration.patch Wed Sep 14 07:52:16 2016 -0700
@@ -1,10 +1,11 @@
-In-house patch created to remove the /pkcs11 subdir from "pkcs11dir" definition as
-Solaris does not use that convention for its pkcs11 libraries.
+In-house patch created to remove the /pkcs11 subdir from "pkcs11dir" definition
+as Solaris does not use that convention for its pkcs11 libraries.
-Fixed erroneous blank line found in coolkeypk11.sym file creation which causes an
-error with studio compiler and sun linker.
+Fixed erroneous blank line found in coolkeypk11.sym file creation which causes
+an error with Studio compiler and Solaris linker.
-Added 64-fit flag for c++ and ld linking to solaris section of aclocal.m4
+Added proper 32-bit or 64-fit flag for C++ and ld linking to solaris section
+of aclocal.m4.
This patch is Solaris buildenv specific and may not be suitable for upstream.
@@ -65,14 +66,14 @@
clean-generic:
rm -f coolkeypk11.sym
---- ORIGINAL/./aclocal.m4 2016-06-29 00:23:04.484933583 -0400
-+++ ././aclocal.m4 2016-06-29 08:09:30.082985198 -0400
+--- a/aclocal.m4 2016-09-14 08:45:59.170910473 +0000
++++ b/aclocal.m4 2016-09-14 09:01:07.886108085 +0000
@@ -3575,7 +3575,7 @@
_LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
-+ $CC -G -m64 ${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
++ $CC $LDFLAGS -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/coolkey/patches/18-configure.in.patch Wed Sep 14 07:52:16 2016 -0700
@@ -0,0 +1,18 @@
+Upstream fixes already included in the latest community updates to coolkey v1.1.0
+
+Fixes a syntax error when running configure script.
+
+--- a/configure.in (revision 53)
++++ b/configure.in (revision 81)
+@@ -124,9 +124,9 @@
+ if test $WINDOWS -ne 1; then
+ PKG_CHECK_MODULES(NSS, nss, true, [ AC_MSG_ERROR(could not find NSS Crypto libraries) ])
+ fi
+- enable_pk11install = "yes"
++ enable_pk11install="yes"
+ else
+- enable_pk11install = "no"
++ enable_pk11install="no"
+ AC_MSG_WARN([skipping pk11install])
+ fi
+