diff options
Diffstat (limited to 'www/chromium-uc/patches/patch-build_config_compiler_BUILD_gn')
| -rw-r--r-- | www/chromium-uc/patches/patch-build_config_compiler_BUILD_gn | 139 |
1 files changed, 139 insertions, 0 deletions
diff --git a/www/chromium-uc/patches/patch-build_config_compiler_BUILD_gn b/www/chromium-uc/patches/patch-build_config_compiler_BUILD_gn new file mode 100644 index 0000000..0b57051 --- /dev/null +++ b/www/chromium-uc/patches/patch-build_config_compiler_BUILD_gn | |||
| @@ -0,0 +1,139 @@ | |||
| 1 | $OpenBSD: patch-build_config_compiler_BUILD_gn,v 1.56 2021/11/16 11:28:45 robert Exp $ | ||
| 2 | |||
| 3 | Index: build/config/compiler/BUILD.gn | ||
| 4 | --- build/config/compiler/BUILD.gn.orig | ||
| 5 | +++ build/config/compiler/BUILD.gn | ||
| 6 | @@ -153,7 +153,7 @@ declare_args() { | ||
| 7 | |||
| 8 | # Token limits may not be accurate for build configs not covered by the CQ, | ||
| 9 | # so only enable them by default for mainstream build configs. | ||
| 10 | - enable_wmax_tokens = | ||
| 11 | + enable_wmax_tokens = !is_openbsd && | ||
| 12 | !is_official_build && !(is_component_build && !is_debug) && | ||
| 13 | ((is_mac && target_cpu == "x64" && !use_system_xcode) || | ||
| 14 | (is_linux && !is_chromeos && target_cpu == "x64") || | ||
| 15 | @@ -240,12 +240,8 @@ config("default_include_dirs") { | ||
| 16 | # Compiler instrumentation can introduce dependencies in DSOs to symbols in | ||
| 17 | # the executable they are loaded into, so they are unresolved at link-time. | ||
| 18 | config("no_unresolved_symbols") { | ||
| 19 | - if (!using_sanitizer && | ||
| 20 | - (is_linux || is_chromeos || is_android || is_fuchsia)) { | ||
| 21 | - ldflags = [ | ||
| 22 | - "-Wl,-z,defs", | ||
| 23 | - "-Wl,--as-needed", | ||
| 24 | - ] | ||
| 25 | + if (current_cpu == "x86" && is_openbsd) { | ||
| 26 | + ldflags = [ "-Wl,-z,notext" ] | ||
| 27 | } | ||
| 28 | } | ||
| 29 | |||
| 30 | @@ -441,6 +437,7 @@ config("compiler") { | ||
| 31 | } | ||
| 32 | |||
| 33 | ldflags += [ | ||
| 34 | + "-Wl,-z,wxneeded", | ||
| 35 | "-Wl,-z,noexecstack", | ||
| 36 | "-Wl,-z,relro", | ||
| 37 | ] | ||
| 38 | @@ -533,7 +530,7 @@ config("compiler") { | ||
| 39 | ldflags += [ "-Wl,-z,keep-text-section-prefix" ] | ||
| 40 | } | ||
| 41 | |||
| 42 | - if (is_clang && !is_nacl && !use_xcode_clang) { | ||
| 43 | + if (is_clang && !is_nacl && !use_xcode_clang && !is_openbsd) { | ||
| 44 | cflags += [ "-fcrash-diagnostics-dir=" + clang_diagnostic_dir ] | ||
| 45 | |||
| 46 | # TODO(hans): Remove this once Clang generates better optimized debug info | ||
| 47 | @@ -890,7 +887,7 @@ config("compiler_cpu_abi") { | ||
| 48 | ] | ||
| 49 | } | ||
| 50 | } else if (current_cpu == "arm") { | ||
| 51 | - if (is_clang && !is_android && !is_nacl) { | ||
| 52 | + if (is_clang && !is_android && !is_nacl && !is_openbsd) { | ||
| 53 | cflags += [ "--target=arm-linux-gnueabihf" ] | ||
| 54 | ldflags += [ "--target=arm-linux-gnueabihf" ] | ||
| 55 | } | ||
| 56 | @@ -904,7 +901,7 @@ config("compiler_cpu_abi") { | ||
| 57 | cflags += [ "-mtune=$arm_tune" ] | ||
| 58 | } | ||
| 59 | } else if (current_cpu == "arm64") { | ||
| 60 | - if (is_clang && !is_android && !is_nacl && !is_fuchsia) { | ||
| 61 | + if (is_clang && !is_android && !is_nacl && !is_fuchsia && !is_openbsd) { | ||
| 62 | cflags += [ "--target=aarch64-linux-gnu" ] | ||
| 63 | ldflags += [ "--target=aarch64-linux-gnu" ] | ||
| 64 | } | ||
| 65 | @@ -1248,7 +1245,7 @@ config("compiler_deterministic") { | ||
| 66 | # different build directory like "out/feature_a" and "out/feature_b" if | ||
| 67 | # we build same files with same compile flag. | ||
| 68 | # Other paths are already given in relative, no need to normalize them. | ||
| 69 | - if (is_nacl) { | ||
| 70 | + if (is_nacl || is_openbsd) { | ||
| 71 | # TODO(https://crbug.com/1231236): Use -ffile-compilation-dir= here. | ||
| 72 | cflags += [ | ||
| 73 | "-Xclang", | ||
| 74 | @@ -1510,11 +1507,6 @@ config("default_warnings") { | ||
| 75 | cflags += [ | ||
| 76 | "-Wenum-compare-conditional", | ||
| 77 | |||
| 78 | - # An ABI compat warning we don't care about, https://crbug.com/1102157 | ||
| 79 | - # TODO(thakis): Push this to the (few) targets that need it, | ||
| 80 | - # instead of having a global flag. | ||
| 81 | - "-Wno-psabi", | ||
| 82 | - | ||
| 83 | # Ignore warnings about MSVC optimization pragmas. | ||
| 84 | # TODO(thakis): Only for no_chromium_code? http://crbug.com/912662 | ||
| 85 | "-Wno-ignored-pragma-optimize", | ||
| 86 | @@ -1524,7 +1516,7 @@ config("default_warnings") { | ||
| 87 | ] | ||
| 88 | |||
| 89 | # NaCl does not support flags from ToT. | ||
| 90 | - if (!is_nacl) { | ||
| 91 | + if (!is_nacl && !is_openbsd) { | ||
| 92 | cflags += [ | ||
| 93 | # TODO(https://crbug.com/1203071): Clean up and enable. | ||
| 94 | "-Wno-unused-but-set-parameter", | ||
| 95 | @@ -1684,7 +1676,7 @@ config("no_chromium_code") { | ||
| 96 | # third-party libraries. | ||
| 97 | "-Wno-c++11-narrowing", | ||
| 98 | ] | ||
| 99 | - if (!is_nacl && (current_toolchain == host_toolchain || !use_xcode_clang)) { | ||
| 100 | + if (!is_nacl && (current_toolchain == host_toolchain || !use_xcode_clang) && !is_openbsd) { | ||
| 101 | cflags += [ | ||
| 102 | # TODO(https://crbug.com/1202159): Clean up and enable. | ||
| 103 | "-Wno-misleading-indentation", | ||
| 104 | @@ -1764,7 +1756,7 @@ config("thin_archive") { | ||
| 105 | # archives. | ||
| 106 | # TODO(crbug.com/1221615): Enable on is_apple if use_lld once that no longer | ||
| 107 | # confuses lldb. | ||
| 108 | - if ((is_posix && !is_nacl && !is_apple) || is_fuchsia) { | ||
| 109 | + if ((is_posix && !is_nacl && !is_apple && !is_openbsd) || is_fuchsia) { | ||
| 110 | arflags = [ "-T" ] | ||
| 111 | } else if (is_win && use_lld) { | ||
| 112 | arflags = [ "/llvmlibthin" ] | ||
| 113 | @@ -2166,7 +2158,7 @@ config("afdo_optimize_size") { | ||
| 114 | # between //base/allocator:tcmalloc and AFDO on GCC), so we provide a separate | ||
| 115 | # config to allow AFDO to be disabled per-target. | ||
| 116 | config("afdo") { | ||
| 117 | - if (is_clang) { | ||
| 118 | + if (is_clang && !is_openbsd) { | ||
| 119 | cflags = [] | ||
| 120 | if (clang_emit_debug_info_for_profiling) { | ||
| 121 | # Add the following flags to generate debug info for profiling. | ||
| 122 | @@ -2182,7 +2174,7 @@ config("afdo") { | ||
| 123 | cflags += [ "-fprofile-sample-use=${rebased_clang_sample_profile}" ] | ||
| 124 | inputs = [ _clang_sample_profile ] | ||
| 125 | } | ||
| 126 | - } else if (auto_profile_path != "" && is_a_target_toolchain) { | ||
| 127 | + } else if (auto_profile_path != "" && is_a_target_toolchain && !is_openbsd) { | ||
| 128 | cflags = [ "-fauto-profile=${auto_profile_path}" ] | ||
| 129 | inputs = [ auto_profile_path ] | ||
| 130 | } | ||
| 131 | @@ -2311,7 +2303,7 @@ config("symbols") { | ||
| 132 | } | ||
| 133 | } | ||
| 134 | |||
| 135 | - if (is_clang && !is_nacl && !use_xcode_clang) { | ||
| 136 | + if (is_clang && !is_nacl && !use_xcode_clang && !is_openbsd) { | ||
| 137 | if (is_apple) { | ||
| 138 | # TODO(https://crbug.com/1050118): Investigate missing debug info on mac. | ||
| 139 | # Make sure we don't use constructor homing on mac. | ||
