aboutsummaryrefslogtreecommitdiff
path: root/include/openssl/lhash.h
diff options
context:
space:
mode:
authorMatthias Kraft <Matthias.Kraft@softwareag.com>2019-01-18 13:09:06 +0100
committerRichard Levitte <levitte@openssl.org>2019-01-27 10:48:58 +0100
commit6638b2214761b5f30300534e0fe522448113c6cf (patch)
tree0f54e104d65fe60d0d672008d2de90aeb2896418 /include/openssl/lhash.h
parent2c75f03b39de2fa7d006bc0f0d7c58235a54d9bb (diff)
downloadopenssl-6638b2214761b5f30300534e0fe522448113c6cf.zip
openssl-6638b2214761b5f30300534e0fe522448113c6cf.tar.gz
openssl-6638b2214761b5f30300534e0fe522448113c6cf.tar.bz2
Add "weak" declarations of symbols used in safestack.h and lhash.h
Only for SunCC for now. It turns out that some compilers to generate external variants of unused static inline functions, and if they use other external symbols, those need to be present as well. If you then happen to include one of safestack.h or lhash.h without linking with libcrypto, the build fails. Fixes #6912 Signed-off-by: Matthias Kraft <Matthias.Kraft@softwareag.com> Reviewed-by: Paul Dale <paul.dale@oracle.com> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8087)
Diffstat (limited to 'include/openssl/lhash.h')
-rw-r--r--include/openssl/lhash.h27
1 files changed, 26 insertions, 1 deletions
diff --git a/include/openssl/lhash.h b/include/openssl/lhash.h
index a142ea0..672841d 100644
--- a/include/openssl/lhash.h
+++ b/include/openssl/lhash.h
@@ -1,5 +1,5 @@
/*
- * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -210,6 +210,31 @@ DEFINE_LHASH_OF(OPENSSL_CSTRING);
# pragma warning (pop)
# endif
+/*
+ * If called without higher optimization (min. -xO3) the Oracle Developer
+ * Studio compiler generates code for the defined (static inline) functions
+ * above.
+ * This would later lead to the linker complaining about missing symbols when
+ * this header file is included but the resulting object is not linked against
+ * the Crypto library (openssl#6912).
+ */
+# ifdef __SUNPRO_C
+# pragma weak OPENSSL_LH_new
+# pragma weak OPENSSL_LH_free
+# pragma weak OPENSSL_LH_insert
+# pragma weak OPENSSL_LH_delete
+# pragma weak OPENSSL_LH_retrieve
+# pragma weak OPENSSL_LH_error
+# pragma weak OPENSSL_LH_num_items
+# pragma weak OPENSSL_LH_node_stats_bio
+# pragma weak OPENSSL_LH_node_usage_stats_bio
+# pragma weak OPENSSL_LH_stats_bio
+# pragma weak OPENSSL_LH_get_down_load
+# pragma weak OPENSSL_LH_set_down_load
+# pragma weak OPENSSL_LH_doall
+# pragma weak OPENSSL_LH_doall_arg
+# endif /* __SUNPRO_C */
+
#ifdef __cplusplus
}
#endif