Closed arutr closed 6 years ago
I think you need to change this line's path to base/synchronization/waitable_event_mac.cc
. The macOS GN bootstrap patch probably needs to be updated.
Okay, I've updated the macos-fix-gn-bootstrap
patch. Now I get this error after building base
:
ERROR at //chrome/BUILD.gn:591:7: Unknown substitution pattern
"{{bundle_contents_dir}}/XPCServices/{{source_file_part}}",
^---------------------------------------------------------
Found a {{ at offset 0 and did not find a known substitution following it.
See //BUILD.gn:102:7: which caused the file to be included.
"//chrome",
^---------
I'm not sure what's causing the issue. It looks to be a problem with the GN files, but it doesn't make a lot of sense. If anyone has ideas, let us know.
I have another error after changing waitable_event_mac
line:
[372/372] c++ -o gn tools/gn/gn_main.o -framework AppKit -framework CoreFoundation -framework Foundation -framework Security libevent.a base.a gn_lib.a dynamic_annotations.a
FAILED: gn
c++ -o gn tools/gn/gn_main.o -framework AppKit -framework CoreFoundation -framework Foundation -framework Security libevent.a base.a gn_lib.a dynamic_annotations.a
Undefined symbols for architecture x86_64:
"base::DispatchSourceMach::Resume()", referenced from:
base::WaitableEvent::WaitMany(base::WaitableEvent**, unsigned long) in base.a(waitable_event_mac.o)
"base::DispatchSourceMach::DispatchSourceMach(dispatch_queue_s*, unsigned int, void () block_pointer)", referenced from:
base::WaitableEvent::WaitMany(base::WaitableEvent**, unsigned long) in base.a(waitable_event_mac.o)
"base::DispatchSourceMach::~DispatchSourceMach()", referenced from:
base::WaitableEvent::WaitMany(base::WaitableEvent**, unsigned long) in base.a(waitable_event_mac.o)
void std::__1::vector<std::__1::unique_ptr<base::DispatchSourceMach, std::__1::default_delete<base::DispatchSourceMach> >, std::__1::allocator<std::__1::unique_ptr<base::DispatchSourceMach, std::__1::default_delete<base::DispatchSourceMach> > > >::__push_back_slow_path<std::__1::unique_ptr<base::DispatchSourceMach, std::__1::default_delete<base::DispatchSourceMach> > >(std::__1::unique_ptr<base::DispatchSourceMach, std::__1::default_delete<base::DispatchSourceMach> >&&) in base.a(waitable_event_mac.o)
"base::mac::internal::MacOSXMinorVersion()", referenced from:
base::WaitableEvent::WaitableEvent(base::WaitableEvent::ResetPolicy, base::WaitableEvent::InitialState) in base.a(waitable_event_mac.o)
base::WaitableEvent::UseSlowWatchList(base::WaitableEvent::ResetPolicy) in base.a(waitable_event_mac.o)
base::WaitableEvent::Signal() in base.a(waitable_event_mac.o)
base::WaitableEvent::WaitMany(base::WaitableEvent**, unsigned long) in base.a(waitable_event_mac.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Update:
base::DispatchSourceMach::Resume()
I found in:
https://chromium-review.googlesource.com/c/chromium/src/+/553497
and added two more targets:
base/mac/dispatch_source_mach.cc
base/synchronization/waitable_event_watcher_mac.cc
But base::mac::internal::MacOSXMinorVersion()
is totally absent. I fixed it in source files manually :/
And I also got broken Build.gn as @Artur96
Update 2:
It can't seems to find bundle_contents_dir
substitution.
@tectiv3
Does #297 fix your problem with waitable_event_watcher
?
With the bundle_contents_dir
, it seems to be a context-dependent variable. The error is strange though, because it should be defined here, since that template is used in this file, which is a dependency here. It's quite possible that I'm misunderstanding the meaning of some keywords like public_deps
, and how the namespaces are being modified as a result.
no, it didn't fix it. You still need to add
base/mac/dispatch_source_mach.cc
base/synchronization/waitable_event_watcher_mac.cc
but even after adding them,
"base::mac::internal::MacOSXMinorVersion()", referenced from:
base::WaitableEvent::WaitableEvent(base::WaitableEvent::ResetPolicy, base::WaitableEvent::InitialState) in base.a(waitable_event_mac.o)
base::WaitableEvent::UseSlowWatchList(base::WaitableEvent::ResetPolicy) in base.a(waitable_event_mac.o)
base::WaitableEvent::Signal() in base.a(waitable_event_mac.o)
base::WaitableEvent::WaitMany(base::WaitableEvent**, unsigned long) in base.a(waitable_event_mac.o)
ld: symbol(s) not found for architecture x86_64
remains
but even after adding them,
base::WaitableEvent::WaitableEvent(base::WaitableEvent::ResetPolicy, base::WaitableEvent::InitialState) in base.a(waitable_event_mac.o) base::WaitableEvent::UseSlowWatchList(base::WaitableEvent::ResetPolicy) in base.a(waitable_event_mac.o)> base::WaitableEvent::Signal() in base.a(waitable_event_mac.o) base::WaitableEvent::WaitMany(base::WaitableEvent**, unsigned long) in base.a(waitable_event_mac.o) ld: symbol(s) not found for architecture x86_64```
remains
I assume you mean "base::mac::internal::MacOSXMinorVersion()"
is missing based on what your comment source shows (it's not visible for some reason).
Perhaps you could try adding the files
base/mac/mac_util.h
base/mac/mac_util.mm
yeah, I did, but it's failing on the next stuff that was nowhere to be found.
Undefined symbols for architecture x86_64:
"_IOObjectRelease", referenced from:
base::mac::GetModelIdentifier() in base.a(mac_util.o)
"_IORegistryEntryCreateCFProperty", referenced from:
base::mac::GetModelIdentifier() in base.a(mac_util.o)
"_IOServiceGetMatchingService", referenced from:
base::mac::GetModelIdentifier() in base.a(mac_util.o)
"_IOServiceMatching", referenced from:
base::mac::GetModelIdentifier() in base.a(mac_util.o)
"base::DispatchSourceMach::Resume()", referenced from:
base::WaitableEvent::WaitMany(base::WaitableEvent**, unsigned long) in base.a(waitable_event_mac.o)
"base::DispatchSourceMach::DispatchSourceMach(dispatch_queue_s*, unsigned int, void () block_pointer)", referenced from:
base::WaitableEvent::WaitMany(base::WaitableEvent**, unsigned long) in base.a(waitable_event_mac.o)
"base::DispatchSourceMach::~DispatchSourceMach()", referenced from:
base::WaitableEvent::WaitMany(base::WaitableEvent**, unsigned long) in base.a(waitable_event_mac.o)
void std::__1::vector<std::__1::unique_ptr<base::DispatchSourceMach, std::__1::default_delete<base::DispatchSourceMach> >, std::__1::allocator<std::__1::unique_ptr<base::DispatchSourceMach, std::__1::default_delete<base::DispatchSourceMach> > > >::__push_back_slow_path<std::__1::unique_ptr<base::DispatchSourceMach, std::__1::default_delete<base::DispatchSourceMach> > >(std::__1::unique_ptr<base::DispatchSourceMach, std::__1::default_delete<base::DispatchSourceMach> >&&) in base.a(waitable_event_mac.o)
"base::internal::ScopedNSProtocolTraitsRelease(objc_object*)", referenced from:
base::mac::(anonymous namespace)::GetLoginItemForApp() in base.a(mac_util.o)
"logging::OSStatusLogMessage::OSStatusLogMessage(char const*, int, int, int)", referenced from:
base::mac::SetFileBackupExclusion(base::FilePath const&) in base.a(mac_util.o)
"logging::OSStatusLogMessage::~OSStatusLogMessage()", referenced from:
base::mac::SetFileBackupExclusion(base::FilePath const&) in base.a(mac_util.o)
"_kIOMasterPortDefault", referenced from:
base::mac::GetModelIdentifier() in base.a(mac_util.o)
ld: symbol(s) not found for architecture x86_64
those
@tectiv3
Based on the code around here in base/BUILD.gn
and some quick grepping:
Add the following lines to the mac-specific base.sources
list:
'base/mac/scoped_typeref.h',
'base/time/time_conversion_posix.cc',
'base/time/time_mac.cc',
'base/mac/dispatch_source_mach.cc',
'base/mac/dispatch_source_mach.h',
'base/mac/scoped_nsobject.mm',
'base/mac/scoped_nsobject.h',
'base/mac/mac_logging.mm',
'base/mac/mac_logging.h',
Remove the following from the POSIX-specific base.sources
list:
'base/threading/platform_thread_internal_posix.cc',
Add the following to the mac libs
list:
'-framework', 'IOKit',
Technically, the following should be added to the if is_posix and not is_mac:
section added by the patch, but it doesn't matter too much since this is a mac-specific patch
'base/threading/platform_thread_internal_posix.cc',
'base/synchronization/waitable_event_mac.cc',
base/synchronization/waitable_event_posix.cc
shouldn't be deleted in the patchProbably would've been easier to send a patch instead of this...
I did some more investigation, and found out that the master
branch version of chromium
repo has documentation on bundle_contents_dir
right after bundle_root_dir
. However, there is no such reference in 62.0.3202.94, not even in the example for bundle_root_dir
. I even did a grep for contents_dir
, and found nothing in the GN source code for 62.0.3202.94.
Perhaps the version of GN that is included in 62.0.3202.94 is out-of-sync with the rest of the source tree? It wouldn't surprise me that they don't bother to keep it up-to-date, since GN is normally downloaded from Google via depot_tools (as done by gclient by reading DEPS in the root of the source tree; the name of the hook is gn_mac
)
@Eloston thank you! I will try that "patch" tomorrow.
@Artur96 @tectiv3 Please clear out your source tree and update to the latest code in develop
. I have changed LLVM+Clang from 4.0.0 to 5.0.0, and I'm trying out the GN code from 63 in 62, since I haven't seen a 62 source tree that has a GN implementing bundle_contents_dir
. I have a feeling that this may break, but it's probably easier to fix than to backport a GN change from 63 to 62.
@Eloston It does break indeed, but a bit further ;)
[365/365] c++ -o gn tools/gn/gn_main.o -framework AppKit -framework CoreFoundation -framework Foundation -framework Security libevent.a base.a gn_lib.a dynamic_annotations.a
FAILED: gn
c++ -o gn tools/gn/gn_main.o -framework AppKit -framework CoreFoundation -framework Foundation -framework Security libevent.a base.a gn_lib.a dynamic_annotations.a
Undefined symbols for architecture x86_64:
"tracked_objects::ThreadData::InitializeThreadContext(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
base::PlatformThread::SetName(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in base.a(platform_thread_mac.o)
"tracked_objects::ThreadData::TallyRunOnNamedThreadIfTracking(base::TrackingInfo const&, tracked_objects::TaskStopwatch const&)", referenced from:
base::SequencedWorkerPool::Inner::ThreadLoop(base::SequencedWorkerPool::Worker*) in base.a(sequenced_worker_pool.o)
base::debug::TaskAnnotator::RunTask(char const*, base::PendingTask*) in base.a(task_annotator.o)
"tracked_objects::TaskStopwatch::Stop()", referenced from:
base::SequencedWorkerPool::Inner::ThreadLoop(base::SequencedWorkerPool::Worker*) in base.a(sequenced_worker_pool.o)
base::RunLoop::Run() in base.a(run_loop.o)
base::debug::TaskAnnotator::RunTask(char const*, base::PendingTask*) in base.a(task_annotator.o)
"tracked_objects::TaskStopwatch::Start()", referenced from:
base::SequencedWorkerPool::Inner::ThreadLoop(base::SequencedWorkerPool::Worker*) in base.a(sequenced_worker_pool.o)
base::RunLoop::Run() in base.a(run_loop.o)
base::debug::TaskAnnotator::RunTask(char const*, base::PendingTask*) in base.a(task_annotator.o)
"tracked_objects::TaskStopwatch::TaskStopwatch()", referenced from:
base::SequencedWorkerPool::Inner::ThreadLoop(base::SequencedWorkerPool::Worker*) in base.a(sequenced_worker_pool.o)
base::RunLoop::Run() in base.a(run_loop.o)
base::debug::TaskAnnotator::RunTask(char const*, base::PendingTask*) in base.a(task_annotator.o)
"tracked_objects::TaskStopwatch::~TaskStopwatch()", referenced from:
base::SequencedWorkerPool::Inner::ThreadLoop(base::SequencedWorkerPool::Worker*) in base.a(sequenced_worker_pool.o)
base::RunLoop::Run() in base.a(run_loop.o)
base::debug::TaskAnnotator::RunTask(char const*, base::PendingTask*) in base.a(task_annotator.o)
"base::TrackingInfo::TrackingInfo(tracked_objects::Location const&, base::TimeTicks)", referenced from:
base::SequencedWorkerPool::Inner::PostTask(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const*, base::SequencedWorkerPool::SequenceToken, base::SequencedWorkerPool::WorkerShutdown, tracked_objects::Location const&, base::OnceCallback<void ()>, base::TimeDelta) in base.a(sequenced_worker_pool.o)
base::PendingTask::PendingTask(tracked_objects::Location const&, base::OnceCallback<void ()>) in base.a(pending_task.o)
base::PendingTask::PendingTask(tracked_objects::Location const&, base::OnceCallback<void ()>, base::TimeTicks, bool) in base.a(pending_task.o)
base::PendingTask::PendingTask(tracked_objects::Location const&, base::OnceCallback<void ()>) in base.a(pending_task.o)
"base::TrackingInfo::TrackingInfo()", referenced from:
base::SequencedWorkerPool::Inner::ThreadLoop(base::SequencedWorkerPool::Worker*) in base.a(sequenced_worker_pool.o)
"base::TrackingInfo::~TrackingInfo()", referenced from:
base::SequencedWorkerPool::Inner::ThreadLoop(base::SequencedWorkerPool::Worker*) in base.a(sequenced_worker_pool.o)
base::SequencedWorkerPool::Inner::PostTask(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const*, base::SequencedWorkerPool::SequenceToken, base::SequencedWorkerPool::WorkerShutdown, tracked_objects::Location const&, base::OnceCallback<void ()>, base::TimeDelta) in base.a(sequenced_worker_pool.o)
std::__1::__tree<base::(anonymous namespace)::SequencedTask, base::(anonymous namespace)::SequencedTaskLessThan, std::__1::allocator<base::(anonymous namespace)::SequencedTask> >::destroy(std::__1::__tree_node<base::(anonymous namespace)::SequencedTask, void*>*) in base.a(sequenced_worker_pool.o)
base::PendingTask::~PendingTask() in base.a(pending_task.o)
base::PendingTask::~PendingTask() in base.a(pending_task.o)
"base::subtle::ReadWriteLock::ReadAcquire()", referenced from:
base::internal::IncomingTaskQueue::PostPendingTask(base::PendingTask*) in base.a(incoming_task_queue.o)
"base::subtle::ReadWriteLock::ReadRelease()", referenced from:
base::internal::IncomingTaskQueue::PostPendingTask(base::PendingTask*) in base.a(incoming_task_queue.o)
"base::subtle::ReadWriteLock::WriteAcquire()", referenced from:
base::internal::IncomingTaskQueue::WillDestroyCurrentMessageLoop() in base.a(incoming_task_queue.o)
"base::subtle::ReadWriteLock::WriteRelease()", referenced from:
base::internal::IncomingTaskQueue::WillDestroyCurrentMessageLoop() in base.a(incoming_task_queue.o)
"base::subtle::ReadWriteLock::ReadWriteLock()", referenced from:
base::internal::IncomingTaskQueue::IncomingTaskQueue(base::MessageLoop*) in base.a(incoming_task_queue.o)
base::internal::IncomingTaskQueue::IncomingTaskQueue(base::MessageLoop*) in base.a(incoming_task_queue.o)
"base::subtle::ReadWriteLock::~ReadWriteLock()", referenced from:
base::internal::IncomingTaskQueue::~IncomingTaskQueue() in base.a(incoming_task_queue.o)
"tracked_objects::TaskStopwatch::StartTime() const", referenced from:
base::debug::TaskAnnotator::RunTask(char const*, base::PendingTask*) in base.a(task_annotator.o)
Here is the patch to make it work:
--- ~/ungoogled-chromium/build/sandbox/tools/gn/bootstrap/bootstrap.py.orig 2017-12-01 12:30:14.000000000 +0900
+++ ~/ungoogled-chromium/build/sandbox/tools/gn/bootstrap/bootstrap.py 2017-12-01 12:26:54.000000000 +0900
@@ -707,10 +707,18 @@
'base/process/process_iterator_mac.cc',
'base/process/process_metrics_mac.cc',
'base/strings/sys_string_conversions_mac.mm',
+ 'base/threading/worker_pool_posix.cc',
+ 'base/synchronization/read_write_lock_posix.cc',
'base/synchronization/waitable_event_mac.cc',
'base/sys_info_mac.mm',
'base/time/time_mac.cc',
'base/threading/platform_thread_mac.mm',
+ 'base/mac/dispatch_source_mach.cc',
+ 'base/tracking_info.cc',
+ 'base/tracked_objects.cc',
+ 'base/mac/mac_util.mm',
+ 'base/mac/scoped_nsobject.mm',
+ 'base/mac/mac_logging.mm',
])
static_libraries['libevent']['include_dirs'].extend([
os.path.join(SRC_ROOT, 'base', 'third_party', 'libevent', 'mac')
@@ -724,6 +732,7 @@
'-framework', 'CoreFoundation',
'-framework', 'Foundation',
'-framework', 'Security',
+ '-framework', 'IOKit',
])
if is_win:
Thank you @Eloston !!
[10075/24633] LIBTOOL-STATIC obj/chrome/browser/safe_browsing/libsafe_browsing.a
FAILED: obj/chrome/browser/safe_browsing/libsafe_browsing.a
rm -f obj/chrome/browser/safe_browsing/libsafe_browsing.a && TOOL_VERSION=1510603750 python ../../build/toolchain/mac/filter_libtool.py libtool -static -o obj/chrome/browser/safe_browsing/libsafe_browsing.a
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: no files specified
Usage: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -static [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-sacLT] [-no_warning_for_no_symbols]
Usage: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -dynamic [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-o output] [-install_name name] [-compatibility_version #] [-current_version #] [-seg1addr 0x#] [-segs_read_only_addr 0x#] [-segs_read_write_addr 0x#] [-seg_addr_table <filename>] [-seg_addr_table_filename <file_system_path>] [-all_load] [-noall_load]
Or should I open another issue? Since this is another problem.
also lots of warnings:
warning: unknown warning option '-Wno-enum-compare-switch'; did you mean '-Wno-enum-compare'? [-Wunknown-warning-option]
Included https://github.com/Eloston/ungoogled-chromium/issues/291#issuecomment-348392101 in 82ac9ac55257b5fe6462f7fea777ceac98ba95d3
Since 5e9a70ec9da7084d3485fe44df4344eb8cea13c1,
develop
branch has been failing to build onbase/synchronisation/waitable_event_posix.o
: