--- cargo-crates/v8-0.106.0/build/config/compiler/BUILD.gn.orig 1973-11-29 22:33:09 UTC +++ cargo-crates/v8-0.106.0/build/config/compiler/BUILD.gn @@ -200,7 +200,7 @@ declare_args() { # This greatly reduces the size of debug builds, at the cost of # debugging information which is required by some specialized # debugging tools. - simple_template_names = is_clang && !is_nacl && !is_win && !is_apple + simple_template_names = is_clang && !is_nacl && !is_win && !is_apple && !is_bsd # Limits the debuginfo that gets generated in "minimal symbols" mode to just # line tables. This flag only has any effect when `symbol_level` is set to 1. @@ -269,13 +269,16 @@ config("no_unresolved_symbols") { # Compiler instrumentation can introduce dependencies in DSOs to symbols in # the executable they are loaded into, so they are unresolved at link-time. config("no_unresolved_symbols") { - if (!using_sanitizer && + if (!using_sanitizer && !is_bsd && (is_linux || is_chromeos || is_android || is_fuchsia)) { ldflags = [ "-Wl,-z,defs", "-Wl,--as-needed", ] } + if (current_cpu == "x86" && is_openbsd) { + ldflags = [ "-Wl,-z,notext", "-Wl,--strip-all" ] + } } # compiler --------------------------------------------------------------------- @@ -521,6 +524,10 @@ config("compiler") { } } + if (is_openbsd) { + ldflags += [ "-Wl,-z,wxneeded" ] + } + # Linux-specific compiler flags setup. # ------------------------------------ if (use_icf && (!is_apple || use_lld)) { @@ -574,7 +581,7 @@ config("compiler") { ldflags += [ "-Wl,-z,keep-text-section-prefix" ] } - if (is_clang && !is_nacl) { + if (is_clang && !is_nacl && !is_bsd) { cflags += [ "-fcrash-diagnostics-dir=" + clang_diagnostic_dir ] if (save_reproducers_on_lld_crash && use_lld) { ldflags += [ @@ -1228,7 +1235,7 @@ config("compiler_cpu_abi") { ] } } else if (current_cpu == "arm") { - if (is_clang && !is_android && !is_nacl && + if (is_clang && !is_android && !is_nacl && !is_bsd && !(is_chromeos_lacros && is_chromeos_device)) { cflags += [ "--target=arm-linux-gnueabihf" ] ldflags += [ "--target=arm-linux-gnueabihf" ] @@ -1243,7 +1250,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 && !(is_chromeos_lacros && is_chromeos_device)) { cflags += [ "--target=aarch64-linux-gnu" ] ldflags += [ "--target=aarch64-linux-gnu" ] @@ -1578,7 +1585,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", @@ -1636,7 +1643,7 @@ config("clang_revision") { } config("clang_revision") { - if (is_clang && clang_base_path == default_clang_base_path && + if (is_clang && !is_bsd && clang_base_path == default_clang_base_path && current_os != "zos") { update_args = [ "--print-revision",