From 56451388e65441f59e4dddb39ba032eba1cb8c06 Mon Sep 17 00:00:00 2001 From: Jakub Jelen Date: Thu, 7 May 2015 10:52:35 +0200 Subject: [PATCH] Add possibility to debug undefined symbols only as optional some tokens require symbols defined by proprietal libraries, that are not available during compile time. --- opencryptoki-3.2-missing-sources-and-libraries.patch | 9 --------- opencryptoki-3.2-no-undefined.patch | 12 ++++++++++++ opencryptoki.spec | 6 ++++++ 3 files changed, 18 insertions(+), 9 deletions(-) create mode 100644 opencryptoki-3.2-no-undefined.patch diff --git a/opencryptoki-3.2-missing-sources-and-libraries.patch b/opencryptoki-3.2-missing-sources-and-libraries.patch index 5e4509f..f6d79f5 100644 --- a/opencryptoki-3.2-missing-sources-and-libraries.patch +++ b/opencryptoki-3.2-missing-sources-and-libraries.patch @@ -10,15 +10,6 @@ diff --git a/configure.in b/configure.in dnl Checks for header files. AC_DISABLE_STATIC -@@ -571,7 +571,7 @@ fi - AM_CONDITIONAL([ENABLE_PKCSCCA_MIGRATE], [test "x$enable_pkcscca_migrate" = "xyes"]) - AM_CONDITIONAL([ENABLE_PKCSEP11_MIGRATE], [test "x$enable_pkcsep11_migrate" = "xyes"]) - --CFLAGS="$CFLAGS -DPKCS64 -D_XOPEN_SOURCE=500" -+CFLAGS="$CFLAGS -DPKCS64 -D_XOPEN_SOURCE=500 -Wl,--no-undefined" - - CFLAGS+=' -DCONFIG_PATH=\"$(localstatedir)/lib/opencryptoki\" -DSBIN_PATH=\"$(sbindir)\" -DLIB_PATH=\"$(libdir)\" -DLOCKDIR_PATH=\"$(lockdir)\" -DOCK_CONFDIR=\"$(sysconfdir)/opencryptoki\"' - diff --git a/usr/lib/pkcs11/cca_stdll/cca_specific.c b/usr/lib/pkcs11/cca_stdll/cca_specific.c --- a/usr/lib/pkcs11/cca_stdll/cca_specific.c +++ b/usr/lib/pkcs11/cca_stdll/cca_specific.c diff --git a/opencryptoki-3.2-no-undefined.patch b/opencryptoki-3.2-no-undefined.patch new file mode 100644 index 0000000..200de6a --- /dev/null +++ b/opencryptoki-3.2-no-undefined.patch @@ -0,0 +1,12 @@ +diff --git a/configure.in b/configure.in +--- a/configure.in ++++ b/configure.in +@@ -571,7 +571,7 @@ fi + AM_CONDITIONAL([ENABLE_PKCSCCA_MIGRATE], [test "x$enable_pkcscca_migrate" = "xyes"]) + AM_CONDITIONAL([ENABLE_PKCSEP11_MIGRATE], [test "x$enable_pkcsep11_migrate" = "xyes"]) + +-CFLAGS="$CFLAGS -DPKCS64 -D_XOPEN_SOURCE=500" ++CFLAGS="$CFLAGS -DPKCS64 -D_XOPEN_SOURCE=500 -Wl,--no-undefined" + + CFLAGS+=' -DCONFIG_PATH=\"$(localstatedir)/lib/opencryptoki\" -DSBIN_PATH=\"$(sbindir)\" -DLIB_PATH=\"$(libdir)\" -DLOCKDIR_PATH=\"$(lockdir)\" -DOCK_CONFDIR=\"$(sysconfdir)/opencryptoki\"' + diff --git a/opencryptoki.spec b/opencryptoki.spec index ae14978..6d8e30e 100644 --- a/opencryptoki.spec +++ b/opencryptoki.spec @@ -15,6 +15,10 @@ Patch0: %{name}-2.4-group.patch Patch1: %{name}-3.2-conditional-manpages.patch # Fix missing sources and libraries in makefiles causing undefined symbols (#1193560) Patch2: %{name}-3.2-missing-sources-and-libraries.patch + +# Use --no-undefined to debug missing symbols +#Patch100: %{name}-3.2-no-undefined.patch + Requires(pre): shadow-utils coreutils sed BuildRequires: openssl-devel BuildRequires: trousers-devel @@ -181,6 +185,8 @@ configured with Enterprise PKCS#11 (EP11) firmware. %patch1 -p1 -b .man %patch2 -p1 -b .source +#%patch100 -p1 -b .no-undefined + # Upstream tarball has unnecessary executable perms set on the sources find . -name '*.[ch]' -print0 | xargs -0 chmod -x