diff --git a/base/BUILD.gn b/base/BUILD.gn index 509aa373690d..020275b7aa05 100644 --- a/base/BUILD.gn +++ b/base/BUILD.gn @@ -1582,7 +1582,7 @@ component("base") { # TODO(b/206642994): see if we can remove this condition. It's added for now # because linking atomic leads to linker errors for evergreen on arm-hardfp, # and it's apparently not really needed (i.e., we can build without it). - if (!is_starboard || !sb_is_modular) { + if (!is_starboard || !(is_modular_toolchain && current_toolchain == cobalt_toolchain)) { libs += [ "atomic" ] } } diff --git a/build/toolchain/gcc_toolchain.gni b/build/toolchain/gcc_toolchain.gni index 1c1b364b1ec2..a4377d3b05a2 100644 --- a/build/toolchain/gcc_toolchain.gni +++ b/build/toolchain/gcc_toolchain.gni @@ -391,7 +391,7 @@ template("gcc_toolchain") { # TODO(b/206642994): see if we can remove this condition. It's needed for # now to add cflags for evergreen platforms but we haven't yet decided # whether cflags should be added here for all platforms. - if (!is_starboard_toolchain && is_starboard && sb_is_modular) { + if (!is_starboard_toolchain && is_starboard && is_modular_toolchain) { command = "$asm -MMD -MF $depfile ${rebuild_string}{{defines}} {{include_dirs}} {{cflags}} {{asmflags}}${extra_asmflags} -c {{source}} -o {{output}}" } else { command = "$asm -MMD -MF $depfile ${rebuild_string}{{defines}} {{include_dirs}} {{asmflags}}${extra_asmflags} -c {{source}} -o {{output}}" diff --git a/cobalt/BUILD.gn b/cobalt/BUILD.gn index 8fea180c0c24..74bcee3040f3 100644 --- a/cobalt/BUILD.gn +++ b/cobalt/BUILD.gn @@ -66,7 +66,7 @@ group("default") { "//third_party/brotli:dec_no_dictionary_data", ] - if (sb_is_modular) { + if (is_modular_toolchain && current_toolchain == cobalt_toolchain) { deps += [ "//base/util/values:values_util" ] if (sb_is_evergreen) { deps += [ diff --git a/cobalt/media/sandbox/BUILD.gn b/cobalt/media/sandbox/BUILD.gn index 19be83551b45..8c39b5f2255b 100644 --- a/cobalt/media/sandbox/BUILD.gn +++ b/cobalt/media/sandbox/BUILD.gn @@ -58,7 +58,7 @@ target(final_executable_type, "web_media_player_sandbox") { "//url", ] - if (!sb_is_modular) { + if (!(is_modular_toolchain && current_toolchain == cobalt_toolchain)) { deps += cobalt_platform_dependencies } } diff --git a/cobalt/network/BUILD.gn b/cobalt/network/BUILD.gn index 1a4fd75969b0..a401eef8629b 100644 --- a/cobalt/network/BUILD.gn +++ b/cobalt/network/BUILD.gn @@ -80,7 +80,7 @@ static_library("network") { defines = [ "ENABLE_NETWORK_LOGGING" ] } - if (!sb_is_modular) { + if (!(is_modular_toolchain && current_toolchain == cobalt_toolchain)) { deps += cobalt_platform_dependencies } } diff --git a/starboard/BUILD.gn b/starboard/BUILD.gn index c0a010de11e2..11835f4d7484 100644 --- a/starboard/BUILD.gn +++ b/starboard/BUILD.gn @@ -58,8 +58,6 @@ group("gn_all") { } if (is_modular_toolchain && is_cobalt_toolchain) { - assert(sb_is_modular, - "sb_is_modular should be set when building with cobalt_toolchain") } if (!sb_is_evergreen) { @@ -89,7 +87,7 @@ group("starboard") { "//starboard/client_porting/eztime", ] - if (sb_is_modular) { + if (is_modular_toolchain && current_toolchain == cobalt_toolchain) { public_deps += [ "//third_party/llvm-project/compiler-rt:compiler_rt", "//third_party/llvm-project/libcxx:cxx", @@ -192,7 +190,7 @@ if (current_toolchain == starboard_toolchain) { } else { public_deps += [ "//third_party/crashpad/wrapper:wrapper_stub" ] } - if (!sb_is_modular) { + if (!(is_modular_toolchain && current_toolchain == cobalt_toolchain)) { public_deps += [ "//$starboard_path:starboard_platform" ] } } diff --git a/starboard/build/config/BUILD.gn b/starboard/build/config/BUILD.gn index a9653497f346..3b440b4beca6 100644 --- a/starboard/build/config/BUILD.gn +++ b/starboard/build/config/BUILD.gn @@ -103,7 +103,7 @@ config("target") { # This appears to cause errors when linking the code statically, # however. # For windows based platforms this flag causes a linker error while building with cobalt toolchain - if (!(host_os == "win" && sb_is_modular && + if (!(host_os == "win" && is_modular_toolchain && current_toolchain == cobalt_toolchain)) { cflags = [ "-fPIC" ] } @@ -153,7 +153,7 @@ config("starboard") { defines += [ "SB_IS_LIBRARY=1" ] } - if (sb_is_modular) { + if (is_modular_toolchain) { defines += [ "SB_IS_MODULAR=1" ] } @@ -229,7 +229,9 @@ config("warnings_as_errors") { # override flags specified in a platform's "platform_configuration" config, # which is where these particular flags would otherwise naturally fit. config("default_compiler_flags") { - if (is_starboardized_toolchain && sb_is_modular && target_cpu == "arm") { + if (is_starboardized_toolchain && + (is_modular_toolchain && current_toolchain == cobalt_toolchain) && + target_cpu == "arm") { cflags = [ "-mfpu=vfpv3" ] asmflags = cflags } diff --git a/starboard/build/config/base_configuration.gni b/starboard/build/config/base_configuration.gni index 3c60204516c2..8e19f4c331e6 100644 --- a/starboard/build/config/base_configuration.gni +++ b/starboard/build/config/base_configuration.gni @@ -44,9 +44,6 @@ declare_args() { # Directory path to static contents' data. sb_static_contents_output_data_dir = "$root_out_dir/content/data" - # Whether this is a modular build. - sb_is_modular = false - # Whether this is an Evergreen build. sb_is_evergreen = false diff --git a/starboard/evergreen/shared/platform_configuration/configuration.gni b/starboard/evergreen/shared/platform_configuration/configuration.gni index c76baea77b99..5b6a1c4d2de1 100644 --- a/starboard/evergreen/shared/platform_configuration/configuration.gni +++ b/starboard/evergreen/shared/platform_configuration/configuration.gni @@ -14,7 +14,7 @@ import("//starboard/build/config/base_configuration.gni") -sb_is_modular = true +is_modular_toolchain = true sb_is_evergreen = true diff --git a/starboard/extension/BUILD.gn b/starboard/extension/BUILD.gn index 5212664b2e01..54f57adb6667 100644 --- a/starboard/extension/BUILD.gn +++ b/starboard/extension/BUILD.gn @@ -26,7 +26,7 @@ target(gtest_target_type, "extension_test") { "//testing/gmock", "//testing/gtest", ] - if (sb_is_modular) { + if (is_modular_toolchain && current_toolchain == cobalt_toolchain) { deps += cobalt_platform_dependencies } } diff --git a/starboard/linux/shared/platform_configuration/BUILD.gn b/starboard/linux/shared/platform_configuration/BUILD.gn index dcdaa48c857e..9ad7abc48153 100644 --- a/starboard/linux/shared/platform_configuration/BUILD.gn +++ b/starboard/linux/shared/platform_configuration/BUILD.gn @@ -143,7 +143,7 @@ config("platform_configuration") { "rt", ] - if (!sb_is_modular) { + if (!(is_modular_toolchain && current_toolchain == cobalt_toolchain)) { ldflags += [ "-static-libstdc++" ] } diff --git a/third_party/boringssl/BUILD.gn b/third_party/boringssl/BUILD.gn index f90940c03088..edf9cdcd6741 100644 --- a/third_party/boringssl/BUILD.gn +++ b/third_party/boringssl/BUILD.gn @@ -102,7 +102,7 @@ static_library("crypto") { configs -= [ "//starboard/build/config:size" ] configs += [ "//starboard/build/config:speed" ] - if (sb_is_modular) { + if (is_modular_toolchain && current_toolchain == cobalt_toolchain) { calling_convention = sabi_variables.calling_convention if ((calling_convention != "aarch64" && calling_convention != "eabi" && calling_convention != "sysv" && calling_convention != "windows") || diff --git a/third_party/libjpeg-turbo/BUILD.gn b/third_party/libjpeg-turbo/BUILD.gn index 43731152d8f5..e2ad5e06a89b 100644 --- a/third_party/libjpeg-turbo/BUILD.gn +++ b/third_party/libjpeg-turbo/BUILD.gn @@ -145,9 +145,9 @@ if (nasm_exists && (current_cpu == "x86" || current_cpu == "x64")) { } # TODO(b/206642994): look into whether we should condition on the -# floating_point_fpu SABI variable, rather than sb_is_modular, here as we did +# floating_point_fpu SABI variable, rather than (is_modular_toolchain && current_toolchain == cobalt_toolchain), here as we did # in third_party/libjpeg-turbo/libjpeg.gyp. -if (is_starboard && sb_is_modular && current_cpu == "arm" && arm_use_neon) { +if (is_starboard && (is_modular_toolchain && current_toolchain == cobalt_toolchain) && current_cpu == "arm" && arm_use_neon) { config("simd_arm_config") { cflags = [ "-mfpu=neon" ] } @@ -205,7 +205,7 @@ static_library("simd") { } configs += [ "//build/config/compiler:optimize_speed" ] - if (is_starboard && sb_is_modular && current_cpu == "arm") { + if (is_starboard && (is_modular_toolchain && current_toolchain == cobalt_toolchain) && current_cpu == "arm") { configs += [ ":simd_arm_config" ] } } else { @@ -316,7 +316,7 @@ static_library("libjpeg") { # TODO(b/236258535): Enable neon instructions once the code is updated # to use SbCPUFeatures() at runtime. if ((is_msan && (current_cpu == "x86" || current_cpu == "x64")) || - (is_starboard && sb_is_modular)) { + (is_starboard && (is_modular_toolchain && current_toolchain == cobalt_toolchain))) { sources += [ "jsimd_none.c" ] } else { public_deps += [ ":simd" ] diff --git a/third_party/zlib/BUILD.gn b/third_party/zlib/BUILD.gn index 83cb3275eadf..e6fba1709b25 100644 --- a/third_party/zlib/BUILD.gn +++ b/third_party/zlib/BUILD.gn @@ -23,9 +23,9 @@ if (current_cpu == "arm" || current_cpu == "arm64") { } # TODO(b/206642994): look into whether we should condition on the -# floating_point_fpu SABI variable, rather than sb_is_modular, here as we did +# floating_point_fpu SABI variable, rather than (is_modular_toolchain && current_toolchain == cobalt_toolchain), here as we did # in third_party/zlib/zlib.gyp. -if (is_starboard && sb_is_modular && target_cpu == "arm" && +if (is_starboard && (is_modular_toolchain && current_toolchain == cobalt_toolchain) && target_cpu == "arm" && use_arm_neon_optimizations) { config("zlib_neon_fpu_config") { cflags = [ "-mfpu=neon" ] @@ -80,7 +80,7 @@ source_set("zlib_adler32_simd") { configs += [ "//starboard/build/config:speed" ] } - if (is_starboard && sb_is_modular && target_cpu == "arm" && + if (is_starboard && (is_modular_toolchain && current_toolchain == cobalt_toolchain) && target_cpu == "arm" && use_arm_neon_optimizations) { configs += [ ":zlib_neon_fpu_config" ] } @@ -161,7 +161,7 @@ if (use_arm_neon_optimizations) { deps = [ "//starboard:starboard_headers_only" ] } - if (is_starboard && sb_is_modular && target_cpu == "arm" && + if (is_starboard && (is_modular_toolchain && current_toolchain == cobalt_toolchain) && target_cpu == "arm" && use_arm_neon_optimizations) { configs += [ ":zlib_neon_fpu_config" ] } @@ -236,7 +236,7 @@ source_set("zlib_inflate_chunk_simd") { configs += [ "//starboard/build/config:speed" ] } - if (is_starboard && sb_is_modular && target_cpu == "arm" && + if (is_starboard && (is_modular_toolchain && current_toolchain == cobalt_toolchain) && target_cpu == "arm" && use_arm_neon_optimizations) { configs += [ ":zlib_neon_fpu_config" ] }