Skip to content

Commit 11a1125

Browse files
rmacnak-googleCommit Queue
authored andcommitted
Switch boringssl to the pre-generated GN source list.
With no generation step remaining on our end, stop using the boringssl_gen repository. This makes updating boringssl simple enough for an autoroller. Change-Id: Ice7a5cd6b8a2414405146011b7cf3f24dd92d0db Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/397985 Reviewed-by: Alexander Aprelev <aam@google.com> Commit-Queue: Ryan Macnak <rmacnak@google.com> Reviewed-by: Siva Annamalai <asiva@google.com>
1 parent a635ccf commit 11a1125

File tree

4 files changed

+92
-5
lines changed

4 files changed

+92
-5
lines changed

DEPS

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ vars = {
9898

9999
# Prefer to use hashes of binaryen that have been reviewed & rolled into g3.
100100
"binaryen_rev" : "93883fde36ac158fd415dcd6dbd387dcfd928d3c",
101-
"boringssl_gen_rev": "b67a5fe651e1618baa311e452e3c188d96db2021",
102101
"boringssl_rev": "cd95210465496ac2337b313cf49f607762abe286",
103102
"browser-compat-data_tag": "ac8cae697014da1ff7124fba33b0b4245cc6cd1b", # v1.0.22
104103
"cpu_features_rev": "936b9ab5515dead115606559502e3864958f7f6e",
@@ -304,8 +303,6 @@ deps = {
304303
Var("dart_root") + "/third_party/libcxxabi":
305304
Var("llvm_git") + "/llvm-project/libcxxabi" + "@" + Var("libcxxabi_rev"),
306305

307-
Var("dart_root") + "/third_party/boringssl":
308-
Var("dart_git") + "boringssl_gen.git" + "@" + Var("boringssl_gen_rev"),
309306
Var("dart_root") + "/third_party/boringssl/src":
310307
"https://boringssl.googlesource.com/boringssl.git" +
311308
"@" + Var("boringssl_rev"),

third_party/boringssl/BUILD.gn

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# Copyright 2014 The Chromium Authors
2+
# Use of this source code is governed by a BSD-style license that can be
3+
# found in the LICENSE file.
4+
5+
import("//build/config/android/config.gni")
6+
import("//build/config/arm.gni")
7+
import("//build/config/compiler/compiler.gni")
8+
import("//build/config/sanitizers/sanitizers.gni")
9+
import("//build_overrides/build.gni")
10+
import("src/gen/sources.gni")
11+
12+
# Config for us and everybody else depending on BoringSSL.
13+
config("external_config") {
14+
include_dirs = [ "src/include" ]
15+
if (is_component_build) {
16+
defines = [ "BORINGSSL_SHARED_LIBRARY" ]
17+
}
18+
}
19+
20+
# The config used by the :boringssl component itself, and the fuzzer copies.
21+
config("component_config") {
22+
visibility = [ ":*" ]
23+
configs = [ ":internal_config" ]
24+
defines = [ "BORINGSSL_IMPLEMENTATION" ]
25+
}
26+
27+
# This config is used by anything that consumes internal headers. Tests consume
28+
# this rather than :component_config.
29+
config("internal_config") {
30+
visibility = [ ":*" ]
31+
defines = [
32+
"OPENSSL_SMALL",
33+
"OPENSSL_STATIC_ARMCAP",
34+
]
35+
if (is_posix) {
36+
defines += [ "_XOPEN_SOURCE=700" ]
37+
}
38+
}
39+
40+
config("no_asm_config") {
41+
visibility = [ ":*" ]
42+
defines = [ "OPENSSL_NO_ASM" ]
43+
}
44+
45+
# TODO(crbug.com/42290535): Move Chromium's use of libpki to the public API and
46+
# unexport pki_internal_headers.
47+
all_sources = bcm_internal_headers + bcm_sources + crypto_internal_headers +
48+
crypto_sources + ssl_internal_headers + ssl_sources + pki_sources
49+
all_headers = crypto_headers + ssl_headers + pki_headers + pki_internal_headers
50+
51+
if (is_msan) {
52+
# MSan instrumentation is incompatible with assembly optimizations.
53+
# BoringSSL's GAS-compatible assembly knows how to detect MSan, but the NASM
54+
# assembly does not, so we check for MSan explicitly.
55+
source_set("boringssl_asm") {
56+
visibility = [ ":*" ]
57+
public_configs = [ ":no_asm_config" ]
58+
}
59+
} else if (is_win && (current_cpu == "x86" || current_cpu == "x64")) {
60+
# Windows' x86 and x86_64 assembly is built with NASM.
61+
source_set("boringssl_asm") {
62+
visibility = [ ":*" ]
63+
public_configs = [ ":no_asm_config" ]
64+
}
65+
} else {
66+
# All other targets use GAS-compatible assembler. BoringSSL's assembly files
67+
# are all wrapped in processor checks for the corresponding target, so there
68+
# is no need to add target conditions in the build.
69+
source_set("boringssl_asm") {
70+
visibility = [ ":*" ]
71+
sources = rebase_path(bcm_sources_asm + crypto_sources_asm, ".", "src")
72+
include_dirs = [ "src/include" ]
73+
}
74+
}
75+
76+
source_set("boringssl") {
77+
sources = rebase_path(all_sources, ".", "src")
78+
public = rebase_path(all_headers, ".", "src")
79+
80+
if (is_win) {
81+
configs += [ ":no_asm_config" ]
82+
} else {
83+
deps = [ ":boringssl_asm" ]
84+
}
85+
86+
public_configs = [ ":external_config" ]
87+
configs += [ ":component_config" ]
88+
89+
configs -= [ "//build/config/compiler:chromium_code" ]
90+
configs += [ "//build/config/compiler:no_chromium_code" ]
91+
}

third_party/boringssl/OWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
file:/tools/OWNERS_VM

tools/gn.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,8 +227,6 @@ def ToGnArgs(args, mode, arch, target_os, sanitizer, verify_sdk_hash,
227227
if gn_args['target_os'] in ['linux', 'win']:
228228
gn_args['dart_use_fallback_root_certificates'] = True
229229

230-
gn_args['bssl_use_clang_integrated_as'] = True
231-
232230
if gn_args['target_os'] == 'linux':
233231
if gn_args['target_cpu'] == 'arm':
234232
# Default to -mfloat-abi=hard and -mfpu=neon for arm on Linux as we're

0 commit comments

Comments
 (0)