]> granicus.if.org Git - curl/commitdiff
lib: don't export all symbols, just everything curl_*
authorW. Mark Kubacki <wmark@hurrikane.de>
Wed, 29 Nov 2017 23:43:38 +0000 (00:43 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 1 Dec 2017 09:32:28 +0000 (10:32 +0100)
Absent any 'symbol map' or script to limit what gets exported, static
linking of libraries previously resulted in a libcurl with curl's and
those other symbols being (re-)exported.

This did not happen if 'versioned symbols' were enabled (which is not
the default) because then a version script is employed.

This limits exports to everything starting in 'curl_*'., which is
what "libcurl.vers" exports.

This avoids strange side-effects such as with mixing methods
from system libraries and those erroneously offered by libcurl.

Closes #2127

lib/Makefile.am

index 151c2615e5cfe720db7678e5d600af8d02a7c89f..87c64f3a8e3d905a88a5839ccd9ec6a3b49056ee 100644 (file)
@@ -106,6 +106,8 @@ endif
 
 if CURL_LT_SHLIB_USE_VERSIONED_SYMBOLS
 libcurl_la_LDFLAGS_EXTRA += -Wl,--version-script=libcurl.vers
+else
+libcurl_la_LDFLAGS_EXTRA += -export-symbols-regex '^curl_.*'
 endif
 
 if USE_CPPFLAG_CURL_STATICLIB