Skip to content

Commit 0c4d31e

Browse files
committed
Fix broken build at Linux
1 parent 7fd2cc5 commit 0c4d31e

3 files changed

Lines changed: 20 additions & 9 deletions

File tree

CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,9 +192,16 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
192192
src/base/threading/platform_thread_internal_posix.cc
193193
src/base/strings/sys_string_conversions_posix.cc
194194
src/base/process/process_linux.cc
195+
src/base/process/internal_linux.cc
195196
src/base/process/process_handle_linux.cc
197+
src/base/process/process_metrics_posix.cc
198+
src/base/process/process_metrics_linux.cc
196199
src/base/memory/shared_memory_posix.cc
197200
src/base/sys_info_linux.cc
201+
src/base/files/file_util.cc
202+
src/base/files/file_util_posix.cc
203+
src/base/files/file_enumerator.cc
204+
src/base/files/file_enumerator_posix.cc
198205
)
199206
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Android")
200207
set(
@@ -208,6 +215,7 @@ elseif (${CMAKE_SYSTEM_NAME} MATCHES "Android")
208215
src/base/threading/thread_local_android.cc
209216
src/base/strings/sys_string_conversions_posix.cc
210217
src/base/process/process_handle_linux.cc
218+
src/base/process/process_metrics_linux.cc
211219
src/base/memory/shared_memory_posix.cc
212220
#src/base/sys_info_android.cc
213221
)

patch/shared_memory_disable_scoped_tracker.patch

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,22 @@ index 97ce94e..a716db7 100644
3030
if (options.size == 0) return false;
3131

3232
diff --git a/src/base/memory/shared_memory_posix.cc b/src/base/memory/shared_memory_posix.cc
33-
index d55c2df..13b6150 100644
33+
index d55c2df..54e0c49 100644
3434
--- a/src/base/memory/shared_memory_posix.cc
3535
+++ b/src/base/memory/shared_memory_posix.cc
36-
@@ -16,8 +16,10 @@
37-
#include "base/logging.h"
36+
@@ -17,7 +17,11 @@
3837
#include "base/posix/eintr_wrapper.h"
3938
#include "base/posix/safe_strerror.h"
40-
+#if 0
4139
#include "base/process/process_metrics.h"
40+
+#if 0
4241
#include "base/profiler/scoped_tracker.h"
42+
+#else
43+
+#include "base/threading/thread_restrictions.h"
4344
+#endif
4445
#include "base/scoped_generic.h"
4546
#include "base/strings/utf_string_conversions.h"
4647
#include "build/build_config.h"
47-
@@ -37,9 +39,11 @@ struct ScopedPathUnlinkerTraits {
48+
@@ -37,9 +41,11 @@ struct ScopedPathUnlinkerTraits {
4849
static void Free(FilePath* path) {
4950
// TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466437
5051
// is fixed.
@@ -56,7 +57,7 @@ index d55c2df..13b6150 100644
5657
if (unlink(path->value().c_str()))
5758
PLOG(WARNING) << "unlink";
5859
}
59-
@@ -67,9 +71,11 @@ bool CreateAnonymousSharedMemory(const SharedMemoryCreateOptions& options,
60+
@@ -67,9 +73,11 @@ bool CreateAnonymousSharedMemory(const SharedMemoryCreateOptions& options,
6061
if (GetShmemTempDir(options.executable, &directory)) {
6162
// TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466437
6263
// is fixed.
@@ -68,7 +69,7 @@ index d55c2df..13b6150 100644
6869
fp->reset(base::CreateAndOpenTemporaryFileInDir(directory, path));
6970

7071
// Deleting the file prevents anyone else from mapping it in (making it
71-
@@ -83,9 +89,11 @@ bool CreateAnonymousSharedMemory(const SharedMemoryCreateOptions& options,
72+
@@ -83,9 +91,11 @@ bool CreateAnonymousSharedMemory(const SharedMemoryCreateOptions& options,
7273
if (options.share_read_only) {
7374
// TODO(erikchen): Remove ScopedTracker below once
7475
// http://crbug.com/466437 is fixed.
@@ -80,7 +81,7 @@ index d55c2df..13b6150 100644
8081
// Also open as readonly so that we can ShareReadOnlyToProcess.
8182
readonly_fd->reset(HANDLE_EINTR(open(path->value().c_str(), O_RDONLY)));
8283
if (!readonly_fd->is_valid()) {
83-
@@ -194,9 +202,11 @@ bool SharedMemory::GetSizeFromSharedMemoryHandle(
84+
@@ -194,9 +204,11 @@ bool SharedMemory::GetSizeFromSharedMemoryHandle(
8485
bool SharedMemory::Create(const SharedMemoryCreateOptions& options) {
8586
// TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466437
8687
// is fixed.

src/base/memory/shared_memory_posix.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,11 @@
1616
#include "base/logging.h"
1717
#include "base/posix/eintr_wrapper.h"
1818
#include "base/posix/safe_strerror.h"
19-
#if 0
2019
#include "base/process/process_metrics.h"
20+
#if 0
2121
#include "base/profiler/scoped_tracker.h"
22+
#else
23+
#include "base/threading/thread_restrictions.h"
2224
#endif
2325
#include "base/scoped_generic.h"
2426
#include "base/strings/utf_string_conversions.h"

0 commit comments

Comments
 (0)