summaryrefslogtreecommitdiff
path: root/libarchive/archive_hmac.c
diff options
context:
space:
mode:
authorTim Kientzle <kientzle@acm.org>2016-04-24 15:16:10 -0700
committerTim Kientzle <kientzle@acm.org>2016-04-24 15:16:10 -0700
commit11855358b842491568afd3e37203e4879c351c47 (patch)
treea747570127bdfac901a1ca835435ec60fd1ee6e1 /libarchive/archive_hmac.c
parent2f637b08f8d2622b132050c34223c8b0f668eb21 (diff)
downloadlibarchive-11855358b842491568afd3e37203e4879c351c47.tar.gz
Ensure that cryptor, hmac, and xxhash always define at least one symbol. This prevents headaches with compilers and linkers that choke on empty object files.
Diffstat (limited to 'libarchive/archive_hmac.c')
-rw-r--r--libarchive/archive_hmac.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/libarchive/archive_hmac.c b/libarchive/archive_hmac.c
index 12fca456..7857c0ff 100644
--- a/libarchive/archive_hmac.c
+++ b/libarchive/archive_hmac.c
@@ -31,6 +31,20 @@
#include "archive.h"
#include "archive_hmac_private.h"
+/*
+ * On systems that do not support any recognized crypto libraries,
+ * the archive_hmac.c file is expected to define no usable symbols.
+ *
+ * But some compilers and linkers choke on empty object files, so
+ * define a public symbol that will always exist. This could
+ * be removed someday if this file gains another always-present
+ * symbol definition.
+ */
+int __libarchive_hmac_build_hack(void) {
+ return 0;
+}
+
+
#ifdef ARCHIVE_HMAC_USE_Apple_CommonCrypto
static int