Skip to content

Commit 8954789

Browse files
committed
Fix broken build at Freebsd
1 parent 0c4d31e commit 8954789

5 files changed

Lines changed: 43 additions & 21 deletions

File tree

CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,13 @@ elseif (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
230230
src/base/threading/platform_thread_internal_posix.cc
231231
src/base/strings/sys_string_conversions_posix.cc
232232
src/base/process/process_handle_freebsd.cc
233+
src/base/process/process_metrics_posix.cc
233234
src/base/memory/shared_memory_posix.cc
234-
src/base/sys_info_freebsd.mm
235+
src/base/sys_info_freebsd.cc
236+
src/base/files/file_util.cc
237+
src/base/files/file_util_posix.cc
238+
src/base/files/file_enumerator.cc
239+
src/base/files/file_enumerator_posix.cc
235240
)
236241
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
237242
FIND_LIBRARY(COREFOUNDATION_LIBRARY CoreFoundation)

DEPS

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,8 @@
100100
"patch/process_posix_disable_valgrind_related.patch",
101101
"patch/shared_memory_disable_scoped_tracker.patch",
102102
"patch/sys_info_disable_field_trial.patch",
103-
"patch/thread_checker_impl_skip_one_check.patch"
103+
"patch/thread_checker_impl_skip_one_check.patch",
104+
"patch/freebsd.patch"
104105
],
105106
"custom_files": [
106107
{"from": "custom/debugger.h", "to": "base/debug/debugger.h"},

patch/freebsd.patch

Lines changed: 29 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,34 @@
1-
diff --git a/src/base/threading/platform_thread_freebsd.cc b/src/base/threading/platform_thread_freebsd.cc
2-
index bce1ccf..0b35e5d 100644
3-
--- a/src/base/threading/platform_thread_freebsd.cc
4-
+++ b/src/base/threading/platform_thread_freebsd.cc
5-
@@ -12,7 +12,9 @@
6-
#include "base/logging.h"
7-
#include "base/threading/platform_thread_internal_posix.h"
8-
#include "base/threading/thread_id_name_manager.h"
9-
+#if 0
10-
#include "base/tracked_objects.h"
11-
+#endif
1+
diff --git a/src/base/process/process_posix.cc b/src/base/process/process_posix.cc
2+
index 914bce8..65dbce7 100644
3+
--- a/src/base/process/process_posix.cc
4+
+++ b/src/base/process/process_posix.cc
5+
@@ -17,6 +17,10 @@
6+
#include "base/third_party/dynamic_annotations/dynamic_annotations.h"
127
#include "build/build_config.h"
138

14-
#if !defined(OS_NACL)
15-
@@ -67,7 +69,9 @@ bool GetCurrentThreadPriorityForPlatform(ThreadPriority* priority) {
16-
// static
17-
void PlatformThread::SetName(const std::string& name) {
18-
ThreadIdNameManager::GetInstance()->SetName(CurrentId(), name);
9+
+#if defined(OS_FREEBSD)
10+
+#include <signal.h>
11+
+#endif
12+
+
13+
#if defined(OS_MACOSX)
14+
#include <sys/event.h>
15+
#endif
16+
diff --git a/src/base/sys_info_freebsd.cc b/src/base/sys_info_freebsd.cc
17+
index 0b2008d..e196b55 100644
18+
--- a/src/base/sys_info_freebsd.cc
19+
+++ b/src/base/sys_info_freebsd.cc
20+
@@ -24,6 +24,7 @@ int64_t SysInfo::AmountOfPhysicalMemory() {
21+
return static_cast<int64_t>(pages) * page_size;
22+
}
23+
1924
+#if 0
20-
tracked_objects::ThreadData::InitializeThreadContext(name);
25+
// static
26+
uint64_t SysInfo::MaxSharedMemorySize() {
27+
size_t limit;
28+
@@ -34,5 +35,6 @@ uint64_t SysInfo::MaxSharedMemorySize() {
29+
}
30+
return static_cast<uint64_t>(limit);
31+
}
2132
+#endif
2233

23-
#if !defined(OS_NACL)
24-
// On FreeBSD we can get the thread names to show up in the debugger by
34+
} // namespace base

src/base/process/process_posix.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717
#include "base/third_party/dynamic_annotations/dynamic_annotations.h"
1818
#include "build/build_config.h"
1919

20+
#if defined(OS_FREEBSD)
21+
#include <signal.h>
22+
#endif
23+
2024
#if defined(OS_MACOSX)
2125
#include <sys/event.h>
2226
#endif

src/base/sys_info_freebsd.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ int64_t SysInfo::AmountOfPhysicalMemory() {
2424
return static_cast<int64_t>(pages) * page_size;
2525
}
2626

27+
#if 0
2728
// static
2829
uint64_t SysInfo::MaxSharedMemorySize() {
2930
size_t limit;
@@ -34,5 +35,6 @@ uint64_t SysInfo::MaxSharedMemorySize() {
3435
}
3536
return static_cast<uint64_t>(limit);
3637
}
38+
#endif
3739

3840
} // namespace base

0 commit comments

Comments
 (0)