$NetBSD: patch-src_3rdparty_chromium_v8_BUILD.gn,v 1.4 2023/04/12 19:24:07 adam Exp $ --- src/3rdparty/chromium/v8/BUILD.gn.orig 2022-03-30 09:48:18.000000000 +0000 +++ src/3rdparty/chromium/v8/BUILD.gn @@ -1482,6 +1482,23 @@ action("generate_bytecode_builtins_list" ] } +action("run_paxctl_mksnapshot") { + deps = [ ":mksnapshot($v8_snapshot_toolchain)" ] + + script = "tools/run-paxctl.py" + stamp = "$target_gen_dir/paxctl_stamp" + outputs = [ stamp ] + + sources = [] + data = [] + + args = [ + rebase_path(stamp, root_build_dir), "/usr/sbin/paxctl", "+m", "./" + rebase_path(get_label_info(":mksnapshot($v8_snapshot_toolchain)", + "root_out_dir") + "/mksnapshot", + root_build_dir), + ] +} + # Template to generate different V8 snapshots based on different runtime flags. # Can be invoked with run_mksnapshot(). The target will resolve to # run_mksnapshot_. If is "default", no file suffixes will be used. @@ -1506,7 +1523,11 @@ template("run_mksnapshot") { "tools/debug_helper:run_mkgrokdump", ] - deps = [ ":mksnapshot($v8_snapshot_toolchain)" ] + if (is_bsd) { + deps = [ ":mksnapshot($v8_snapshot_toolchain)", ":run_paxctl_mksnapshot" ] + } else { + deps = [ ":mksnapshot($v8_snapshot_toolchain)" ] + } script = "tools/run.py" @@ -3516,7 +3537,7 @@ v8_source_set("v8_base_without_compiler" # iOS Xcode simulator builds run on an x64 target. iOS and macOS are both # based on Darwin and thus POSIX-compliant to a similar degree. - if (is_linux || is_chromeos || is_mac || is_ios || target_os == "freebsd") { + if (is_linux || is_chromeos || is_mac || is_ios || target_os == "freebsd" || is_bsd) { sources += [ "src/trap-handler/handler-inside-posix.cc", "src/trap-handler/handler-inside-posix.h", @@ -3871,7 +3892,7 @@ v8_source_set("v8_base_without_compiler" v8_add_configs += [ "//build/config/compiler:no_symbols" ] } - if (v8_enable_vtunetracemark && (is_linux || is_chromeos || is_win)) { + if (v8_enable_vtunetracemark && (is_linux || is_chromeos || is_win || is_bsd)) { sources += [ "src/extensions/vtunedomain-support-extension.cc", "src/extensions/vtunedomain-support-extension.h", @@ -4126,6 +4147,16 @@ v8_component("v8_libbase") { "dl", "rt", ] + } else if (is_netbsd) { + sources += [ + "src/base/debug/stack_trace_posix.cc", + "src/base/platform/platform-openbsd.cc", + ] + + libs = [ + "rt", + "execinfo", + ] } else if (current_os == "aix") { sources += [ "src/base/debug/stack_trace_posix.cc", @@ -4525,6 +4556,10 @@ if (current_toolchain == v8_generator_to "src/interpreter/bytecodes.h", ] + if (is_bsd) { + libs = ["execinfo"] + } + configs = [ ":internal_config" ] deps = [