Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make is_starboard a global variable #4791

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions base/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -1792,7 +1792,7 @@ component("base") {
"process/process_metrics_posix.cc",
"sync_socket_posix.cc",

# base/posix/unix_domain_socket.cc:91:22: error: implicit conversion loses integer precision:
# base/posix/unix_domain_socket.cc:91:22: error: implicit conversion loses integer precision:
"posix/unix_domain_socket.cc",
"posix/unix_domain_socket.h",

Expand Down Expand Up @@ -2742,7 +2742,7 @@ if (use_custom_libcxx && enable_safe_libcxx && !is_debug) {
sources = [ "nodebug_assertion.cc" ]
deps = [ ":base_static" ]
if (is_starboard) {
deps += ["//starboard:starboard_group"]
deps += [ "//starboard:starboard_group" ]
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions build/config/BUILDCONFIG.gn
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,8 @@ if (is_cobalt) {
}
}

import("//cobalt/build/configs/starboard.gni")
niranjanyardi marked this conversation as resolved.
Show resolved Hide resolved

# =============================================================================
# OS DEFINITIONS
# =============================================================================
Expand Down
2 changes: 1 addition & 1 deletion build/config/c++/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ config("runtime_library") {
"-isystem" + rebase_path("$libcxx_prefix/include", root_build_dir),
"-isystem" + rebase_path("$libcxxabi_prefix/include", root_build_dir),
]
if (is_cobalt && is_cobalt_hermetic_build) {
if (is_cobalt && is_cobalt_hermetic_build && current_toolchain == cobalt_toolchain) {
cflags_cc += [
"-isystem" + rebase_path("//third_party/musl/include", root_build_dir),
"-isystem" +
Expand Down
1 change: 0 additions & 1 deletion build/toolchain/linux/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ clang_toolchain("clang_x64") {
toolchain_args = {
current_cpu = "x64"
current_os = "linux"
is_starboard = false
}
}

Expand Down
2 changes: 1 addition & 1 deletion buildtools/third_party/libc++/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ target(_libcxx_target_type, "libc++") {
}
}

if (is_cobalt && is_cobalt_hermetic_build) {
if (is_cobalt && is_cobalt_hermetic_build && current_toolchain == cobalt_toolchain) {
# TODO: b/384652502 - Cobalt: Fix compiler errors building hermetically.
sources -= [ "trunk/src/atomic.cpp" ]
deps += [
Expand Down
3 changes: 2 additions & 1 deletion cobalt/build/configs/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ config("cobalt_config") {
]
if (current_toolchain == starboard_toolchain) {
configs += [ "//${starboard_path}/platform_configuration" ]
} else if (is_cobalt_hermetic_build) {
} else if (is_cobalt_hermetic_build &&
current_toolchain == cobalt_toolchain) {
configs += [
# TODO: b/390500840 - Remove hardcoded x64 config, switch config based on platform.
"//starboard/build/config/modular/x64",
Expand Down
4 changes: 0 additions & 4 deletions cobalt/build/configs/cobalt.gni
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,3 @@ declare_args() {
is_cobalt = false
cobalt_is_release_build = false
}

declare_args() {
is_starboard = is_cobalt && target_os != "android"
}
3 changes: 1 addition & 2 deletions cobalt/build/configs/modular_variables.gni
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,4 @@ declare_args() {
use_custom_libc = false
}

is_cobalt_hermetic_build =
is_starboard && use_custom_libc && current_toolchain == cobalt_toolchain
is_cobalt_hermetic_build = is_starboard && use_custom_libc
18 changes: 18 additions & 0 deletions cobalt/build/configs/starboard.gni
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright 2024 The Cobalt Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

declare_args() {
is_starboard = is_cobalt && target_os != "android" &&
current_toolchain == default_toolchain
}
2 changes: 1 addition & 1 deletion starboard/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ if (is_cobalt_hermetic_build) {
"//starboard/client_porting/eztime",
]

if (!sb_is_evergreen) {
if (!sb_is_evergreen && current_toolchain == cobalt_toolchain) {
# For modular builds, we need to wrap any POSIX APIs that may not be ABI
# equivalent across the Cobalt toolchain and the platform toolchain. For
# non-Evergreen builds, this is done via the below wrapper implementations
Expand Down
17 changes: 1 addition & 16 deletions starboard/linux/x64x11/toolchain/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,11 @@ overridable_clang_toolchain("starboard") {
toolchain_args = {
current_os = "linux"
current_cpu = "x64"
is_starboard = true
}
propagates_configs = true
niranjanyardi marked this conversation as resolved.
Show resolved Hide resolved
}

overridable_clang_toolchain("cobalt") {
clang_base_path = clang_base_path
toolchain_args = {
current_os = "linux"
current_cpu = "x64"
}
}

overridable_clang_toolchain("target") {
clang_base_path = clang_base_path
toolchain_args = {
current_os = "linux"
current_cpu = "x64"
}
}

clang_toolchain("native_target") {
toolchain_args = {
is_starboard = false
Expand Down
3 changes: 2 additions & 1 deletion starboard/shared/modular/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ if ((sb_is_modular || sb_is_evergreen_compatible) &&
}
}

if (is_cobalt_hermetic_build && !sb_is_evergreen) {
if (is_cobalt_hermetic_build && !sb_is_evergreen &&
current_toolchain == cobalt_toolchain) {
source_set("cobalt_layer_posix_abi_wrappers") {
sources = [
"cobalt_layer_posix_directory_abi_wrappers.cc",
Expand Down
Loading