--- build/config/compiler/BUILD.gn.orig 2022-05-07 05:44:29 UTC +++ build/config/compiler/BUILD.gn @@ -137,7 +137,7 @@ declare_args() { # # TODO(crbug.com/1131993): Enabling this when 'is_android' is true breaks # content_shell_test_apk on both ARM and x86. - init_stack_vars = !is_android + init_stack_vars = !is_android && !is_bsd # This argument is to control whether enabling text section splitting in the # final binary. When enabled, the separated text sections with prefix @@ -352,7 +352,7 @@ config("compiler") { } # Linker warnings. - if (fatal_linker_warnings && !is_apple && current_os != "aix" && + if (fatal_linker_warnings && !is_apple && !is_bsd && current_os != "aix" && current_os != "zos") { ldflags += [ "-Wl,--fatal-warnings" ] } @@ -522,7 +522,7 @@ config("compiler") { ldflags += [ "-Wl,-z,keep-text-section-prefix" ] } - if (is_clang && !is_nacl && current_os != "zos") { + if (is_clang && !is_nacl && !is_bsd && current_os != "zos") { cflags += [ "-fcrash-diagnostics-dir=" + clang_diagnostic_dir ] # TODO(hans): Remove this once Clang generates better optimized debug info @@ -918,7 +918,7 @@ config("compiler_cpu_abi") { cflags += [ "-mtune=$arm_tune" ] } } else if (current_cpu == "arm64") { - if (is_clang && !is_android && !is_nacl && !is_fuchsia) { + if (is_clang && !is_android && !is_nacl && !is_fuchsia && !is_bsd) { cflags += [ "--target=aarch64-linux-gnu" ] ldflags += [ "--target=aarch64-linux-gnu" ] } @@ -1239,7 +1239,7 @@ config("compiler_deterministic") { # different build directory like "out/feature_a" and "out/feature_b" if # we build same files with same compile flag. # Other paths are already given in relative, no need to normalize them. - if (is_nacl) { + if (is_nacl || is_bsd) { # TODO(https://crbug.com/1231236): Use -ffile-compilation-dir= here. cflags += [ "-Xclang", @@ -1252,7 +1252,7 @@ config("compiler_deterministic") { # and -fcoverage-compilation-dir=. cflags += [ "-ffile-compilation-dir=." ] } - if (!is_win) { + if (!is_win && !is_bsd) { # We don't use clang -cc1as on Windows (yet? https://crbug.com/762167) asmflags = [ "-Wa,-fdebug-compilation-dir,." ] } @@ -1506,7 +1506,7 @@ config("default_warnings") { "-Wno-unneeded-internal-declaration", ] - if (!is_nacl || is_nacl_saigo) { + if ((!is_nacl || is_nacl_saigo) && !is_bsd) { if (is_win) { # TODO(thakis): https://crbug.com/617318 # Currently goma can not handle case sensitiveness for windows well. @@ -1837,7 +1837,7 @@ config("thin_archive") { # archives. # TODO(crbug.com/1221615): Enable on is_apple if use_lld once that no longer # confuses lldb. - if ((is_posix && !is_nacl && !is_apple) || is_fuchsia) { + if ((is_posix && !is_nacl && !is_apple && !is_bsd) || is_fuchsia) { arflags = [ "-T" ] } else if (is_win && use_lld) { arflags = [ "/llvmlibthin" ] @@ -2338,7 +2338,7 @@ config("symbols") { # flag, so we can use use -g1 for pnacl and nacl-clang compiles. # gcc nacl is is_nacl && !is_clang, pnacl and nacl-clang are && is_clang. if ((!is_nacl || is_clang) && current_os != "zos") { - cflags += [ "-g2" ] + cflags += [ "-g0" ] } if (!is_nacl && is_clang && !is_tsan && !is_asan && @@ -2378,7 +2378,7 @@ config("symbols") { # sections" there. Maybe just a bug in nacl_switch_32.S. _enable_gdb_index = symbol_level == 2 && !is_apple && !is_nacl && current_cpu != "x86" && - current_os != "zos" && (use_gold || use_lld) && + current_os != "zos" && (use_gold || use_lld) && !is_bsd && # Disable on non-fission 32-bit Android because it pushes # libcomponents_unittests over the 4gb size limit. !(is_android && !use_debug_fission && current_cpu != "x64" && @@ -2396,7 +2396,7 @@ config("symbols") { } if (is_clang && (!is_nacl || is_nacl_saigo) && current_os != "zos") { - if (is_apple) { + if (is_apple || is_bsd) { # TODO(https://crbug.com/1050118): Investigate missing debug info on mac. # Make sure we don't use constructor homing on mac. cflags += [