$NetBSD: patch-src_3rdparty_chromium_build_config_compiler_BUILD.gn,v 1.2 2022/04/18 11:18:18 adam Exp $ --- src/3rdparty/chromium/build/config/compiler/BUILD.gn.orig 2021-02-19 16:41:59.000000000 +0000 +++ src/3rdparty/chromium/build/config/compiler/BUILD.gn @@ -241,7 +241,7 @@ config("compiler") { configs += [ "//build/config/win:compiler" ] } else if (is_android) { configs += [ "//build/config/android:compiler" ] - } else if (is_linux || is_chromeos) { + } else if (is_linux || is_chromeos || is_bsd) { configs += [ "//build/config/linux:compiler" ] if (is_chromeos) { configs += [ "//build/config/chromeos:compiler" ] @@ -385,7 +385,7 @@ config("compiler") { # Linux/Android/Fuchsia common flags setup. # --------------------------------- - if (is_linux || is_chromeos || is_android || is_fuchsia) { + if (is_linux || is_chromeos || is_android || is_fuchsia || is_bsd) { asmflags += [ "-fPIC" ] cflags += [ "-fPIC" ] ldflags += [ "-fPIC" ] @@ -407,7 +407,7 @@ config("compiler") { # Compiler instrumentation can introduce dependencies in DSOs to symbols in # the executable they are loaded into, so they are unresolved at link-time. - if (!using_sanitizer) { + if (!using_sanitizer && !is_bsd) { ldflags += [ "-Wl,-z,defs", "-Wl,--as-needed", @@ -458,7 +458,7 @@ config("compiler") { ldflags += [ "-Wl,--icf=all" ] } - if (is_linux || is_chromeos) { + if (is_linux || is_chromeos || is_bsd) { cflags += [ "-pthread" ] # Do not use the -pthread ldflag here since it becomes a no-op # when using -nodefaultlibs, which would cause an unused argument @@ -498,7 +498,7 @@ config("compiler") { ldflags += [ "-Wl,-z,keep-text-section-prefix" ] } - if (is_clang && !is_nacl && !use_xcode_clang && !use_qt) { + if (is_clang && !is_nacl && !use_xcode_clang && !use_qt && !is_bsd) { cflags += [ "-fcrash-diagnostics-dir=" + clang_diagnostic_dir ] cflags += [ @@ -531,7 +531,7 @@ config("compiler") { # C11/C++11 compiler flags setup. # --------------------------- if (is_linux || is_chromeos || is_android || (is_nacl && is_clang) || - current_os == "aix") { + current_os == "aix" || is_bsd) { if (target_os == "android") { cxx11_override = use_cxx11_on_android } else { @@ -1148,7 +1148,7 @@ config("compiler_deterministic") { "-Xclang", ".", ] - 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,." ] } @@ -1253,7 +1253,7 @@ config("runtime_library") { # smaller. if (is_win) { configs += [ "//build/config/win:runtime_library" ] - } else if (is_linux || is_chromeos) { + } else if (is_linux || is_chromeos || is_bsd) { configs += [ "//build/config/linux:runtime_library" ] } else if (is_ios) { configs += [ "//build/config/ios:runtime_library" ] @@ -1550,7 +1550,7 @@ config("default_warnings") { cflags += [ "-Wno-nonportable-include-path" ] } - if (current_toolchain == host_toolchain || !use_xcode_clang) { + if ((current_toolchain == host_toolchain || !use_xcode_clang) && !is_bsd) { # Flags NaCl (Clang 3.7) and Xcode 9.2 (Clang clang-900.0.39.2) do not # recognize. cflags += [ @@ -1802,7 +1802,7 @@ config("thin_archive") { # Mac and iOS use the mac-specific "libtool" command, not ar, which doesn't # have a "thin archive" mode (it does accept -T, but it means truncating # archive names to 16 characters, which is not what we want). - 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" ] @@ -2385,7 +2385,7 @@ config("symbols") { # DWARF info may be corrupt; offsets in a range list entry are in different # sections" there. Maybe just a bug in nacl_switch_32.S. if (!is_apple && !is_nacl && current_cpu != "x86" && - (use_gold || use_lld)) { + (use_gold || use_lld) && !is_bsd) { if (is_clang) { # This flag enables the GNU-format pubnames and pubtypes sections, # which lld needs in order to generate a correct GDB index.