Replace single patches with a monolitic one from upstream

This commit is contained in:
Björn Esser 2018-03-31 12:23:19 +02:00
parent 7bd35c594d
commit 6d728f1390
10 changed files with 2401 additions and 562 deletions

View File

@ -1,23 +0,0 @@
From ee348492dfdd2df1d7e1c431d106dfe11edfcd86 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= <besser82@fedoraproject.org>
Date: Fri, 12 Jan 2018 22:47:44 +0100
Subject: [PATCH] Makefile: Use absolute path to built docproc
Signed-off-by: Stephan Mueller <smueller@chronox.de>
---
Makefile.am | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile.am b/Makefile.am
index f1caf3e..0a867d5 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -196,7 +196,7 @@ TEMPFILE := $(shell mktemp)
%.xml: %.tmpl lib/doc/bin/docproc$(EXEEXT)
$(SED) "s/@@LIBVERSION@@/$(VERSION)/" < $< > $(TEMPFILE)
- LIBVERSION=$(VERSION) SRCTREE=lib/ ./lib/doc/bin/docproc$(EXEEXT) doc $(TEMPFILE) > $@
+ LIBVERSION=$(VERSION) SRCTREE=lib/ $(abs_top_builddir)/lib/doc/bin/docproc$(EXEEXT) doc $(TEMPFILE) > $@
rm $(TEMPFILE)
if HAVE_DB2PDF

View File

@ -1,32 +0,0 @@
From 176c6e3d47ff63a6f51b92a05ce19857099ba74a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= <besser82@fedoraproject.org>
Date: Fri, 12 Jan 2018 22:48:27 +0100
Subject: [PATCH] Makefile: Use seperate homedirs for pdf and ps generation
Signed-off-by: Stephan Mueller <smueller@chronox.de>
---
Makefile.am | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 0a867d5..cc4d123 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -205,7 +205,7 @@ DOC_TARGETS += pdf
pdf: pdf-stamp
pdf-stamp: lib/doc/libkcapi.xml
$(MKDIR_P) doc/pdf
- db2pdf -o doc/pdf $<
+ HOME=$(abs_top_builddir)/doc/pdf db2pdf -o doc/pdf $<
mv doc/pdf/*.pdf doc
rm -r doc/pdf
touch $@
@@ -217,7 +217,7 @@ DOC_TARGETS += ps
ps: ps-stamp
ps-stamp: lib/doc/libkcapi.xml
$(MKDIR_P) doc/ps
- db2ps -o doc/ps $<
+ HOME=$(abs_top_builddir)/doc/ps db2ps -o doc/ps $<
mv doc/ps/*.ps doc
rm -r doc/ps
touch $@

View File

@ -1,197 +0,0 @@
From b9bced05dae319c6a00c2adce8953d468404a95c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= <besser82@fedoraproject.org>
Date: Sat, 13 Jan 2018 14:22:42 +0100
Subject: [PATCH] autotools: Use full path for external programs
Signed-off-by: Stephan Mueller <smueller@chronox.de>
---
Makefile.am | 68 +++++++++++++++++++++++++++++++++---------------------------
configure.ac | 35 ++++++++++++++++++-------------
2 files changed, 58 insertions(+), 45 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 66464e1..cbb1302 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -144,8 +144,11 @@ kcapi_hasher_links = sha1sum sha224sum sha256sum sha384sum sha512sum \
install-exec-hook:
(cd $(DESTDIR)$(bindir) && \
- ($(foreach link, $(kcapi_hasher_links), ln -f kcapi-hasher $(link);)) && \
- ($(foreach link, $(kcapi_hasher_links), openssl sha256 -hmac orboDeJITITejsirpADONivirpUkvarP $(link) > .$(link).hmac;)))
+ ($(foreach link, $(kcapi_hasher_links), $(LN) -f kcapi-hasher $(link);)))
+if HAVE_OPENSSL
+ (cd $(DESTDIR)$(bindir) && \
+ ($(foreach link, $(kcapi_hasher_links), $(OPENSSL) sha256 -hmac orboDeJITITejsirpADONivirpUkvarP $(link) > .$(link).hmac;)))
+endif
endif
if ENABLE_KCAPI_RNGAPP
@@ -195,7 +198,7 @@ MOSTLYCLEANFILES = $(analyze_plists)
$(analyze_plists): %.plist: %.c
@echo " CCSA " $@
- @clang --analyze $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) -Ilib/ $< -o $@
+ @$(CLANG) --analyze $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) -Ilib/ $< -o $@
scan: $(analyze_plists)
@@ -204,16 +207,19 @@ endif
if HAVE_CPPCHECK
cppcheck:
- cppcheck --enable=performance,warning,portability $(sort $(SCAN_FILES))
+ $(CPPCHECK) --enable=performance,warning,portability $(sort $(SCAN_FILES))
endif
if HAVE_MKTEMP
-TEMPFILE := $(shell mktemp)
+DOCPROC_TEMP := $(shell $(MKTEMP))
+else
+DOCPROC_TEMP := $(abs_top_builddir)/docproc.temp
+endif
%.xml: %.tmpl lib/doc/bin/docproc$(EXEEXT)
- $(SED) "s/@@LIBVERSION@@/$(VERSION)/" < $< > $(TEMPFILE)
- LIBVERSION=$(VERSION) SRCTREE=lib/ $(abs_top_builddir)/lib/doc/bin/docproc$(EXEEXT) doc $(TEMPFILE) > $@
- rm $(TEMPFILE)
+ $(SED) "s/@@LIBVERSION@@/$(VERSION)/" < $< > $(DOCPROC_TEMP)
+ LIBVERSION=$(VERSION) SRCTREE=lib/ $(abs_top_builddir)/lib/doc/bin/docproc$(EXEEXT) doc $(DOCPROC_TEMP) > $@
+ -rm $(DOCPROC_TEMP)
if HAVE_DB2PDF
DOC_TARGETS += pdf
@@ -221,10 +227,10 @@ DOC_TARGETS += pdf
pdf: pdf-stamp
pdf-stamp: lib/doc/libkcapi.xml
$(MKDIR_P) doc/pdf
- HOME=$(abs_top_builddir)/doc/pdf db2pdf -o doc/pdf $<
- mv doc/pdf/*.pdf doc
- rm -r doc/pdf
- touch $@
+ HOME=$(abs_top_builddir)/doc/pdf $(DB2PDF) -o doc/pdf $<
+ $(MV) doc/pdf/*.pdf doc
+ -rm -r doc/pdf
+ $(TOUCH) $@
endif
if HAVE_DB2PS
@@ -233,10 +239,10 @@ DOC_TARGETS += ps
ps: ps-stamp
ps-stamp: lib/doc/libkcapi.xml
$(MKDIR_P) doc/ps
- HOME=$(abs_top_builddir)/doc/ps db2ps -o doc/ps $<
- mv doc/ps/*.ps doc
- rm -r doc/ps
- touch $@
+ HOME=$(abs_top_builddir)/doc/ps $(DB2PS) -o doc/ps $<
+ $(MV) doc/ps/*.ps doc
+ -rm -r doc/ps
+ $(TOUCH) $@
endif
if HAVE_XMLTO
@@ -245,36 +251,36 @@ DOC_TARGETS += html
html: html-stamp
html-stamp: lib/doc/libkcapi.xml
$(MKDIR_P) lib/doc/html
- xmlto html -m lib/doc/stylesheet.xsl --skip-validation -o lib/doc/html/ $< 2>/dev/null
- touch $@
+ $(XMLTO) html -m lib/doc/stylesheet.xsl --skip-validation -o lib/doc/html/ $< 2>/dev/null
+ $(TOUCH) $@
DOC_TARGETS += man
man: man-stamp
man-stamp: lib/doc/libkcapi.xml
$(MKDIR_P) lib/doc/man
- xmlto man -m lib/doc/stylesheet.xsl --skip-validation -o lib/doc/man/ $< 2>/dev/null
- touch $@
+ $(XMLTO) man -m lib/doc/stylesheet.xsl --skip-validation -o lib/doc/man/ $< 2>/dev/null
+ $(TOUCH) $@
devel_manpages = lib/doc/man/*.3
man_MANS += $(devel_manpages)
$(devel_manpages): man
endif
-endif
doc: $(sort $(DOC_TARGETS))
clean-local:
- rm -f *-stamp
- rm -f lib/doc/*.xml
- rm -f lib/doc/*.pdf
- rm -f lib/doc/*.ps
- rm -rf lib/doc/man/
- rm -rf lib/doc/html/
- rm -rf doc/
- rm -rf bin/
+ -rm -f $(DOCPROC_TEMP)
+ -rm -f *-stamp
+ -rm -f lib/doc/*.xml
+ -rm -f lib/doc/*.pdf
+ -rm -f lib/doc/*.ps
+ -rm -rf lib/doc/man/
+ -rm -rf lib/doc/html/
+ -rm -rf doc/
+ -rm -rf bin/
distclean-local:
- rm -f lib/doc/Makefile*
- rm -rf autom4te.cache/
+ -rm -f lib/doc/Makefile*
+ -rm -rf autom4te.cache/
diff --git a/configure.ac b/configure.ac
index f3a2c97..6555c26 100644
--- a/configure.ac
+++ b/configure.ac
@@ -27,26 +27,33 @@ AC_CONFIG_MACRO_DIR([m4])
AX_PROG_CC_FOR_BUILD
AX_CHECK_PIE
-AC_CHECK_PROG([CLANG], [clang], [yes])
-AC_CHECK_PROG([CPPCHECK], [cppcheck], [yes])
-AC_CHECK_PROG([XMLTO], [xmlto], [yes])
-AC_CHECK_PROG([DB2PDF], [db2pdf], [yes])
-AC_CHECK_PROG([DB2PS], [db2ps], [yes])
-AC_CHECK_PROG([MKTEMP], [mktemp], [yes])
+AC_PATH_PROG([OPENSSL], [openssl])
+AC_PATH_PROG([CLANG], [clang])
+AC_PATH_PROG([CPPCHECK], [cppcheck])
+AC_PATH_PROG([XMLTO], [xmlto])
+AC_PATH_PROG([DB2PDF], [db2pdf])
+AC_PATH_PROG([DB2PS], [db2ps])
+AC_PATH_PROG([MKTEMP], [mktemp])
AC_SEARCH_LIBS(clock_gettime,rt)
AC_PROG_MKDIR_P
AC_PROG_SED
AC_PROG_INSTALL
AC_PROG_LN_S
-
-AM_CONDITIONAL([HAVE_CLANG], [test "x$CLANG" = "xyes" ])
-AM_CONDITIONAL([HAVE_CPPCHECK], [test "x$CPPCHECK" = "xyes"])
-AM_CONDITIONAL([HAVE_XMLTO], [test "x$XMLTO" = "xyes"])
-AM_CONDITIONAL([HAVE_DB2PDF], [test "x$DB2PDF" = "xyes"])
-AM_CONDITIONAL([HAVE_DB2PS], [test "x$DB2PS" = "xyes"])
-AM_CONDITIONAL([HAVE_MKTEMP], [test "x$MKTEMP" = "xyes"])
-
+AC_PATH_PROG([CP], [cp])
+AC_PATH_PROG([LN], [ln])
+AC_PATH_PROG([MV], [mv])
+AC_PATH_PROG([TOUCH], [touch])
+
+AM_CONDITIONAL([HAVE_OPENSSL], [test "x$OPENSSL" != "x"])
+AM_CONDITIONAL([HAVE_CLANG], [test "x$CLANG" != "x"])
+AM_CONDITIONAL([HAVE_CPPCHECK], [test "x$CPPCHECK" != "x"])
+AM_CONDITIONAL([HAVE_XMLTO], [test "x$XMLTO" != "x"])
+AM_CONDITIONAL([HAVE_DB2PDF], [test "x$DB2PDF" != "x"])
+AM_CONDITIONAL([HAVE_DB2PS], [test "x$DB2PS" != "x"])
+AM_CONDITIONAL([HAVE_MKTEMP], [test "x$MKTEMP" != "x"])
+
+AM_COND_IF([HAVE_OPENSSL], [], [AC_MSG_WARN([openssl not installed])])
AM_COND_IF([HAVE_CLANG], [], [AC_MSG_WARN([clang not installed])])
AM_COND_IF([HAVE_CPPCHECK], [], [AC_MSG_WARN([cppcheck not installed])])
AM_COND_IF([HAVE_XMLTO], [], [AC_MSG_WARN([xmlto not installed])])

View File

@ -1,29 +0,0 @@
From ba147c9cce460c29076968c9e9e1a3828c0e9143 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= <besser82@fedoraproject.org>
Date: Sat, 13 Jan 2018 14:30:44 +0100
Subject: [PATCH] hasher-test: Search for hmaccalc in full $PATH
Signed-off-by: Stephan Mueller <smueller@chronox.de>
---
test/hasher-test.sh | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/test/hasher-test.sh b/test/hasher-test.sh
index f82182c..65b6da0 100755
--- a/test/hasher-test.sh
+++ b/test/hasher-test.sh
@@ -99,10 +99,11 @@ do
hash=$(basename $i)
hash=${hash%%hmac}
hasher=$i
- i=$(basename $i)
+ t=$(basename $i)
+ i=$(command -v $t)
- [ ! -x "/bin/$i" ] && {
- echo_deact "hmaccalc reference application /bin/$i missing"
+ [ -z "$i" ] && {
+ echo_deact "hmaccalc reference application $t missing"
continue
}

View File

@ -1,26 +0,0 @@
From 3920f84ce07b0855827898a81969da469a57337f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= <besser82@fedoraproject.org>
Date: Sat, 17 Feb 2018 10:54:22 +0100
Subject: [PATCH] kcapi-hasher: Fix -Werror=implicit-fallthrough
Signed-off-by: Stephan Mueller <smueller@chronox.de>
---
apps/kcapi-hasher.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/apps/kcapi-hasher.c b/apps/kcapi-hasher.c
index bb4ac92..f7b056d 100644
--- a/apps/kcapi-hasher.c
+++ b/apps/kcapi-hasher.c
@@ -758,10 +758,10 @@ int main(int argc, char *argv[])
usage(argv[0]);
ret = 0;
goto out;
- }
case 7:
bsd_style = 1;
break;
+ }
break;
case 'v':

View File

@ -1,23 +0,0 @@
From 893011d755f171431a06b62bf6abd383b004d5a2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ondrej=20Mosn=C3=A1=C4=8Dek?= <omosnace@redhat.com>
Date: Mon, 19 Feb 2018 13:52:02 +0100
Subject: [PATCH] kcapi-main: Fix a copy-paste typo
Signed-off-by: Stephan Mueller <smueller@chronox.de>
---
test/kcapi-main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test/kcapi-main.c b/test/kcapi-main.c
index b73b836..68d2226 100644
--- a/test/kcapi-main.c
+++ b/test/kcapi-main.c
@@ -764,7 +764,7 @@ static void usage(void)
fprintf(stderr, "\t\t8 for PBKDF\n");
fprintf(stderr, "\t\t9 for AIO symmetric cipher algorithm\n");
fprintf(stderr, "\t\t10 for AIO AEAD cipher algorithm\n");
- fprintf(stderr, "\t\t10 for AIO asymmetric cipher algorithm\n");
+ fprintf(stderr, "\t\t11 for AIO asymmetric cipher algorithm\n");
fprintf(stderr, "\t-z --aux\tAuxiliary tests of the API\n");
fprintf(stderr, "\t-s --stream\tUse the stream API\n");
fprintf(stderr, "\t-y --largeinput\tTest long AD with AEAD cipher\n");

View File

@ -1,199 +0,0 @@
From 63855e3e2414afbe232e5ea2e4bdfb03b786344a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= <besser82@fedoraproject.org>
Date: Sat, 13 Jan 2018 13:19:47 +0100
Subject: [PATCH] autotools: Let libtool handle PIC/PIE flags
Signed-off-by: Stephan Mueller <smueller@chronox.de>
---
Makefile.am | 34 +++++++++++++++++++++++++---------
configure.ac | 5 +++--
m4/ax_check_pie.m4 | 19 +++++++++++++++++++
3 files changed, 47 insertions(+), 11 deletions(-)
create mode 100644 m4/ax_check_pie.m4
diff --git a/Makefile.am b/Makefile.am
index cc4d123..66464e1 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -5,8 +5,15 @@ lib_LTLIBRARIES = libkcapi.la
COMMON_CPPFLAGS = -Wextra -Wall -pedantic -fwrapv --param ssp-buffer-size=4 -O2 -Werror -std=gnu99
COMMON_LDFLAGS = -Wl,-z,relro,-z,now
+libtool: $(LIBTOOL_DEPS)
+ $(SHELL) ./config.status libtool
+
noinst_PROGRAMS = lib/doc/bin/docproc
+EXTRA_lib_doc_bin_docproc_DEPENDENCIES = libtool
+
+EXTRA_libkcapi_la_DEPENDENCIES = libtool
+
libkcapi_la_SOURCES = lib/cryptouser.h \
lib/internal.h \
lib/kcapi.h \
@@ -29,6 +36,7 @@ if DISABLE_LIB_MD
libkcapi_la_SOURCES +=
else
libkcapi_la_SOURCES += lib/kcapi-md.c
+
if DISABLE_LIB_KDF
libkcapi_la_SOURCES +=
else
@@ -60,7 +68,7 @@ else
libkcapi_la_SOURCES +=
endif
-libkcapi_la_CPPFLAGS = $(COMMON_CPPFLAGS) -fPIC -fvisibility=hidden
+libkcapi_la_CPPFLAGS = $(COMMON_CPPFLAGS) -fvisibility=hidden
libkcapi_la_LDFLAGS = $(COMMON_LDFLAGS) -Wl,--version-script,$(top_srcdir)/lib/version.lds -version-number `echo $(VERSION) | sed 's/\./:/g'`
SCAN_FILES = $(libkcapi_la_SOURCES)
@@ -72,28 +80,31 @@ bin_PROGRAMS =
if ENABLE_KCAPI_TEST
bin_PROGRAMS += bin/kcapi
-bin_kcapi_CPPFLAGS = $(COMMON_CPPFLAGS) -Wno-overlength-strings -pie -fPIE -g -Ilib/
+bin_kcapi_CPPFLAGS = $(COMMON_CPPFLAGS) -Wno-overlength-strings -g -Ilib/
bin_kcapi_LDFLAGS = $(COMMON_LDFLAGS)
bin_kcapi_LDADD = libkcapi.la
bin_kcapi_SOURCES = test/kcapi-main.c
+EXTRA_bin_kcapi_DEPENDENCIES = libtool
SCAN_FILES += $(bin_kcapi_SOURCES)
bin_PROGRAMS += bin/kcapi-enc-test-large
-bin_kcapi_enc_test_large_CPPFLAGS = $(COMMON_CPPFLAGS) -Wno-overlength-strings -pie -fPIE -g -Ilib/
+bin_kcapi_enc_test_large_CPPFLAGS = $(COMMON_CPPFLAGS) -Wno-overlength-strings -g -Ilib/
bin_kcapi_enc_test_large_LDFLAGS = $(COMMON_LDFLAGS)
bin_kcapi_enc_test_large_LDADD = libkcapi.la
bin_kcapi_enc_test_large_SOURCES = test/kcapi-enc-test-large.c
+EXTRA_bin_kcapi_enc_test_large_DEPENDENCIES = libtool
SCAN_FILES += $(bin_kcapi_enc_test_large_SOURCES)
bin_PROGRAMS += bin/kcapi-convenience
-bin_kcapi_convenience_CPPFLAGS = $(COMMON_CPPFLAGS) -Wno-overlength-strings -pie -fPIE -g -Ilib/
+bin_kcapi_convenience_CPPFLAGS = $(COMMON_CPPFLAGS) -Wno-overlength-strings -g -Ilib/
bin_kcapi_convenience_LDFLAGS = $(COMMON_LDFLAGS)
bin_kcapi_convenience_LDADD = libkcapi.la
bin_kcapi_convenience_SOURCES = test/kcapi-convenience.c
+EXTRA_bin_kcapi_convenience_DEPENDENCIES = libtool
SCAN_FILES += $(bin_kcapi_convenience_SOURCES)
endif
@@ -101,7 +112,7 @@ endif
if ENABLE_KCAPI_SPEED
bin_PROGRAMS += bin/kcapi-speed
-bin_kcapi_speed_CPPFLAGS = $(COMMON_CPPFLAGS) -pie -fPIE -Wno-variadic-macros -Ilib/
+bin_kcapi_speed_CPPFLAGS = $(COMMON_CPPFLAGS) -Wno-variadic-macros -Ilib/
bin_kcapi_speed_LDFLAGS = $(COMMON_LDFLAGS)
bin_kcapi_speed_LDADD = libkcapi.la
bin_kcapi_speed_SOURCES = speed-test/cryptoperf.h \
@@ -111,6 +122,7 @@ bin_kcapi_speed_SOURCES = speed-test/cryptoperf.h \
speed-test/cryptoperf-main.c \
speed-test/cryptoperf-rng.c \
speed-test/cryptoperf-skcipher.c
+EXTRA_bin_kcapi_speed_DEPENDENCIES = libtool
SCAN_FILES += $(bin_kcapi_speed_SOURCES)
endif
@@ -118,10 +130,11 @@ endif
if ENABLE_KCAPI_HASHER
bin_PROGRAMS += bin/kcapi-hasher
-bin_kcapi_hasher_CPPFLAGS = $(COMMON_CPPFLAGS) -fPIC -Ilib/
+bin_kcapi_hasher_CPPFLAGS = $(COMMON_CPPFLAGS) -Ilib/
bin_kcapi_hasher_LDFLAGS = $(COMMON_LDFLAGS) -ldl
bin_kcapi_hasher_LDADD = libkcapi.la
bin_kcapi_hasher_SOURCES = apps/kcapi-hasher.c apps/app-internal.c
+EXTRA_bin_kcapi_hasher_DEPENDENCIES = libtool
SCAN_FILES += $(bin_kcapi_hasher_SOURCES)
@@ -138,10 +151,11 @@ endif
if ENABLE_KCAPI_RNGAPP
bin_PROGRAMS += bin/kcapi-rng
-bin_kcapi_rng_CPPFLAGS = $(COMMON_CPPFLAGS) -pie -fPIE -Ilib/
+bin_kcapi_rng_CPPFLAGS = $(COMMON_CPPFLAGS) -Ilib/
bin_kcapi_rng_LDFLAGS = $(COMMON_LDFLAGS)
bin_kcapi_rng_LDADD = libkcapi.la
bin_kcapi_rng_SOURCES = apps/kcapi-rng.c apps/app-internal.c
+EXTRA_bin_kcapi_rng_DEPENDENCIES = libtool
SCAN_FILES += $(bin_kcapi_rng_SOURCES)
man_MANS += apps/kcapi-rng.1
@@ -150,10 +164,11 @@ endif
if ENABLE_KCAPI_ENCAPP
bin_PROGRAMS += bin/kcapi-enc
-bin_kcapi_enc_CPPFLAGS = $(COMMON_CPPFLAGS) -pie -fPIE -Ilib/
+bin_kcapi_enc_CPPFLAGS = $(COMMON_CPPFLAGS) -Ilib/
bin_kcapi_enc_LDFLAGS = $(COMMON_LDFLAGS)
bin_kcapi_enc_LDADD = libkcapi.la
bin_kcapi_enc_SOURCES = apps/kcapi-enc.c apps/app-internal.c
+EXTRA_bin_kcapi_enc_DEPENDENCIES = libtool
SCAN_FILES += $(bin_kcapi_enc_SOURCES)
man_MANS += apps/kcapi-enc.1
@@ -162,10 +177,11 @@ endif
if ENABLE_KCAPI_DGSTAPP
bin_PROGRAMS += bin/kcapi-dgst
-bin_kcapi_dgst_CPPFLAGS = $(COMMON_CPPFLAGS) -pie -fPIE -Ilib/
+bin_kcapi_dgst_CPPFLAGS = $(COMMON_CPPFLAGS) -Ilib/
bin_kcapi_dgst_LDFLAGS = $(COMMON_LDFLAGS)
bin_kcapi_dgst_LDADD = libkcapi.la
bin_kcapi_dgst_SOURCES = apps/kcapi-dgst.c apps/app-internal.c
+EXTRA_bin_kcapi_dgst_DEPENDENCIES = libtool
SCAN_FILES += $(bin_kcapi_dgst_SOURCES)
man_MANS += apps/kcapi-dgst.1
diff --git a/configure.ac b/configure.ac
index 245d059..f3a2c97 100644
--- a/configure.ac
+++ b/configure.ac
@@ -19,12 +19,13 @@ AC_DEFINE([KCAPI_MAJVERSION], [__KCAPI_MAJVERSION])
AC_DEFINE([KCAPI_MINVERSION], [__KCAPI_MINVERSION])
AC_DEFINE([KCAPI_PATCHLEVEL], [__KCAPI_PATCHLEVEL])
AM_INIT_AUTOMAKE([foreign])
-LT_INIT
+LT_INIT([pic-only])
+AC_SUBST([LIBTOOL_DEPS])
AC_PROG_CC
AC_CONFIG_FILES([Makefile])
-AM_PROG_LIBTOOL
AC_CONFIG_MACRO_DIR([m4])
AX_PROG_CC_FOR_BUILD
+AX_CHECK_PIE
AC_CHECK_PROG([CLANG], [clang], [yes])
AC_CHECK_PROG([CPPCHECK], [cppcheck], [yes])
diff --git a/m4/ax_check_pie.m4 b/m4/ax_check_pie.m4
new file mode 100644
index 0000000..a149af8
--- /dev/null
+++ b/m4/ax_check_pie.m4
@@ -0,0 +1,19 @@
+AC_DEFUN([AX_CHECK_PIE], [
+ AC_ARG_ENABLE([pie], AS_HELP_STRING([--disable-pie], [Disable Position-Independent Executable]), [], [enable_pie=yes])
+ AS_IF([test "x$enable_pie" = "xyes"], [
+ AC_MSG_CHECKING([if $CC supports PIE])
+ BAKLDFLAGS="$LDFLAGS"
+ BAKCFLAGS="$CFLAGS"
+ LDFLAGS="$LDFLAGS -pie"
+ CFLAGS="$CFLAGS -fpie -fPIE -DPIE"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], [
+ if $CC $CFLAGS $LDFLAGS -o conftest conftest.c 2>&1 | grep "warning: no debug symbols in executable" >/dev/null; then
+ LDFLAGS="$BAKLDFLAGS"
+ AC_MSG_RESULT(no)
+ else
+ AC_MSG_RESULT(yes)
+ fi
+ rm -f conftest conftest.c conftest.o
+ ], [LDFLAGS="$BAKLDFLAGS" ; CFLAGS="$BAKCFLAGS" ; AC_MSG_RESULT(no)])
+ ])
+])

View File

@ -1,23 +0,0 @@
From bc7c26efe5ab5c7644fac421b2fb6b1b687c4d0e Mon Sep 17 00:00:00 2001
From: Stephan Mueller <smueller@chronox.de>
Date: Sat, 13 Jan 2018 23:33:24 +0100
Subject: [PATCH] fix bash coding error
Signed-off-by: Stephan Mueller <smueller@chronox.de>
---
test/test-invocation.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test/test-invocation.sh b/test/test-invocation.sh
index 1da861b..d381330 100755
--- a/test/test-invocation.sh
+++ b/test/test-invocation.sh
@@ -125,7 +125,7 @@ make distclean > /dev/null 2>&1
# if we are on 64 bit system, test 32 bit alternative mode,
# except is has been disabled explicitly.
-if [ $(uname -m | grep -q "x86_64") && -z "$NO_32BIT_TEST" ]
+if $(uname -m | grep -q "x86_64") && [ -z "$NO_32BIT_TEST" ]
then
LDFLAGS=-m32 CFLAGS=-m32 ./configure $COMPILE_OPTS
make

File diff suppressed because it is too large Load Diff

View File

@ -79,7 +79,7 @@
Name: libkcapi
Version: %{vmajor}.%{vminor}.%{vpatch}
Release: 9%{?dist}
Release: 10%{?dist}
Summary: User space interface to the Linux Kernel Crypto API
License: BSD or GPLv2
@ -87,14 +87,7 @@ URL: http://www.chronox.de/%{name}.html
Source0: http://www.chronox.de/%{name}/%{name}-%{version}.tar.xz
Source1: http://www.chronox.de/%{name}/%{name}-%{version}.tar.xz.asc
Patch0: %{giturl}/commit/ee348492dfdd2df1d7e1c431d106dfe11edfcd86.patch#/%{name}-1.0.3-Makefile_absolute_path_docproc.patch
Patch1: %{giturl}/commit/176c6e3d47ff63a6f51b92a05ce19857099ba74a.patch#/%{name}-1.0.3-Makefile_pdftex_custom_homedir.patch
Patch2: %{giturl}/commit/63855e3e2414afbe232e5ea2e4bdfb03b786344a.patch#/%{name}-1.0.3-libtool_pic_pie.patch
Patch3: %{giturl}/commit/b9bced05dae319c6a00c2adce8953d468404a95c.patch#/%{name}-1.0.3-autotools_full_path.patch
Patch4: %{giturl}/commit/ba147c9cce460c29076968c9e9e1a3828c0e9143.patch#/%{name}-1.0.3-hasher_test_hmaccalc_path.patch
Patch5: %{giturl}/commit/bc7c26efe5ab5c7644fac421b2fb6b1b687c4d0e.patch#/%{name}-1.0.3-test_invocation_fix_bash_coding_error.patch
Patch6: %{giturl}/commit/3920f84ce07b0855827898a81969da469a57337f.patch#/%{name}-1.0.3-kcapi-hasher_fix_Werror_implicit-fallthrough.patch
Patch7: %{giturl}/commit/893011d755f171431a06b62bf6abd383b004d5a2.patch#/%{name}-1.0.3-kcapi-main_fix_copy_paste_typo.patch
Patch0: %{giturl}/compare/v1.0.3...master.patch#/%{name}-1.0.3-to_master.patch
BuildRequires: clang
BuildRequires: coreutils
@ -102,6 +95,7 @@ BuildRequires: cppcheck
BuildRequires: docbook-utils-pdf
BuildRequires: fipscheck
BuildRequires: gcc
BuildRequires: git
BuildRequires: hardlink
BuildRequires: hmaccalc
BuildRequires: libtool
@ -229,7 +223,7 @@ generators implemented in the Linux kernel from command line.
%prep
%autosetup -p 1
%autosetup -p 1 -S git
%if %{with_sysctl_tweak}
%{__cat} << EOF > README.%{distroname_ext}
@ -432,6 +426,9 @@ popd
%changelog
* Sat Mar 31 2018 Björn Esser <besser82@fedoraproject.org> - 1.0.3-10
- Replace single patches with a monolitic one from upstream
* Thu Mar 08 2018 Ondrej Mosnáček <omosnace@redhat.com> - 1.0.3-9
- Split up the replacements subpackage