| 1 | |
| 2 | |
| 3 | @@ -625,13 +625,6 @@
|
| 4 | ]
|
| 5 | }
|
| 6 |
|
| 7 | - # The performance improvement does not seem worth the risk. See
|
| 8 | - # https://crbug.com/484082200 for background and https://crrev.com/c/7593035
|
| 9 | - # for discussion.
|
| 10 | - if (!is_wasm) {
|
| 11 | - cflags += [ "-fno-lifetime-dse" ]
|
| 12 | - }
|
| 13 | -
|
| 14 | # TODO(hans): Remove this once Clang generates better optimized debug info
|
| 15 | # by default. https://crbug.com/765793
|
| 16 | cflags += [
|
| 17 | @@ -646,22 +639,6 @@
|
| 18 | }
|
| 19 | }
|
| 20 |
|
| 21 | - # TODO(crbug.com/40283598): This causes binary size growth and potentially
|
| 22 | - # other problems.
|
| 23 | - if (default_toolchain != "//build/toolchain/cros:target") {
|
| 24 | - cflags += [
|
| 25 | - "-mllvm",
|
| 26 | - "-split-threshold-for-reg-with-hint=0",
|
| 27 | - ]
|
| 28 | - if (use_thin_lto && is_a_target_toolchain) {
|
| 29 | - if (is_win) {
|
| 30 | - ldflags += [ "-mllvm:-split-threshold-for-reg-with-hint=0" ]
|
| 31 | - } else {
|
| 32 | - ldflags += [ "-Wl,-mllvm,-split-threshold-for-reg-with-hint=0" ]
|
| 33 | - }
|
| 34 | - }
|
| 35 | - }
|
| 36 | -
|
| 37 | # TODO(crbug.com/40192287): Investigate why/if this should be needed.
|
| 38 | if (is_win) {
|
| 39 | cflags += [ "/clang:-ffp-contract=off" ]
|
| 40 | @@ -1339,8 +1316,8 @@
|
| 41 | # simplicity we always explicitly set the architecture.
|
| 42 | if (current_cpu == "x64") {
|
| 43 | if (is_clang && !is_android && !is_fuchsia && !is_chromeos_device) {
|
| 44 | - cflags += [ "--target=x86_64-unknown-linux-gnu" ]
|
| 45 | - ldflags += [ "--target=x86_64-unknown-linux-gnu" ]
|
| 46 | + cflags += [ "--target=x86_64-alpine-linux-musl" ]
|
| 47 | + ldflags += [ "--target=x86_64-alpine-linux-musl" ]
|
| 48 | } else {
|
| 49 | cflags += [ "-m64" ]
|
| 50 | ldflags += [ "-m64" ]
|
| 51 | @@ -1353,8 +1330,8 @@
|
| 52 | }
|
| 53 | } else if (current_cpu == "x86") {
|
| 54 | if (is_clang && !is_android && !is_chromeos_device) {
|
| 55 | - cflags += [ "--target=i386-unknown-linux-gnu" ]
|
| 56 | - ldflags += [ "--target=i386-unknown-linux-gnu" ]
|
| 57 | + cflags += [ "--target=i586-alpine-linux-musl" ]
|
| 58 | + ldflags += [ "--target=i586-alpine-linux-musl" ]
|
| 59 | } else {
|
| 60 | cflags += [ "-m32" ]
|
| 61 | ldflags += [ "-m32" ]
|
| 62 | @@ -1365,8 +1342,8 @@
|
| 63 | ]
|
| 64 | } else if (current_cpu == "arm") {
|
| 65 | if (is_clang && !is_android && !is_chromeos_device) {
|
| 66 | - cflags += [ "--target=arm-linux-gnueabihf" ]
|
| 67 | - ldflags += [ "--target=arm-linux-gnueabihf" ]
|
| 68 | + cflags += [ "--target=armv7-alpine-linux-musleabihf" ]
|
| 69 | + ldflags += [ "--target=armv7-alpine-linux-musleabihf" ]
|
| 70 | }
|
| 71 | cflags += [
|
| 72 | "-march=$arm_arch",
|
| 73 | @@ -1374,8 +1351,8 @@
|
| 74 | ]
|
| 75 | } else if (current_cpu == "arm64") {
|
| 76 | if (is_clang && !is_android && !is_fuchsia && !is_chromeos_device) {
|
| 77 | - cflags += [ "--target=aarch64-linux-gnu" ]
|
| 78 | - ldflags += [ "--target=aarch64-linux-gnu" ]
|
| 79 | + cflags += [ "--target=aarch64-alpine-linux-musl" ]
|
| 80 | + ldflags += [ "--target=aarch64-alpine-linux-musl" ]
|
| 81 | }
|
| 82 | if (target_os == "chromeos" && cros_target_cpu_arch != "" &&
|
| 83 | is_a_target_toolchain) {
|
| 84 | @@ -1624,22 +1601,22 @@
|
| 85 | ldflags += [ "-maix64" ]
|
| 86 | }
|
| 87 | } else if (is_clang) {
|
| 88 | - cflags += [ "--target=powerpc64le-unknown-linux-gnu" ]
|
| 89 | - ldflags += [ "--target=powerpc64le-unknown-linux-gnu" ]
|
| 90 | + cflags += [ "--target=powerpc64le-alpine-linux-musl" ]
|
| 91 | + ldflags += [ "--target=powerpc64le-alpine-linux-musl" ]
|
| 92 | } else {
|
| 93 | cflags += [ "-m64" ]
|
| 94 | ldflags += [ "-m64" ]
|
| 95 | }
|
| 96 | } else if (current_cpu == "riscv64") {
|
| 97 | if (is_clang && !is_android) {
|
| 98 | - cflags += [ "--target=riscv64-linux-gnu" ]
|
| 99 | - ldflags += [ "--target=riscv64-linux-gnu" ]
|
| 100 | + cflags += [ "--target=riscv64-alpine-linux-musl" ]
|
| 101 | + ldflags += [ "--target=riscv64-alpine-linux-musl" ]
|
| 102 | }
|
| 103 | cflags += [ "-mabi=lp64d" ]
|
| 104 | } else if (current_cpu == "loong64") {
|
| 105 | if (is_clang) {
|
| 106 | - cflags += [ "--target=loongarch64-linux-gnu" ]
|
| 107 | - ldflags += [ "--target=loongarch64-linux-gnu" ]
|
| 108 | + cflags += [ "--target=loongarch64-alpine-linux-musl" ]
|
| 109 | + ldflags += [ "--target=loongarch64-alpine-linux-musl" ]
|
| 110 | }
|
| 111 | cflags += [
|
| 112 | "-mabi=lp64d",
|
| 113 | @@ -1647,8 +1624,8 @@
|
| 114 | ]
|
| 115 | } else if (current_cpu == "s390x") {
|
| 116 | if (is_clang) {
|
| 117 | - cflags += [ "--target=s390x-unknown-linux-gnu" ]
|
| 118 | - ldflags += [ "--target=s390x-unknown-linux-gnu" ]
|
| 119 | + cflags += [ "--target=s390x-alpine-linux-musl" ]
|
| 120 | + ldflags += [ "--target=s390x-alpine-linux-musl" ]
|
| 121 | }
|
| 122 | cflags += [ "-m64" ]
|
| 123 | ldflags += [ "-m64" ]
|
| 124 | @@ -1929,12 +1906,6 @@
|
| 125 | cflags = [
|
| 126 | "-fsanitize=return",
|
| 127 | "-fsanitize-trap=return",
|
| 128 | -
|
| 129 | - # Some code users feature detection to determine if UBSAN (or any
|
| 130 | - # sanitizer) is enabled, they then do expensive debug like operations. We
|
| 131 | - # want to suppress this behaviour since we want to keep performance costs
|
| 132 | - # as low as possible while having these checks.
|
| 133 | - "-fsanitize-ignore-for-ubsan-feature=return",
|
| 134 | ]
|
| 135 | }
|
| 136 | }
|
| 137 | @@ -2432,7 +2403,7 @@
|
| 138 | defines = [ "_HAS_NODISCARD" ]
|
| 139 | }
|
| 140 | } else {
|
| 141 | - cflags = [ "-Wall" ]
|
| 142 | + cflags = []
|
| 143 | if (is_clang) {
|
| 144 | # Enable extra warnings for chromium_code when we control the compiler.
|
| 145 | cflags += [ "-Wextra" ]
|
| 146 | |
| 147 | |
| 148 | @@ -213,11 +213,11 @@
|
| 149 | rust_abi_target = ""
|
| 150 | if (is_linux || is_chromeos) {
|
| 151 | if (current_cpu == "arm64") {
|
| 152 | - rust_abi_target = "aarch64-unknown-linux-gnu"
|
| 153 | + rust_abi_target = "aarch64-alpine-linux-musl"
|
| 154 | } else if (current_cpu == "x86") {
|
| 155 | - rust_abi_target = "i686-unknown-linux-gnu"
|
| 156 | + rust_abi_target = "i586-alpine-linux-musl"
|
| 157 | } else if (current_cpu == "x64") {
|
| 158 | - rust_abi_target = "x86_64-unknown-linux-gnu"
|
| 159 | + rust_abi_target = "x86_64-alpine-linux-musl"
|
| 160 | } else if (current_cpu == "arm") {
|
| 161 | if (arm_float_abi == "hard") {
|
| 162 | float_suffix = "hf"
|
| 163 | @@ -235,21 +235,21 @@
|
| 164 | # The thumbv7 vs. armv7 distinction is for legacy reasons and both
|
| 165 | # targets in fact target Thumb, see:
|
| 166 | # https://github.com/rust-lang/rust/issues/44722
|
| 167 | - rust_abi_target = "thumbv7neon-unknown-linux-gnueabi" + float_suffix
|
| 168 | + rust_abi_target = "armv7-alpine-linux-musleabi" + float_suffix
|
| 169 | } else {
|
| 170 | - rust_abi_target = "arm-unknown-linux-gnueabi" + float_suffix
|
| 171 | + rust_abi_target = "armv6-alpine-linux-musleabi" + float_suffix
|
| 172 | }
|
| 173 | } else if (current_cpu == "riscv64") {
|
| 174 | - rust_abi_target = "riscv64gc-unknown-linux-gnu"
|
| 175 | + rust_abi_target = "riscv64-alpine-linux-musl"
|
| 176 | } else if (current_cpu == "ppc64") {
|
| 177 | - rust_abi_target = "powerpc64le-unknown-linux-gnu"
|
| 178 | + rust_abi_target = "powerpc64le-alpine-linux-musl"
|
| 179 | } else if (current_cpu == "s390x") {
|
| 180 | - rust_abi_target = "s390x-unknown-linux-gnu"
|
| 181 | + rust_abi_target = "s390x-alpine-linux-musl"
|
| 182 | } else if (current_cpu == "loong64") {
|
| 183 | - rust_abi_target = "loongarch64-unknown-linux-gnu"
|
| 184 | + rust_abi_target = "loongarch64-alpine-linux-musl"
|
| 185 | } else {
|
| 186 | # Best guess for other future platforms.
|
| 187 | - rust_abi_target = current_cpu + "-unknown-linux-gnu"
|
| 188 | + rust_abi_target = current_cpu + "-alpine-linux-musl"
|
| 189 | }
|
| 190 | } else if (is_android) {
|
| 191 | import("//build/config/android/abi.gni")
|
| 192 | |
| 193 | |
| 194 | @@ -207,22 +207,23 @@
|
| 195 | assert(false) # Unhandled cpu type
|
| 196 | }
|
| 197 | } else if (is_linux || is_chromeos) {
|
| 198 | + _dir = "linux"
|
| 199 | if (current_cpu == "x64") {
|
| 200 | - _dir = "x86_64-unknown-linux-gnu"
|
| 201 | + _suffix = "-x86_64"
|
| 202 | } else if (current_cpu == "x86") {
|
| 203 | - _dir = "i386-unknown-linux-gnu"
|
| 204 | + _suffix = "-i386"
|
| 205 | } else if (current_cpu == "arm") {
|
| 206 | - _dir = "armv7-unknown-linux-gnueabihf"
|
| 207 | + _suffix = "-armhf"
|
| 208 | } else if (current_cpu == "arm64") {
|
| 209 | - _dir = "aarch64-unknown-linux-gnu"
|
| 210 | + _suffix = "-aarch64"
|
| 211 | } else if (current_cpu == "loong64") {
|
| 212 | - _dir = "loongarch64-unknown-linux-gnu"
|
| 213 | + _suffix = "-loongarch64"
|
| 214 | } else if (current_cpu == "riscv64") {
|
| 215 | - _dir = "riscv64-unknown-linux-gnu"
|
| 216 | + _suffix = "-riscv64"
|
| 217 | } else if (current_cpu == "ppc64") {
|
| 218 | - _dir = "ppc64le-unknown-linux-gnu"
|
| 219 | + _suffix = "-powerpc64le"
|
| 220 | } else if (current_cpu == "s390x") {
|
| 221 | - _dir = "s390x-unknown-linux-gnu"
|
| 222 | + _suffix = "-s390x"
|
| 223 | } else {
|
| 224 | assert(false) # Unhandled cpu type
|
| 225 | }
|