Stop setting is_posix for Fuchsia.

This sets is_posix to false for the Fuchsia build as it will rely less
and less on the POSIX implementation. Follow-up CLs will clean up build
files from redundant checks and stop including _posix files by default.

Bug: 812974
Change-Id: I6dc625ba2d4919a775041b1516e051b471c50e97
Reviewed-on: https://chromium-review.googlesource.com/987377
Commit-Queue: Fabrice de Gans-Riberi <fdegans@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Reviewed-by: Scott Graham <scottmg@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Reviewed-by: David Benjamin <davidben@chromium.org>
Reviewed-by: Ken Rockot <rockot@chromium.org>
Reviewed-by: Chrome Cunningham <chcunningham@chromium.org>
Reviewed-by: Sergey Ulanov <sergeyu@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#550292}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 9fba3affd0a3246f2ec851c5f83cc3588a379086
This commit is contained in:
Fabrice de Gans-Riberi 2018-04-12 19:00:48 +00:00 коммит произвёл Commit Bot
Родитель b95dec44e1
Коммит 19a9832197
6 изменённых файлов: 33 добавлений и 23 удалений

Просмотреть файл

@ -349,7 +349,7 @@ if (current_os == "win" || current_os == "winuwp") {
is_linux = false is_linux = false
is_mac = false is_mac = false
is_nacl = false is_nacl = false
is_posix = true is_posix = false
is_win = false is_win = false
} else if (current_os == "ios") { } else if (current_os == "ios") {
is_android = false is_android = false
@ -400,7 +400,9 @@ if (current_os == "win" || current_os == "winuwp") {
# DO NOT ADD MORE PATTERNS TO THIS LIST, see set_sources_assignment_filter call # DO NOT ADD MORE PATTERNS TO THIS LIST, see set_sources_assignment_filter call
# below. # below.
sources_assignment_filter = [] sources_assignment_filter = []
if (!is_posix) {
# TODO(crbug.com/812974): Clean up _posix files and remove Fuchsia here.
if (!is_posix && !is_fuchsia) {
sources_assignment_filter += [ sources_assignment_filter += [
"*_posix.h", "*_posix.h",
"*_posix.cc", "*_posix.cc",
@ -557,6 +559,10 @@ if (is_posix) {
} }
} }
if (is_fuchsia) {
default_compiler_configs += [ "//build/config/gcc:symbol_visibility_hidden" ]
}
if (is_android) { if (is_android) {
default_compiler_configs += default_compiler_configs +=
[ "//build/config/android:default_cygprofile_instrumentation" ] [ "//build/config/android:default_cygprofile_instrumentation" ]

Просмотреть файл

@ -145,12 +145,12 @@ declare_args() {
# other architectures. # other architectures.
# #
# lld doesn't have the bug. # lld doesn't have the bug.
use_icf = use_icf = (is_posix || is_fuchsia) && !using_sanitizer &&
is_posix && !using_sanitizer && !(is_android && use_order_profiling) && !(is_android && use_order_profiling) &&
((use_lld && !is_nacl) || ((use_lld && !is_nacl) ||
(use_gold && (use_gold &&
((!is_android && linux_use_bundled_binutils) || is_chromeos || ((!is_android && linux_use_bundled_binutils) || is_chromeos ||
!(current_cpu == "x86" || current_cpu == "x64")))) !(current_cpu == "x86" || current_cpu == "x64"))))
} }
# Apply the default logic for these values if they were not set explicitly. # Apply the default logic for these values if they were not set explicitly.
@ -253,7 +253,7 @@ config("compiler") {
} else { } else {
cflags += [ "-fstack-protector" ] cflags += [ "-fstack-protector" ]
} }
} else if (is_posix && !is_chromeos && !is_nacl) { } else if ((is_posix && !is_chromeos && !is_nacl) || is_fuchsia) {
# TODO(phajdan.jr): Use -fstack-protector-strong when our gcc supports it. # TODO(phajdan.jr): Use -fstack-protector-strong when our gcc supports it.
# See also https://crbug.com/533294 # See also https://crbug.com/533294
cflags += [ "--param=ssp-buffer-size=4" ] cflags += [ "--param=ssp-buffer-size=4" ]
@ -308,9 +308,9 @@ config("compiler") {
] ]
} }
# Non-Mac Posix compiler flags setup. # Non-Mac Posix and Fuchsia compiler flags setup.
# ----------------------------------- # -----------------------------------
if (is_posix && !(is_mac || is_ios)) { if ((is_posix && !(is_mac || is_ios)) || is_fuchsia) {
if (enable_profiling) { if (enable_profiling) {
if (!is_debug) { if (!is_debug) {
cflags += [ "-g" ] cflags += [ "-g" ]
@ -358,7 +358,7 @@ config("compiler") {
} }
} }
# Linux/Android common flags setup. # Linux/Android/Fuchsia common flags setup.
# --------------------------------- # ---------------------------------
if (is_linux || is_android || is_fuchsia) { if (is_linux || is_android || is_fuchsia) {
if (use_pic) { if (use_pic) {
@ -402,7 +402,7 @@ config("compiler") {
ldflags += [ "--gcc-toolchain=$_rebased_android_toolchain_root" ] ldflags += [ "--gcc-toolchain=$_rebased_android_toolchain_root" ]
} }
if (is_posix && use_lld && !is_nacl) { if ((is_posix || is_fuchsia) && use_lld && !is_nacl) {
ldflags += [ "-fuse-ld=lld" ] ldflags += [ "-fuse-ld=lld" ]
if (current_cpu == "arm64") { if (current_cpu == "arm64") {
# Reduce the page size from 65536 in order to reduce binary size slightly # Reduce the page size from 65536 in order to reduce binary size slightly
@ -658,7 +658,7 @@ config("compiler") {
# Assign any flags set for the C compiler to asmflags so that they are sent # Assign any flags set for the C compiler to asmflags so that they are sent
# to the assembler. The Windows assembler takes different types of flags # to the assembler. The Windows assembler takes different types of flags
# so only do so for posix platforms. # so only do so for posix platforms.
if (is_posix) { if (is_posix || is_fuchsia) {
asmflags += cflags asmflags += cflags
asmflags += cflags_c asmflags += cflags_c
} }
@ -674,7 +674,7 @@ config("compiler_cpu_abi") {
ldflags = [] ldflags = []
defines = [] defines = []
if (is_posix && !(is_mac || is_ios)) { if ((is_posix && !(is_mac || is_ios)) || is_fuchsia) {
# CPU architecture. We may or may not be doing a cross compile now, so for # CPU architecture. We may or may not be doing a cross compile now, so for
# simplicity we always explicitly set the architecture. # simplicity we always explicitly set the architecture.
if (current_cpu == "x64") { if (current_cpu == "x64") {
@ -1126,7 +1126,9 @@ config("runtime_library") {
configs += [ "//build/config/android:runtime_library" ] configs += [ "//build/config/android:runtime_library" ]
} }
if (is_posix) { # TODO(crbug.com/830987): Come up with a better name for is POSIX + Fuchsia
# configuration.
if (is_posix || is_fuchsia) {
configs += [ "//build/config/posix:runtime_library" ] configs += [ "//build/config/posix:runtime_library" ]
} }
@ -1561,7 +1563,7 @@ config("no_rtti") {
# 2. Remove the thin_archive config, so that the .a file actually contains all # 2. Remove the thin_archive config, so that the .a file actually contains all
# .o files, instead of just references to .o files in the build directoy # .o files, instead of just references to .o files in the build directoy
config("thin_archive") { config("thin_archive") {
if (is_posix && !is_nacl) { if ((is_posix && !is_nacl) || is_fuchsia) {
# TODO(thomasanderson): Enable on ChromeOS builds once # TODO(thomasanderson): Enable on ChromeOS builds once
# https://crbug.com/829956 is fixed. # https://crbug.com/829956 is fixed.
if (default_toolchain != "//build/toolchain/cros:target") { if (default_toolchain != "//build/toolchain/cros:target") {
@ -1759,7 +1761,7 @@ if (is_win) {
} }
config("default_stack_frames") { config("default_stack_frames") {
if (is_posix) { if (is_posix || is_fuchsia) {
if (enable_frame_pointers) { if (enable_frame_pointers) {
cflags = [ "-fno-omit-frame-pointer" ] cflags = [ "-fno-omit-frame-pointer" ]
} else { } else {

Просмотреть файл

@ -7,7 +7,7 @@ import("//build/config/fuchsia/rules.gni")
import("//build/config/sysroot.gni") import("//build/config/sysroot.gni")
assert(is_fuchsia) assert(is_fuchsia)
assert(is_posix) assert(!is_posix)
config("compiler") { config("compiler") {
sdk_version_file = rebase_path("$fuchsia_sdk/.hash") sdk_version_file = rebase_path("$fuchsia_sdk/.hash")

Просмотреть файл

@ -9,7 +9,9 @@ import("//build/config/sanitizers/sanitizers.gni")
import("//build/config/sysroot.gni") import("//build/config/sysroot.gni")
import("//build/toolchain/toolchain.gni") import("//build/toolchain/toolchain.gni")
assert(is_posix) # TODO(crbug.com/830987): Come up with a better name for is POSIX + Fuchsia
# configuration.
assert(is_posix || is_fuchsia)
group("posix") { group("posix") {
visibility = [ "//:optimize_gn_gen" ] visibility = [ "//:optimize_gn_gen" ]

Просмотреть файл

@ -170,7 +170,7 @@ config("default_sanitizer_ldflags") {
":deps", ":deps",
] ]
if (is_posix) { if (is_posix || is_fuchsia) {
ldflags = [] ldflags = []
if (is_asan) { if (is_asan) {
ldflags += [ "-fsanitize=address" ] ldflags += [ "-fsanitize=address" ]

Просмотреть файл

@ -77,7 +77,7 @@ if (is_mac || is_ios) {
# By appending .cr, we prevent name collisions with libraries already # By appending .cr, we prevent name collisions with libraries already
# loaded by the Android zygote. # loaded by the Android zygote.
shlib_extension = ".cr.so" shlib_extension = ".cr.so"
} else if (is_posix) { } else if (is_posix || is_fuchsia) {
shlib_extension = ".so" shlib_extension = ".so"
} else if (is_win) { } else if (is_win) {
shlib_extension = ".dll" shlib_extension = ".dll"
@ -86,7 +86,7 @@ if (is_mac || is_ios) {
} }
# Prefix for shared library files. # Prefix for shared library files.
if (is_posix) { if (is_posix || is_fuchsia) {
shlib_prefix = "lib" shlib_prefix = "lib"
} else { } else {
shlib_prefix = "" shlib_prefix = ""