我正在尝试用WebRTC M85编译OpenSSL,并且我必须编辑一些BUILD.gn文件来将硬编码的依赖项修改为BoringSSL。
命令行类似于(简化):
gn gen "intermediate/" --args="target_cpu=\"x64\" rtc_build_ssl=false rtc_ssl_root=\"path/to/openssl/include\""但当它运行时,我会收到以下错误:
ERROR at //third_party/libsrtp/BUILD.gn:118:7: Undefined identifier
if (rtc_build_ssl) {
^------------
See //pc/BUILD.gn:135:15: which caused the file to be included.
deps += [ "//third_party/libsrtp" ]第三方/libsrtp/BUILD.gn中的代码:
static_library("libsrtp") {
...
if (rtc_build_ssl) {
public_deps += [ "//third_party/boringssl:boringssl" ]
}
}第三方/libsrtp/BUILD.gn通过pc/BUILD.gn调用:
rtc_library("rtc_pc_base") {
visibility = [ "*" ]
...
if (rtc_build_libsrtp) {
deps += [ "//third_party/libsrtp" ]
}
}并且pc/BUILD.gn直接加载在根BUILD.gn中:
if (!build_with_chromium) {
# Target to build all the WebRTC production code.
rtc_static_library("webrtc") {
deps = [
":webrtc_common",
"api:create_peerconnection_factory",
...
"pc:libjingle_peerconnection",
"pc:peerconnection",
"pc:rtc_pc",
"pc:rtc_pc_base",
"rtc_base",
...
]
}
}因此,在rtc_build_ssl文件中其他地方工作的参数BUILD.gn似乎没有填充到这个第三方/libsrtp/BUILD.gn
我对GN文件并不熟悉,为了使参数保持在子包含的文件中,有什么需要添加的吗?
发布于 2022-10-20 18:21:17
你的版本是什么?我无法在m86,m96中使用openssl构建webrtc。您可以在out//obj/第三方/libsrtp.ninjia中更改忍者文件。例如,我在应用程序的链接中出现了这种错误。
root@ubuntu:~/webrtc/webrtc-checkout/src$ gn gen out/Release --args="is_debug=false use_custom_libcxx=false use_sysroot=false rtc_include_tests=false rtc_build_ssl=false rtc_builtin_ssl_root_certificates=false rtc_ssl_root=\"/usr/include\""
Done. Made 1116 targets from 268 files in 623ms
root@ubuntu:~/webrtc/webrtc-checkout/src$ ninja -C out/Release
ninja: Entering directory `out/Release'
[2442/2576] LINK ./stun_prober
FAILED: stun_prober
python3 "../../build/toolchain/gcc_link_wrapper.py" --output="./stun_prober" -- ../../third_party/llvm-build/Release+Asserts/bin/clang++ -fuse-ld=lld -Wl,--fatal-warnings -Wl,--build-id -fPIC -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--icf=all -Wl,--color-diagnostics -Wl,--no-call-graph-profile-sort -m64 -no-canonical-prefixes -Werror -Wl,-O2 -Wl,--gc-sections -rdynamic -Wl,-z,defs -Wl,--as-needed -pie -Wl,--disable-new-dtags -o "./stun_prober" -Wl,--start-group @"./stun_prober.rsp" -Wl,--end-group -latomic -ldl -lpthread -lrt -lX11
ld.lld: error: undefined symbol: RAND_bytes
>>> referenced by helpers.cc
>>> rtc_base/helpers.o:(rtc::SecureRandomGenerator::Generate(void*, unsigned long)) in archive obj/rtc_base/librtc_base.a
ld.lld: error: undefined symbol: EVP_MD_CTX_new
>>> referenced by openssl_digest.cc
>>> rtc_base/openssl_digest.o:(rtc::OpenSSLDigest::OpenSSLDigest(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)) in archive obj/rtc_base/librtc_base.a
ld.lld: error: undefined symbol: EVP_MD_CTX_reset
>>> referenced by openssl_digest.cc
>>> rtc_base/openssl_digest.o:(rtc::OpenSSLDigest::OpenSSLDigest(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)) in archive obj/rtc_base/librtc_base.a
ld.lld: error: undefined symbol: EVP_DigestInit_ex
>>> referenced by openssl_digest.cc
>>> rtc_base/openssl_digest.o:(rtc::OpenSSLDigest::OpenSSLDigest(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)) in archive obj/rtc_base/librtc_base.a
>>> referenced by openssl_digest.cc
>>> rtc_base/openssl_digest.o:(rtc::OpenSSLDigest::Finish(void*, unsigned long)) in archive obj/rtc_base/librtc_base.a
ld.lld: error: undefined symbol: EVP_md5
>>> referenced by openssl_digest.cc
>>> rtc_base/openssl_digest.o:(rtc::OpenSSLDigest::GetDigestEVP(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, evp_md_st const**)) in archive obj/rtc_base/librtc_base.a
ld.lld: error: undefined symbol: EVP_sha1
>>> referenced by openssl_digest.cc
>>> rtc_base/openssl_digest.o:(rtc::OpenSSLDigest::GetDigestEVP(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, evp_md_st const**)) in archive obj/rtc_base/librtc_base.a
ld.lld: error: undefined symbol: EVP_sha224
>>> referenced by openssl_digest.cc
>>> rtc_base/openssl_digest.o:(rtc::OpenSSLDigest::GetDigestEVP(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, evp_md_st const**)) in archive obj/rtc_base/librtc_base.a
ld.lld: error: undefined symbol: EVP_sha256
>>> referenced by openssl_digest.cc
>>> rtc_base/openssl_digest.o:(rtc::OpenSSLDigest::GetDigestEVP(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, evp_md_st const**)) in archive obj/rtc_base/librtc_base.a
ld.lld: error: undefined symbol: EVP_sha384
>>> referenced by openssl_digest.cc
>>> rtc_base/openssl_digest.o:(rtc::OpenSSLDigest::GetDigestEVP(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, evp_md_st const**)) in archive obj/rtc_base/librtc_base.a
ld.lld: error: undefined symbol: EVP_sha512
>>> referenced by openssl_digest.cc
>>> rtc_base/openssl_digest.o:(rtc::OpenSSLDigest::GetDigestEVP(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, evp_md_st const**)) in archive obj/rtc_base/librtc_base.a
ld.lld: error: undefined symbol: EVP_MD_CTX_free
>>> referenced by openssl_digest.cc
>>> rtc_base/openssl_digest.o:(rtc::OpenSSLDigest::~OpenSSLDigest()) in archive obj/rtc_base/librtc_base.a
>>> referenced by openssl_digest.cc
>>> rtc_base/openssl_digest.o:(rtc::OpenSSLDigest::~OpenSSLDigest()) in archive obj/rtc_base/librtc_base.a
ld.lld: error: undefined symbol: EVP_MD_size
>>> referenced by openssl_digest.cc
>>> rtc_base/openssl_digest.o:(rtc::OpenSSLDigest::Size() const) in archive obj/rtc_base/librtc_base.a
>>> referenced by openssl_digest.cc
>>> rtc_base/openssl_digest.o:(rtc::OpenSSLDigest::Finish(void*, unsigned long)) in archive obj/rtc_base/librtc_base.a
>>> referenced by openssl_certificate.cc
>>> rtc_base/openssl_certificate.o:(rtc::OpenSSLCertificate::ComputeDigest(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned char*, unsigned long, unsigned long*) const) in archive obj/rtc_base/librtc_base.a
ld.lld: error: undefined symbol: EVP_DigestUpdate
>>> referenced by openssl_digest.cc
>>> rtc_base/openssl_digest.o:(rtc::OpenSSLDigest::Update(void const*, unsigned long)) in archive obj/rtc_base/librtc_base.a
ld.lld: error: undefined symbol: EVP_DigestFinal_ex
>>> referenced by openssl_digest.cc
>>> rtc_base/openssl_digest.o:(rtc::OpenSSLDigest::Finish(void*, unsigned long)) in archive obj/rtc_base/librtc_base.a
ld.lld: error: undefined symbol: OPENSSL_init_ssl
>>> referenced by openssl_adapter.cc
>>> rtc_base/openssl_adapter.o:(rtc::OpenSSLAdapter::InitializeSSL()) in archive obj/rtc_base/librtc_base.a
>>> referenced by openssl_adapter.cc
>>> rtc_base/openssl_adapter.o:(rtc::OpenSSLAdapter::InitializeSSL()) in archive obj/rtc_base/librtc_base.a
ld.lld: error: undefined symbol: ERR_load_BIO_strings
>>> referenced by openssl_adapter.cc
>>> rtc_base/openssl_adapter.o:(rtc::OpenSSLAdapter::InitializeSSL()) in archive obj/rtc_base/librtc_base.a
ld.lld: error: undefined symbol: OPENSSL_init_crypto
>>> referenced by openssl_adapter.cc
>>> rtc_base/openssl_adapter.o:(rtc::OpenSSLAdapter::InitializeSSL()) in archive obj/rtc_base/librtc_base.a
ld.lld: error: undefined symbol: RAND_poll
>>> referenced by openssl_adapter.cc
>>> rtc_base/openssl_adapter.o:(rtc::OpenSSLAdapter::InitializeSSL()) in archive obj/rtc_base/librtc_base.a
ld.lld: error: undefined symbol: SSL_CTX_up_ref
>>> referenced by openssl_adapter.cc
>>> rtc_base/openssl_adapter.o:(rtc::OpenSSLAdapter::OpenSSLAdapter(rtc::Socket*, rtc::OpenSSLSessionCache*, rtc::SSLCertificateVerifier*)) in archive obj/rtc_base/librtc_base.a
ld.lld: error: undefined symbol: SSL_free
>>> referenced by openssl_adapter.cc
>>> rtc_base/openssl_adapter.o:(rtc::OpenSSLAdapter::Cleanup()) in archive obj/rtc_base/librtc_base.a
ld.lld: error: too many errors emitted, stopping now (use -error-limit=0 to see all errors)
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
[2447/2576] CXX obj/pc/rtp_sender/rtp_sender.o
ninja: build stopped: subcommand failed.https://stackoverflow.com/questions/63304957
复制相似问题