aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkinichiro <kinichiro.inoguchi@gmail.com>2017-01-15 18:09:13 +0900
committerkinichiro <kinichiro.inoguchi@gmail.com>2017-01-15 22:12:39 +0900
commit1d934cd2d85872728c8e17a4f5afed5582980eb3 (patch)
tree8372fad1e7af184266826d66d72820c0c8d5403e
parent6db42999415c48d96d2498a6ac51cd233a308fd2 (diff)
downloadportable-1d934cd2d85872728c8e17a4f5afed5582980eb3.tar.gz
portable-1d934cd2d85872728c8e17a4f5afed5582980eb3.tar.bz2
portable-1d934cd2d85872728c8e17a4f5afed5582980eb3.zip
Fix to use -export-symbols for libcrypto
- generating platform specific crypto/crypto_portable.sym from crypto.sym
-rw-r--r--configure.ac2
-rw-r--r--crypto/Makefile.am3
-rw-r--r--m4/check-libc.m470
3 files changed, 74 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index f15e746..d1ad543 100644
--- a/configure.ac
+++ b/configure.ac
@@ -54,6 +54,8 @@ CHECK_CRYPTO_COMPAT
54CHECK_VA_COPY 54CHECK_VA_COPY
55CHECK_B64_NTOP 55CHECK_B64_NTOP
56 56
57GENERATE_CRYPTO_PORTABLE_SYM
58
57AC_ARG_WITH([openssldir], 59AC_ARG_WITH([openssldir],
58 AS_HELP_STRING([--with-openssldir], 60 AS_HELP_STRING([--with-openssldir],
59 [Set the default openssl directory]), 61 [Set the default openssl directory]),
diff --git a/crypto/Makefile.am b/crypto/Makefile.am
index ccbbce1..1b5198f 100644
--- a/crypto/Makefile.am
+++ b/crypto/Makefile.am
@@ -10,11 +10,12 @@ lib_LTLIBRARIES = libcrypto.la
10EXTRA_DIST = VERSION 10EXTRA_DIST = VERSION
11EXTRA_DIST += CMakeLists.txt 11EXTRA_DIST += CMakeLists.txt
12EXTRA_DIST += crypto.def 12EXTRA_DIST += crypto.def
13EXTRA_DIST += crypto.sym
13 14
14# needed for a CMake target 15# needed for a CMake target
15EXTRA_DIST += compat/strcasecmp.c 16EXTRA_DIST += compat/strcasecmp.c
16 17
17libcrypto_la_LDFLAGS = -version-info @LIBCRYPTO_VERSION@ -no-undefined 18libcrypto_la_LDFLAGS = -version-info @LIBCRYPTO_VERSION@ -no-undefined -export-symbols $(top_srcdir)/crypto/crypto_portable.sym
18libcrypto_la_LIBADD = libcompat.la 19libcrypto_la_LIBADD = libcompat.la
19if !HAVE_EXPLICIT_BZERO 20if !HAVE_EXPLICIT_BZERO
20libcrypto_la_LIBADD += libcompatnoopt.la 21libcrypto_la_LIBADD += libcompatnoopt.la
diff --git a/m4/check-libc.m4 b/m4/check-libc.m4
index 466a70e..b58f0b1 100644
--- a/m4/check-libc.m4
+++ b/m4/check-libc.m4
@@ -141,3 +141,73 @@ if test "x$ac_cv_have___va_copy" = "xyes" ; then
141 AC_DEFINE([HAVE___VA_COPY], [1], [Define if __va_copy exists]) 141 AC_DEFINE([HAVE___VA_COPY], [1], [Define if __va_copy exists])
142fi 142fi
143]) 143])
144
145AC_DEFUN([GENERATE_CRYPTO_PORTABLE_SYM], [
146crypto_sym=$srcdir/crypto/crypto.sym
147crypto_p_sym=$srcdir/crypto/crypto_portable.sym
148echo "generating $crypto_p_sym ..."
149chmod u+w $srcdir/crypto
150cp $crypto_sym $crypto_p_sym
151chmod u+w $crypto_p_sym
152if test "x$ac_cv_func_arc4random" = "xno" ; then
153 echo arc4random >> $crypto_p_sym
154fi
155if test "x$ac_cv_func_arc4random_buf" = "xno" ; then
156 echo arc4random_buf >> $crypto_p_sym
157fi
158if test "x$ac_cv_func_arc4random_uniform" = "xno" ; then
159 echo arc4random_uniform >> $crypto_p_sym
160fi
161if test "x$ac_cv_func_asprintf" = "xno" ; then
162 echo asprintf >> $crypto_p_sym
163 echo vasprintf >> $crypto_p_sym
164fi
165if test "x$ac_cv_func_explicit_bzero" = "xno" ; then
166 echo explicit_bzero >> $crypto_p_sym
167fi
168if test "x$ac_cv_func_getentropy" = "xno" ; then
169 echo getentropy >> $crypto_p_sym
170fi
171if test "x$ac_cv_func_inet_pton" = "xno" ; then
172 echo inet_pton >> $crypto_p_sym
173fi
174if test "x$ac_cv_func_reallocarray" = "xno" ; then
175 echo reallocarray >> $crypto_p_sym
176fi
177if test "x$ac_cv_func_strlcat" = "xno" ; then
178 echo strlcat >> $crypto_p_sym
179fi
180if test "x$ac_cv_func_strlcpy" = "xno" ; then
181 echo strlcpy >> $crypto_p_sym
182fi
183if test "x$ac_cv_func_strndup" = "xno" ; then
184 echo strndup >> $crypto_p_sym
185fi
186if test "x$ac_cv_func_strnlen" = "xno" ; then
187 echo strnlen >> $crypto_p_sym
188fi
189if test "x$ac_cv_func_timegm" = "xno" ; then
190 echo timegm >> $crypto_p_sym
191fi
192if test "x$ac_cv_func_timingsafe_bcmp" = "xno" ; then
193 echo timingsafe_bcmp >> $crypto_p_sym
194fi
195if test "x$ac_cv_func_timingsafe_memcmp" = "xno" ; then
196 echo timingsafe_memcmp >> $crypto_p_sym
197fi
198if test "x$HOST_OS" = "xwin" ; then
199 echo posix_perror >> $crypto_p_sym
200 echo posix_fopen >> $crypto_p_sym
201 echo posix_fgets >> $crypto_p_sym
202 echo posix_rename >> $crypto_p_sym
203 echo posix_connect >> $crypto_p_sym
204 echo posix_close >> $crypto_p_sym
205 echo posix_read >> $crypto_p_sym
206 echo posix_write >> $crypto_p_sym
207 echo posix_getsockopt >> $crypto_p_sym
208 echo posix_setsockopt >> $crypto_p_sym
209
210 grep -v BIO_s_log $crypto_p_sym > $crypto_p_sym.tmp
211 mv $crypto_p_sym.tmp $crypto_p_sym
212fi
213])