Stubbed out linking on Fuchsia

Follows https://codereview.chromium.org/2931143002/. Sufficient to link
d8 with target_os="fuchsia" in Chrome. No implementations of platform
functions yet, just stubs.

BUG=chromium:731217

Review-Url: https://codereview.chromium.org/2932053004
Cr-Commit-Position: refs/heads/master@{#45832}
This commit is contained in:
scottmg 2017-06-11 07:34:32 -07:00 committed by Commit Bot
parent c72a612667
commit dc3de67047
4 changed files with 134 additions and 0 deletions

View File

@ -2597,6 +2597,11 @@ v8_component("v8_libbase") {
"src/base/platform/platform-linux.cc",
]
}
} else if (is_fuchsia) {
sources += [
"src/base/debug/stack_trace_fuchsia.cc",
"src/base/platform/platform-fuchsia.cc",
]
} else if (is_mac) {
sources += [
"src/base/debug/stack_trace_posix.cc",

View File

@ -0,0 +1,38 @@
// Copyright 2017 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "src/base/debug/stack_trace.h"
#include <iomanip>
#include <ostream>
#include "src/base/platform/platform.h"
namespace v8 {
namespace base {
namespace debug {
bool EnableInProcessStackDumping() {
CHECK(false); // TODO(fuchsia): Port, https://crbug.com/731217.
return false;
}
void DisableSignalStackDump() {}
StackTrace::StackTrace() {}
void StackTrace::Print() const {
std::string backtrace = ToString();
OS::Print("%s\n", backtrace.c_str());
}
void StackTrace::OutputToStream(std::ostream* os) const {
for (size_t i = 0; i < count_; ++i) {
*os << "#" << std::setw(2) << i << trace_[i] << "\n";
}
}
} // namespace debug
} // namespace base
} // namespace v8

View File

@ -0,0 +1,85 @@
// Copyright 2017 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "src/base/macros.h"
#include "src/base/platform/platform-posix.h"
#include "src/base/platform/platform.h"
namespace v8 {
namespace base {
TimezoneCache* OS::CreateTimezoneCache() { return new PosixTimezoneCache(); }
std::vector<OS::SharedLibraryAddress> OS::GetSharedLibraryAddresses() {
CHECK(false); // TODO(fuchsia): Port, https://crbug.com/731217.
return std::vector<SharedLibraryAddress>();
}
void OS::SignalCodeMovingGC() {
CHECK(false); // TODO(fuchsia): Port, https://crbug.com/731217.
}
VirtualMemory::VirtualMemory() : address_(NULL), size_(0) {}
VirtualMemory::VirtualMemory(size_t size)
: address_(ReserveRegion(size)), size_(size) {
CHECK(false); // TODO(fuchsia): Port, https://crbug.com/731217.
}
VirtualMemory::VirtualMemory(size_t size, size_t alignment)
: address_(NULL), size_(0) {}
VirtualMemory::~VirtualMemory() {}
bool VirtualMemory::IsReserved() { return false; }
void VirtualMemory::Reset() {}
bool VirtualMemory::Commit(void* address, size_t size, bool is_executable) {
return false;
}
bool VirtualMemory::Uncommit(void* address, size_t size) { return false; }
bool VirtualMemory::Guard(void* address) { return false; }
// static
void* VirtualMemory::ReserveRegion(size_t size) {
CHECK(false); // TODO(fuchsia): Port, https://crbug.com/731217.
return NULL;
}
// static
bool VirtualMemory::CommitRegion(void* base, size_t size, bool is_executable) {
CHECK(false); // TODO(fuchsia): Port, https://crbug.com/731217.
return false;
}
// static
bool VirtualMemory::UncommitRegion(void* base, size_t size) {
CHECK(false); // TODO(fuchsia): Port, https://crbug.com/731217.
return false;
}
// static
bool VirtualMemory::ReleasePartialRegion(void* base, size_t size,
void* free_start, size_t free_size) {
CHECK(false); // TODO(fuchsia): Port, https://crbug.com/731217.
return false;
}
// static
bool VirtualMemory::ReleaseRegion(void* base, size_t size) {
CHECK(false); // TODO(fuchsia): Port, https://crbug.com/731217.
return false;
}
// static
bool VirtualMemory::HasLazyCommits() {
CHECK(false); // TODO(fuchsia): Port, https://crbug.com/731217.
return false;
}
} // namespace base
} // namespace v8

View File

@ -2203,6 +2203,12 @@
'base/platform/platform-posix.cc'
]},
],
['OS=="fuchsia"', {
'sources': [
'base/debug/stack_trace_fuchsia.cc',
'base/platform/platform-fuchsia.cc',
]},
],
['OS=="solaris"', {
'link_settings': {
'libraries': [