Build one of NSS or BoringSSL but not both.
The libraries have some common symbols. When both are linked I observed NSS SHA1_Update called followed by BoringSSL SHA1_Final, which results in a segfault. We should only link one of these. Based off of https://review.webrtc.org/25689004/ BUG=3855 R=pthatcher@webrtc.org Review URL: https://webrtc-codereview.appspot.com/31469004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@7310 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
a21d071607
commit
5d0071fb1f
@ -30,7 +30,6 @@ config("webrtc_base_config") {
|
|||||||
config("webrtc_base_chromium_config") {
|
config("webrtc_base_chromium_config") {
|
||||||
defines = [
|
defines = [
|
||||||
"NO_MAIN_THREAD_WRAPPING",
|
"NO_MAIN_THREAD_WRAPPING",
|
||||||
"SSL_USE_NSS",
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -49,17 +48,6 @@ config("no_openssl_config") {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
config("android_config") {
|
|
||||||
defines = [ "HAVE_OPENSSL_SSL_H" ]
|
|
||||||
}
|
|
||||||
|
|
||||||
config("no_android_config") {
|
|
||||||
defines = [
|
|
||||||
"HAVE_NSS_SSL_H",
|
|
||||||
"SSL_USE_NSS_RNG",
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
config("ios_config") {
|
config("ios_config") {
|
||||||
ldflags = [
|
ldflags = [
|
||||||
#"Foundation.framework", # Already included in //build/config:default_libs.
|
#"Foundation.framework", # Already included in //build/config:default_libs.
|
||||||
@ -221,10 +209,6 @@ static_library("webrtc_base") {
|
|||||||
"nethelpers.h",
|
"nethelpers.h",
|
||||||
"network.cc",
|
"network.cc",
|
||||||
"network.h",
|
"network.h",
|
||||||
"nssidentity.cc",
|
|
||||||
"nssidentity.h",
|
|
||||||
"nssstreamadapter.cc",
|
|
||||||
"nssstreamadapter.h",
|
|
||||||
"nullsocketserver.h",
|
"nullsocketserver.h",
|
||||||
"pathutils.cc",
|
"pathutils.cc",
|
||||||
"pathutils.h",
|
"pathutils.h",
|
||||||
@ -359,7 +343,6 @@ static_library("webrtc_base") {
|
|||||||
"natsocketfactory.h",
|
"natsocketfactory.h",
|
||||||
"nattypes.cc",
|
"nattypes.cc",
|
||||||
"nattypes.h",
|
"nattypes.h",
|
||||||
"openssl.h",
|
|
||||||
"optionsfile.cc",
|
"optionsfile.cc",
|
||||||
"optionsfile.h",
|
"optionsfile.h",
|
||||||
"profiler.cc",
|
"profiler.cc",
|
||||||
@ -468,8 +451,36 @@ static_library("webrtc_base") {
|
|||||||
} else {
|
} else {
|
||||||
configs += [ "external_ssl_library" ]
|
configs += [ "external_ssl_library" ]
|
||||||
}
|
}
|
||||||
|
sources += [
|
||||||
|
"openssl.h",
|
||||||
|
"openssladapter.cc",
|
||||||
|
"openssladapter.h",
|
||||||
|
"openssldigest.cc",
|
||||||
|
"openssldigest.h",
|
||||||
|
"opensslidentity.cc",
|
||||||
|
"opensslidentity.h",
|
||||||
|
"opensslstreamadapter.cc",
|
||||||
|
"opensslstreamadapter.h",
|
||||||
|
]
|
||||||
} else {
|
} else {
|
||||||
direct_dependent_configs += [ ":no_openssl_config" ]
|
direct_dependent_configs += [ ":no_openssl_config" ]
|
||||||
|
sources += [
|
||||||
|
"nssidentity.cc",
|
||||||
|
"nssidentity.h",
|
||||||
|
"nssstreamadapter.cc",
|
||||||
|
"nssstreamadapter.h",
|
||||||
|
]
|
||||||
|
if (is_mac || is_ios || is_win) {
|
||||||
|
if (rtc_build_ssl) {
|
||||||
|
deps += [
|
||||||
|
"//net/third_party/nss/ssl:libssl",
|
||||||
|
"//third_party/nss:nspr",
|
||||||
|
"//third_party/nss:nss",
|
||||||
|
]
|
||||||
|
} else {
|
||||||
|
configs += [ "external_ssl_library" ]
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_android) {
|
if (is_android) {
|
||||||
@ -478,24 +489,14 @@ static_library("webrtc_base") {
|
|||||||
"ifaddrs-android.h",
|
"ifaddrs-android.h",
|
||||||
]
|
]
|
||||||
|
|
||||||
direct_dependent_configs += [ ":android_config" ]
|
|
||||||
|
|
||||||
libs += [
|
libs += [
|
||||||
"log",
|
"log",
|
||||||
"GLESv2"
|
"GLESv2"
|
||||||
]
|
]
|
||||||
} else {
|
|
||||||
direct_dependent_configs += [ ":no_android_config" ]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_ios) {
|
if (is_ios) {
|
||||||
all_dependent_configs += [ ":ios_config" ]
|
all_dependent_configs += [ ":ios_config" ]
|
||||||
|
|
||||||
if (rtc_build_ssl) {
|
|
||||||
deps += [ "//net/third_party/nss/ssl:libssl" ]
|
|
||||||
} else {
|
|
||||||
configs += [ "external_ssl_library" ]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (use_x11) {
|
if (use_x11) {
|
||||||
@ -536,10 +537,6 @@ static_library("webrtc_base") {
|
|||||||
|
|
||||||
all_dependent_configs = [ ":mac_config" ]
|
all_dependent_configs = [ ":mac_config" ]
|
||||||
|
|
||||||
libs += [
|
|
||||||
"crypto", # $(SDKROOT)/usr/lib/libcrypto.dylib
|
|
||||||
"ssl", # $(SDKROOT)/usr/lib/libssl.dylib
|
|
||||||
]
|
|
||||||
if (cpu_arch == "x86") {
|
if (cpu_arch == "x86") {
|
||||||
all_dependent_configs += [ ":mac_x86_config" ]
|
all_dependent_configs += [ ":mac_x86_config" ]
|
||||||
}
|
}
|
||||||
@ -590,20 +587,6 @@ static_library("webrtc_base") {
|
|||||||
defines += [ "CARBON_DEPRECATED=YES" ]
|
defines += [ "CARBON_DEPRECATED=YES" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!is_ios) {
|
|
||||||
sources += [
|
|
||||||
"openssl.h",
|
|
||||||
"openssladapter.cc",
|
|
||||||
"openssladapter.h",
|
|
||||||
"openssldigest.cc",
|
|
||||||
"openssldigest.h",
|
|
||||||
"opensslidentity.cc",
|
|
||||||
"opensslidentity.h",
|
|
||||||
"opensslstreamadapter.cc",
|
|
||||||
"opensslstreamadapter.h",
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
if (is_linux || is_android) {
|
if (is_linux || is_android) {
|
||||||
sources += [
|
sources += [
|
||||||
"linux.cc",
|
"linux.cc",
|
||||||
@ -611,18 +594,6 @@ static_library("webrtc_base") {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_mac || is_ios || is_win) {
|
|
||||||
if (rtc_build_ssl) {
|
|
||||||
deps += [
|
|
||||||
"//net/third_party/nss/ssl:libssl",
|
|
||||||
"//third_party/nss:nspr",
|
|
||||||
"//third_party/nss:nss",
|
|
||||||
]
|
|
||||||
} else {
|
|
||||||
configs += [ "external_ssl_library" ]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (is_posix && !is_mac && !is_ios && !is_android) {
|
if (is_posix && !is_mac && !is_ios && !is_android) {
|
||||||
if (build_with_chromium) {
|
if (build_with_chromium) {
|
||||||
deps += [ "//crypto:platform" ]
|
deps += [ "//crypto:platform" ]
|
||||||
|
@ -192,20 +192,7 @@
|
|||||||
'nethelpers.h',
|
'nethelpers.h',
|
||||||
'network.cc',
|
'network.cc',
|
||||||
'network.h',
|
'network.h',
|
||||||
'nssidentity.cc',
|
|
||||||
'nssidentity.h',
|
|
||||||
'nssstreamadapter.cc',
|
|
||||||
'nssstreamadapter.h',
|
|
||||||
'nullsocketserver.h',
|
'nullsocketserver.h',
|
||||||
'openssl.h',
|
|
||||||
'openssladapter.cc',
|
|
||||||
'openssladapter.h',
|
|
||||||
'openssldigest.cc',
|
|
||||||
'openssldigest.h',
|
|
||||||
'opensslidentity.cc',
|
|
||||||
'opensslidentity.h',
|
|
||||||
'opensslstreamadapter.cc',
|
|
||||||
'opensslstreamadapter.h',
|
|
||||||
'optionsfile.cc',
|
'optionsfile.cc',
|
||||||
'optionsfile.h',
|
'optionsfile.h',
|
||||||
'pathutils.cc',
|
'pathutils.cc',
|
||||||
@ -421,7 +408,6 @@
|
|||||||
'natsocketfactory.h',
|
'natsocketfactory.h',
|
||||||
'nattypes.cc',
|
'nattypes.cc',
|
||||||
'nattypes.h',
|
'nattypes.h',
|
||||||
'openssl.h',
|
|
||||||
'optionsfile.cc',
|
'optionsfile.cc',
|
||||||
'optionsfile.h',
|
'optionsfile.h',
|
||||||
'posix.cc',
|
'posix.cc',
|
||||||
@ -464,12 +450,10 @@
|
|||||||
],
|
],
|
||||||
'defines': [
|
'defines': [
|
||||||
'NO_MAIN_THREAD_WRAPPING',
|
'NO_MAIN_THREAD_WRAPPING',
|
||||||
'SSL_USE_NSS',
|
|
||||||
],
|
],
|
||||||
'direct_dependent_settings': {
|
'direct_dependent_settings': {
|
||||||
'defines': [
|
'defines': [
|
||||||
'NO_MAIN_THREAD_WRAPPING',
|
'NO_MAIN_THREAD_WRAPPING',
|
||||||
'SSL_USE_NSS',
|
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
}, {
|
}, {
|
||||||
@ -509,6 +493,17 @@
|
|||||||
'HAVE_OPENSSL_SSL_H',
|
'HAVE_OPENSSL_SSL_H',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
'sources': [
|
||||||
|
'openssl.h',
|
||||||
|
'openssladapter.cc',
|
||||||
|
'openssladapter.h',
|
||||||
|
'openssldigest.cc',
|
||||||
|
'openssldigest.h',
|
||||||
|
'opensslidentity.cc',
|
||||||
|
'opensslidentity.h',
|
||||||
|
'opensslstreamadapter.cc',
|
||||||
|
'opensslstreamadapter.h',
|
||||||
|
],
|
||||||
'conditions': [
|
'conditions': [
|
||||||
['build_ssl==1', {
|
['build_ssl==1', {
|
||||||
'dependencies': [
|
'dependencies': [
|
||||||
@ -521,6 +516,12 @@
|
|||||||
}],
|
}],
|
||||||
],
|
],
|
||||||
}, {
|
}, {
|
||||||
|
'sources': [
|
||||||
|
'nssidentity.cc',
|
||||||
|
'nssidentity.h',
|
||||||
|
'nssstreamadapter.cc',
|
||||||
|
'nssstreamadapter.h',
|
||||||
|
],
|
||||||
'conditions': [
|
'conditions': [
|
||||||
['use_legacy_ssl_defaults!=1', {
|
['use_legacy_ssl_defaults!=1', {
|
||||||
'defines': [
|
'defines': [
|
||||||
@ -536,6 +537,21 @@
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
}],
|
}],
|
||||||
|
['OS=="mac" or OS=="ios" or OS=="win"', {
|
||||||
|
'conditions': [
|
||||||
|
['build_ssl==1', {
|
||||||
|
'dependencies': [
|
||||||
|
'<(DEPTH)/net/third_party/nss/ssl.gyp:libssl',
|
||||||
|
'<(DEPTH)/third_party/nss/nss.gyp:nspr',
|
||||||
|
'<(DEPTH)/third_party/nss/nss.gyp:nss',
|
||||||
|
],
|
||||||
|
}, {
|
||||||
|
'include_dirs': [
|
||||||
|
'<(ssl_root)',
|
||||||
|
],
|
||||||
|
}],
|
||||||
|
],
|
||||||
|
}],
|
||||||
],
|
],
|
||||||
}],
|
}],
|
||||||
['OS == "android"', {
|
['OS == "android"', {
|
||||||
@ -584,17 +600,6 @@
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
'conditions': [
|
|
||||||
['build_ssl==1', {
|
|
||||||
'dependencies': [
|
|
||||||
'<(DEPTH)/net/third_party/nss/ssl.gyp:libssl',
|
|
||||||
]
|
|
||||||
}, {
|
|
||||||
'include_dirs': [
|
|
||||||
'<(ssl_root)',
|
|
||||||
],
|
|
||||||
}],
|
|
||||||
],
|
|
||||||
}],
|
}],
|
||||||
['use_x11 == 1', {
|
['use_x11 == 1', {
|
||||||
'link_settings': {
|
'link_settings': {
|
||||||
@ -645,12 +650,6 @@
|
|||||||
],
|
],
|
||||||
}],
|
}],
|
||||||
['OS=="mac"', {
|
['OS=="mac"', {
|
||||||
'link_settings': {
|
|
||||||
'libraries': [
|
|
||||||
'$(SDKROOT)/usr/lib/libcrypto.dylib',
|
|
||||||
'$(SDKROOT)/usr/lib/libssl.dylib',
|
|
||||||
],
|
|
||||||
},
|
|
||||||
'all_dependent_settings': {
|
'all_dependent_settings': {
|
||||||
'link_settings': {
|
'link_settings': {
|
||||||
'xcode_settings': {
|
'xcode_settings': {
|
||||||
@ -750,40 +749,12 @@
|
|||||||
'scoped_autorelease_pool.mm',
|
'scoped_autorelease_pool.mm',
|
||||||
],
|
],
|
||||||
}],
|
}],
|
||||||
['OS=="ios"', {
|
|
||||||
'sources!': [
|
|
||||||
'openssl.h',
|
|
||||||
'openssladapter.cc',
|
|
||||||
'openssladapter.h',
|
|
||||||
'openssldigest.cc',
|
|
||||||
'openssldigest.h',
|
|
||||||
'opensslidentity.cc',
|
|
||||||
'opensslidentity.h',
|
|
||||||
'opensslstreamadapter.cc',
|
|
||||||
'opensslstreamadapter.h',
|
|
||||||
],
|
|
||||||
}],
|
|
||||||
['OS!="linux" and OS!="android"', {
|
['OS!="linux" and OS!="android"', {
|
||||||
'sources!': [
|
'sources!': [
|
||||||
'linux.cc',
|
'linux.cc',
|
||||||
'linux.h',
|
'linux.h',
|
||||||
],
|
],
|
||||||
}],
|
}],
|
||||||
['OS == "mac" or OS == "ios" or OS == "win"', {
|
|
||||||
'conditions': [
|
|
||||||
['build_ssl==1', {
|
|
||||||
'dependencies': [
|
|
||||||
'<(DEPTH)/net/third_party/nss/ssl.gyp:libssl',
|
|
||||||
'<(DEPTH)/third_party/nss/nss.gyp:nspr',
|
|
||||||
'<(DEPTH)/third_party/nss/nss.gyp:nss',
|
|
||||||
],
|
|
||||||
}, {
|
|
||||||
'include_dirs': [
|
|
||||||
'<(ssl_root)',
|
|
||||||
],
|
|
||||||
}],
|
|
||||||
],
|
|
||||||
}],
|
|
||||||
['os_posix == 1 and OS != "mac" and OS != "ios" and OS != "android"', {
|
['os_posix == 1 and OS != "mac" and OS != "ios" and OS != "android"', {
|
||||||
'conditions': [
|
'conditions': [
|
||||||
['build_ssl==1', {
|
['build_ssl==1', {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user