mksnapshot: introduce a V8_TARGET_OS_CHROMEOS define

We had one use of OS_CHROMEOS in mksnapshot. OS_CHROMEOS is defined if
gn's `is_chromeos` is true, which checks `current_os`. `current_os !=
target_os` can happen if we're building with a non-default toolchain,
which happens often on CrOS, since `mksnapshot` is a host binary.

Tested by manually verifying that .text.hot.embedded now shows up on
arm32/aarch64 builds of embedded.S.

Bug: v8:9103
Change-Id: I038b56f4c18c7dd9a651ce676a977697dad14ae6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1573041
Commit-Queue: George Burgess <gbiv@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60925}
This commit is contained in:
George Burgess IV 2019-04-17 16:13:47 -07:00 committed by Commit Bot
parent b00074ca5f
commit f90456ba3f
2 changed files with 4 additions and 1 deletions

View File

@ -2977,6 +2977,7 @@ v8_source_set("v8_base_without_compiler") {
"src/x64/register-x64.h",
"src/x64/sse-instr.h",
]
# iOS Xcode simulator builds run on an x64 target. iOS and macOS are both
# based on Darwin and thus POSIX-compliant to a similar degree.
if (is_linux || is_mac || is_ios) {
@ -3738,6 +3739,8 @@ if (v8_use_snapshot && current_toolchain == v8_snapshot_toolchain) {
defines = [ "V8_TARGET_OS_FUCHSIA" ]
} else if (target_os == "win") {
defines = [ "V8_TARGET_OS_WIN" ]
} else if (target_os == "chromeos") {
defines = [ "V8_TARGET_OS_CHROMEOS" ]
}
}
}

View File

@ -680,7 +680,7 @@ int PlatformDependentEmbeddedFileWriter::IndentedDataDirective(
#else
void PlatformDependentEmbeddedFileWriter::SectionText() {
#ifdef OS_CHROMEOS
#if defined(V8_TARGET_OS_CHROMEOS)
fprintf(fp_, ".section .text.hot.embedded\n");
#else
fprintf(fp_, ".section .text\n");