ungoogled-software / ungoogled-chromium-android

Android build for ungoogled-chromium
GNU General Public License v3.0
498 stars 43 forks source link

undefined symbol error #127

Closed chunsun21 closed 1 year ago

chunsun21 commented 2 years ago

I've encountered undefined symbol error while building.

I think I set it up wrong. Where can I look to fix it?

Thanks.

(I excuted build.sh. But, at the first time, there was no matched version of java on my pc. So I installed the java of proper version and run ninja -C with reference to build.sh.)

# ninja -C out/Default chrome_modern_public_bundle
ninja: Entering directory `out/Default'
[1/1] Regenerating ninja files
[2/8] SOLINK ./libchrome.cr.so
FAILED: libchrome.cr.so libchrome.cr.so.TOC lib.unstripped/libchrome.cr.so 
python "../../build/toolchain/gcc_solink_wrapper.py" --readelf="../../third_party/android_ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android-readelf" --nm="../../third_party/android_ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android-nm" --strip=../../buildtools/third_party/eu-strip/bin/eu-strip  --sofile="./lib.unstripped/libchrome.cr.so" --tocfile="./libchrome.cr.so.TOC" --output="./libchrome.cr.so" -- ../../../../../usr/bin/clang++ -shared -Wl,-soname="libchrome.cr.so" -Wl,--version-script=gen/chrome/android/libchrome_linker_script.txt -Wl,--build-id -fPIC -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,defs -Wl,--as-needed -fuse-ld=lld -Wl,-z,max-page-size=4096 -Wl,--color-diagnostics -Wl,--no-rosegment -Wl,--no-call-graph-profile-sort -Wl,--exclude-libs=libgcc.a -Wl,--exclude-libs=libvpx_assembly_arm.a --target=aarch64-linux-android21 -Wl,-mllvm,-enable-machine-outliner=never -Wl,--gdb-index -nostdlib++ --sysroot=../../third_party/android_ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot -B../../third_party/android_ndk/toolchains/llvm/prebuilt/linux-x86_64 -Wl,--warn-shared-textrel -Wl,-wrap,calloc -Wl,-wrap,free -Wl,-wrap,malloc -Wl,-wrap,memalign -Wl,-wrap,posix_memalign -Wl,-wrap,pvalloc -Wl,-wrap,realloc -Wl,-wrap,valloc -Wl,-wrap,realpath -Wl,-wrap,strdup -Wl,-wrap,strndup -Wl,-wrap,getcwd -Wl,--dynamic-linker,/system/bin/linker64 -o "./lib.unstripped/libchrome.cr.so" @"./libchrome.cr.so.rsp"
ld.lld: error: undefined symbol: safe_browsing::ChromePasswordProtectionService::GetWarningDetailText(safe_browsing::LoginReputationClientRequest_PasswordReuseEvent_ReusedPasswordAccountType, std::__Cr::vector<unsigned long, std::__Cr::allocator<unsigned long> >*) const
>>> referenced by password_reuse_controller_android.cc:53 (../../chrome/browser/safe_browsing/android/password_reuse_controller_android.cc:53)
>>>               browser/password_reuse_controller_android.o:(safe_browsing::PasswordReuseControllerAndroid::GetWarningDetailText(std::__Cr::vector<unsigned long, std::__Cr::allocator<unsigned long> >*) const) in archive obj/chrome/browser/libbrowser.a

ld.lld: error: undefined symbol: safe_browsing::ChromePasswordProtectionService::GetPlaceholdersForSavedPasswordWarningText() const
>>> referenced by password_reuse_controller_android.cc:63 (../../chrome/browser/safe_browsing/android/password_reuse_controller_android.cc:63)
>>>               browser/password_reuse_controller_android.o:(safe_browsing::PasswordReuseControllerAndroid::GetPlaceholdersForSavedPasswordWarningText() const) in archive obj/chrome/browser/libbrowser.a

ld.lld: error: undefined symbol: ProcessSingleton::ProcessSingleton(base::FilePath const&, base::RepeatingCallback<bool (base::CommandLine const&, base::FilePath const&)> const&)
>>> referenced by chrome_process_singleton.cc:14 (../../chrome/browser/chrome_process_singleton.cc:14)
>>>               browser/chrome_process_singleton.o:(ChromeProcessSingleton::ChromeProcessSingleton(base::FilePath const&, base::RepeatingCallback<bool (base::CommandLine const&, base::FilePath const&)> const&)) in archive obj/chrome/browser/libbrowser.a

ld.lld: error: undefined symbol: ProcessSingleton::~ProcessSingleton()
>>> referenced by chrome_process_singleton.cc:19 (../../chrome/browser/chrome_process_singleton.cc:19)
>>>               browser/chrome_process_singleton.o:(ChromeProcessSingleton::~ChromeProcessSingleton()) in archive obj/chrome/browser/libbrowser.a

ld.lld: error: undefined symbol: ProcessSingleton::NotifyOtherProcessOrCreate()
>>> referenced by chrome_process_singleton.cc:23 (../../chrome/browser/chrome_process_singleton.cc:23)
>>>               browser/chrome_process_singleton.o:(ChromeProcessSingleton::NotifyOtherProcessOrCreate()) in archive obj/chrome/browser/libbrowser.a

ld.lld: error: undefined symbol: ProcessSingleton::Cleanup()
>>> referenced by chrome_process_singleton.cc:27 (../../chrome/browser/chrome_process_singleton.cc:27)
>>>               browser/chrome_process_singleton.o:(ChromeProcessSingleton::Cleanup()) in archive obj/chrome/browser/libbrowser.a

ld.lld: error: undefined symbol: policy::path_parser::ExpandPathVariables(std::__Cr::basic_string<char, std::__Cr::char_traits<char>, std::__Cr::allocator<char> > const&)
>>> referenced by download_dir_policy_handler.cc:69 (../../chrome/browser/download/download_dir_policy_handler.cc:69)
>>>               browser/download_dir_policy_handler.o:(DownloadDirPolicyHandler::ApplyPolicySettingsWithParameters(policy::PolicyMap const&, policy::PolicyHandlerParameters const&, PrefValueMap*)) in archive obj/chrome/browser/libbrowser.a
>>> referenced by download_dir_util.cc:65 (../../chrome/browser/download/download_dir_util.cc:65)
>>>               browser/download_dir_util.o:(download_dir_util::ExpandDownloadDirectoryPath(std::__Cr::basic_string<char, std::__Cr::char_traits<char>, std::__Cr::allocator<char> > const&, policy::PolicyHandlerParameters const&)) in archive obj/chrome/browser/libbrowser.a
>>> referenced by local_sync_policy_handler.cc:31 (../../chrome/browser/policy/local_sync_policy_handler.cc:31)
>>>               browser/local_sync_policy_handler.o:(policy::LocalSyncPolicyHandler::ApplyPolicySettings(policy::PolicyMap const&, PrefValueMap*)) in archive obj/chrome/browser/libbrowser.a
>>> referenced by disk_cache_dir_policy_handler.cc:29 (../../chrome/browser/net/disk_cache_dir_policy_handler.cc:29)
>>>               browser/disk_cache_dir_policy_handler.o:(policy::DiskCacheDirPolicyHandler::ApplyPolicySettings(policy::PolicyMap const&, PrefValueMap*)) in archive obj/chrome/browser/libbrowser.a

ld.lld: error: undefined symbol: safe_browsing::BinaryUploadService::Request::Data::Data()
>>> referenced by content_analysis_delegate.cc:164 (../../chrome/browser/enterprise/connectors/content_analysis_delegate.cc:164)
>>>               browser/content_analysis_delegate.o:(enterprise_connectors::ContentAnalysisDelegate::FileContents::FileContents()) in archive obj/chrome/browser/libbrowser.a
>>> referenced by content_analysis_delegate.cc:165 (../../chrome/browser/enterprise/connectors/content_analysis_delegate.cc:165)
>>>               browser/content_analysis_delegate.o:(enterprise_connectors::ContentAnalysisDelegate::FileContents::FileContents(safe_browsing::BinaryUploadService::Result)) in archive obj/chrome/browser/libbrowser.a
>>> referenced by content_analysis_delegate.cc:88 (../../chrome/browser/enterprise/connectors/content_analysis_delegate.cc:88)
>>>               browser/content_analysis_delegate.o:(enterprise_connectors::ContentAnalysisDelegate::PrepareTextRequest()) in archive obj/chrome/browser/libbrowser.a

ld.lld: error: undefined symbol: safe_browsing::ReportAnalysisConnectorWarningBypass(Profile*, GURL const&, std::__Cr::basic_string<char, std::__Cr::char_traits<char>, std::__Cr::allocator<char> > const&, std::__Cr::basic_string<char, std::__Cr::char_traits<char>, std::__Cr::allocator<char> > const&, std::__Cr::basic_string<char, std::__Cr::char_traits<char>, std::__Cr::allocator<char> > const&, std::__Cr::basic_string<char, std::__Cr::char_traits<char>, std::__Cr::allocator<char> > const&, safe_browsing::DeepScanAccessPoint, long, enterprise_connectors::ContentAnalysisResponse const&)
>>> referenced by content_analysis_delegate.cc:188 (../../chrome/browser/enterprise/connectors/content_analysis_delegate.cc:188)
>>>               browser/content_analysis_delegate.o:(enterprise_connectors::ContentAnalysisDelegate::BypassWarnings()) in archive obj/chrome/browser/libbrowser.a
>>> referenced by content_analysis_delegate.cc:201 (../../chrome/browser/enterprise/connectors/content_analysis_delegate.cc:201)
>>>               browser/content_analysis_delegate.o:(enterprise_connectors::ContentAnalysisDelegate::BypassWarnings()) in archive obj/chrome/browser/libbrowser.a

ld.lld: error: undefined symbol: safe_browsing::RecordDeepScanMetrics(safe_browsing::DeepScanAccessPoint, base::TimeDelta, long, std::__Cr::basic_string<char, std::__Cr::char_traits<char>, std::__Cr::allocator<char> > const&, bool)
>>> referenced by content_analysis_delegate.cc:219 (../../chrome/browser/enterprise/connectors/content_analysis_delegate.cc:219)
>>>               browser/content_analysis_delegate.o:(enterprise_connectors::ContentAnalysisDelegate::Cancel(bool)) in archive obj/chrome/browser/libbrowser.a

ld.lld: error: undefined symbol: safe_browsing::RecordDeepScanMetrics(safe_browsing::DeepScanAccessPoint, base::TimeDelta, long, safe_browsing::BinaryUploadService::Result const&, enterprise_connectors::ContentAnalysisResponse const&)
>>> referenced by content_analysis_delegate.cc:383 (../../chrome/browser/enterprise/connectors/content_analysis_delegate.cc:383)
>>>               browser/content_analysis_delegate.o:(enterprise_connectors::ContentAnalysisDelegate::StringRequestCallback(safe_browsing::BinaryUploadService::Result, enterprise_connectors::ContentAnalysisResponse)) in archive obj/chrome/browser/libbrowser.a
>>> referenced by content_analysis_delegate.cc:467 (../../chrome/browser/enterprise/connectors/content_analysis_delegate.cc:467)
>>>               browser/content_analysis_delegate.o:(enterprise_connectors::ContentAnalysisDelegate::FileRequestCallback(base::FilePath, safe_browsing::BinaryUploadService::Result, enterprise_connectors::ContentAnalysisResponse)) in archive obj/chrome/browser/libbrowser.a

ld.lld: error: undefined symbol: safe_browsing::MaybeReportDeepScanningVerdict(Profile*, GURL const&, std::__Cr::basic_string<char, std::__Cr::char_traits<char>, std::__Cr::allocator<char> > const&, std::__Cr::basic_string<char, std::__Cr::char_traits<char>, std::__Cr::allocator<char> > const&, std::__Cr::basic_string<char, std::__Cr::char_traits<char>, std::__Cr::allocator<char> > const&, std::__Cr::basic_string<char, std::__Cr::char_traits<char>, std::__Cr::allocator<char> > const&, safe_browsing::DeepScanAccessPoint, long, safe_browsing::BinaryUploadService::Result, enterprise_connectors::ContentAnalysisResponse const&, safe_browsing::EventResult)
>>> referenced by content_analysis_delegate.cc:397 (../../chrome/browser/enterprise/connectors/content_analysis_delegate.cc:397)
>>>               browser/content_analysis_delegate.o:(enterprise_connectors::ContentAnalysisDelegate::StringRequestCallback(safe_browsing::BinaryUploadService::Result, enterprise_connectors::ContentAnalysisResponse)) in archive obj/chrome/browser/libbrowser.a
>>> referenced by content_analysis_delegate.cc:432 (../../chrome/browser/enterprise/connectors/content_analysis_delegate.cc:432)
>>>               browser/content_analysis_delegate.o:(enterprise_connectors::ContentAnalysisDelegate::CompleteFileRequestCallback(unsigned long, base::FilePath, safe_browsing::BinaryUploadService::Result, enterprise_connectors::ContentAnalysisResponse, std::__Cr::basic_string<char, std::__Cr::char_traits<char>, std::__Cr::allocator<char> >)) in archive obj/chrome/browser/libbrowser.a

ld.lld: error: undefined symbol: safe_browsing::BinaryUploadService::Request::Request(base::OnceCallback<void (safe_browsing::BinaryUploadService::Result, enterprise_connectors::ContentAnalysisResponse)>, GURL)
>>> referenced by content_analysis_delegate.cc:92 (../../chrome/browser/enterprise/connectors/content_analysis_delegate.cc:92)
>>>               browser/content_analysis_delegate.o:(enterprise_connectors::ContentAnalysisDelegate::PrepareTextRequest()) in archive obj/chrome/browser/libbrowser.a

ld.lld: error: undefined symbol: safe_browsing::BinaryUploadService::Request::set_device_token(std::__Cr::basic_string<char, std::__Cr::char_traits<char>, std::__Cr::allocator<char> > const&)
>>> referenced by content_analysis_delegate.cc:540 (../../chrome/browser/enterprise/connectors/content_analysis_delegate.cc:540)
>>>               browser/content_analysis_delegate.o:(enterprise_connectors::ContentAnalysisDelegate::PrepareRequest(enterprise_connectors::AnalysisConnector, safe_browsing::BinaryUploadService::Request*)) in archive obj/chrome/browser/libbrowser.a

ld.lld: error: undefined symbol: safe_browsing::BinaryUploadService::Request::set_analysis_connector(enterprise_connectors::AnalysisConnector)
>>> referenced by content_analysis_delegate.cc:541 (../../chrome/browser/enterprise/connectors/content_analysis_delegate.cc:541)
>>>               browser/content_analysis_delegate.o:(enterprise_connectors::ContentAnalysisDelegate::PrepareRequest(enterprise_connectors::AnalysisConnector, safe_browsing::BinaryUploadService::Request*)) in archive obj/chrome/browser/libbrowser.a

ld.lld: error: undefined symbol: safe_browsing::GetProfileEmail(Profile*)
>>> referenced by content_analysis_delegate.cc:542 (../../chrome/browser/enterprise/connectors/content_analysis_delegate.cc:542)
>>>               browser/content_analysis_delegate.o:(enterprise_connectors::ContentAnalysisDelegate::PrepareRequest(enterprise_connectors::AnalysisConnector, safe_browsing::BinaryUploadService::Request*)) in archive obj/chrome/browser/libbrowser.a

ld.lld: error: undefined symbol: safe_browsing::BinaryUploadService::Request::set_email(std::__Cr::basic_string<char, std::__Cr::char_traits<char>, std::__Cr::allocator<char> > const&)
>>> referenced by content_analysis_delegate.cc:542 (../../chrome/browser/enterprise/connectors/content_analysis_delegate.cc:542)
>>>               browser/content_analysis_delegate.o:(enterprise_connectors::ContentAnalysisDelegate::PrepareRequest(enterprise_connectors::AnalysisConnector, safe_browsing::BinaryUploadService::Request*)) in archive obj/chrome/browser/libbrowser.a

ld.lld: error: undefined symbol: safe_browsing::BinaryUploadService::Request::set_url(std::__Cr::basic_string<char, std::__Cr::char_traits<char>, std::__Cr::allocator<char> > const&)
>>> referenced by content_analysis_delegate.cc:543 (../../chrome/browser/enterprise/connectors/content_analysis_delegate.cc:543)
>>>               browser/content_analysis_delegate.o:(enterprise_connectors::ContentAnalysisDelegate::PrepareRequest(enterprise_connectors::AnalysisConnector, safe_browsing::BinaryUploadService::Request*)) in archive obj/chrome/browser/libbrowser.a

ld.lld: error: undefined symbol: safe_browsing::BinaryUploadService::Request::set_tab_url(GURL const&)
>>> referenced by content_analysis_delegate.cc:544 (../../chrome/browser/enterprise/connectors/content_analysis_delegate.cc:544)
>>>               browser/content_analysis_delegate.o:(enterprise_connectors::ContentAnalysisDelegate::PrepareRequest(enterprise_connectors::AnalysisConnector, safe_browsing::BinaryUploadService::Request*)) in archive obj/chrome/browser/libbrowser.a

ld.lld: error: undefined symbol: safe_browsing::BinaryUploadService::Request::add_tag(std::__Cr::basic_string<char, std::__Cr::char_traits<char>, std::__Cr::allocator<char> > const&)
>>> referenced by content_analysis_delegate.cc:546 (../../chrome/browser/enterprise/connectors/content_analysis_delegate.cc:546)
>>>               browser/content_analysis_delegate.o:(enterprise_connectors::ContentAnalysisDelegate::PrepareRequest(enterprise_connectors::AnalysisConnector, safe_browsing::BinaryUploadService::Request*)) in archive obj/chrome/browser/libbrowser.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)
ninja: build stopped: subcommand failed.
wchen342 commented 2 years ago

Are you trying to use old patches on new version? The error means definitions of some functions are missing, most likely removed by safe browsing patches in main repo.

PF4Public commented 1 year ago

This is an old issue, that didn't show much activity recently — closing. If you have any more information to add, let us know.