From 2e70a8df3c5d63219ecd1ac9bbeac8e02773d4d9 Mon Sep 17 00:00:00 2001 From: "rsleevi@chromium.org" Date: Thu, 28 Feb 2013 22:13:00 +0000 Subject: Support building NSS's libssl as a component libssl is used both by net (as part of SSL) and part of content (as part of WebRTC). Built in component mode, two copies get built in, with independent global variables - thus causing the net/ initialization functions to initialize the net.dll version, rather than the content.dll version. Make libssl build as a dll in component mode (roughly). Rather than using a linker script like upstream, just export all the symbols. BUG=webrtc:1390 TEST=component builds are happy Review URL: https://chromiumcodereview.appspot.com/12383007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@185342 0039d316-1c4b-4281-b951-d872f2087c98 --- net/third_party/nss/ssl.gyp | 27 ++++++++++++++- net/third_party/nss/ssl/exports_win.def | 58 +++++++++++++++++++++++++++++++++ 2 files changed, 84 insertions(+), 1 deletion(-) create mode 100644 net/third_party/nss/ssl/exports_win.def (limited to 'net/third_party') diff --git a/net/third_party/nss/ssl.gyp b/net/third_party/nss/ssl.gyp index 548a5e3..eac82d4 100644 --- a/net/third_party/nss/ssl.gyp +++ b/net/third_party/nss/ssl.gyp @@ -22,7 +22,8 @@ 'targets': [ { 'target_name': 'libssl', - 'type': 'static_library', + 'type': '<(component)', + 'product_name': 'crssl', # Don't conflict with OpenSSL's libssl 'sources': [ 'ssl/authcert.c', 'ssl/cmpcert.c', @@ -88,6 +89,23 @@ ], 'msvs_disabled_warnings': [4018, 4244, 4267], 'conditions': [ + ['component == "shared_library"', { + 'conditions': [ + ['OS == "mac" or OS == "ios"', { + 'xcode_settings': { + 'GCC_SYMBOLS_PRIVATE_EXTERN': 'NO', + }, + }], + ['OS == "win"', { + 'sources': [ + 'ssl/exports_win.def', + ], + }], + ['os_posix == 1 and OS != "mac" and OS != "ios"', { + 'cflags!': ['-fvisibility=hidden'], + }], + ], + }], [ 'clang == 1', { 'cflags': [ # See http://crbug.com/138571#c8. In short, sslsecur.c picks up the @@ -102,6 +120,13 @@ 'XP_MACOSX', ], }], + [ 'OS == "mac"', { + 'link_settings': { + 'libraries': [ + '$(SDKROOT)/System/Library/Frameworks/Security.framework', + ], + }, + }], [ 'OS == "win"', { 'sources!': [ 'ssl/unix_err.c', diff --git a/net/third_party/nss/ssl/exports_win.def b/net/third_party/nss/ssl/exports_win.def new file mode 100644 index 0000000..848f048 --- /dev/null +++ b/net/third_party/nss/ssl/exports_win.def @@ -0,0 +1,58 @@ +; Copyright (c) 2013 The Chromium Authors. All rights reserved. +; Use of this source code is governed by a BSD-style license that can be +; found in the LICENSE file. + +LIBRARY CRSSL +EXPORTS + +NSS_CmpCertChainWCANames +NSS_FindCertKEAType +NSS_GetClientAuthData +NSS_SetDomesticPolicy +SSL_AuthCertificate +SSL_AuthCertificateHook +SSL_CipherPolicyGet +SSL_CipherPolicySet +SSL_CipherPrefGet +SSL_CipherPrefGetDefault +SSL_CipherPrefSet +SSL_CipherPrefSetDefault +SSL_ClearSessionCache +SSL_ConfigSecureServer +SSL_ConfigServerSessionIDCache +SSL_ForceHandshake +SSL_GetClientAuthDataHook +SSL_GetSessionID +SSL_HandshakeCallback +SSL_ImportFD +SSL_InvalidateSession +SSL_OptionGet +SSL_OptionGetDefault +SSL_OptionSet +SSL_OptionSetDefault +SSL_PeerCertificate +SSL_ResetHandshake +SSL_SetSockPeerID +SSL_SetURL +SSL_GetChannelInfo +SSL_GetCipherSuiteInfo +SSL_ShutdownServerSessionIDCache +SSL_GetImplementedCiphers +SSL_GetNumImplementedCiphers +SSL_HandshakeNegotiatedExtension +SSL_SetNextProtoCallback +DTLS_GetHandshakeTimeout +DTLS_ImportFD +SSL_ExportKeyingMaterial +SSL_VersionRangeSet +SSL_GetSRTPCipher +SSL_SetSRTPCiphers + +; Chromium patches +SSL_PeerCertificateChain +SSL_SetClientChannelIDCallback +SSL_GetPlatformClientAuthDataHook +SSL_HandshakeResumedSession +SSL_GetStapledOCSPResponse +SSL_RestartHandshakeAfterChannelIDReq +SSL_GetChannelBinding -- cgit v1.1