Skip to content

Commit

Permalink
Switch boringssl to the pre-generated GN source list.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
rmacnak-google authored and Commit Queue committed Dec 2, 2024
1 parent a635ccf commit 11a1125
Show file tree
Hide file tree
Showing 4 changed files with 92 additions and 5 deletions.
3 changes: 0 additions & 3 deletions DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ vars = {

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

Var("dart_root") + "/third_party/boringssl":
Var("dart_git") + "boringssl_gen.git" + "@" + Var("boringssl_gen_rev"),
Var("dart_root") + "/third_party/boringssl/src":
"https://boringssl.googlesource.com/boringssl.git" +
"@" + Var("boringssl_rev"),
Expand Down
91 changes: 91 additions & 0 deletions third_party/boringssl/BUILD.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# Copyright 2014 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//build/config/android/config.gni")
import("//build/config/arm.gni")
import("//build/config/compiler/compiler.gni")
import("//build/config/sanitizers/sanitizers.gni")
import("//build_overrides/build.gni")
import("src/gen/sources.gni")

# Config for us and everybody else depending on BoringSSL.
config("external_config") {
include_dirs = [ "src/include" ]
if (is_component_build) {
defines = [ "BORINGSSL_SHARED_LIBRARY" ]
}
}

# The config used by the :boringssl component itself, and the fuzzer copies.
config("component_config") {
visibility = [ ":*" ]
configs = [ ":internal_config" ]
defines = [ "BORINGSSL_IMPLEMENTATION" ]
}

# This config is used by anything that consumes internal headers. Tests consume
# this rather than :component_config.
config("internal_config") {
visibility = [ ":*" ]
defines = [
"OPENSSL_SMALL",
"OPENSSL_STATIC_ARMCAP",
]
if (is_posix) {
defines += [ "_XOPEN_SOURCE=700" ]
}
}

config("no_asm_config") {
visibility = [ ":*" ]
defines = [ "OPENSSL_NO_ASM" ]
}

# TODO(crbug.com/42290535): Move Chromium's use of libpki to the public API and
# unexport pki_internal_headers.
all_sources = bcm_internal_headers + bcm_sources + crypto_internal_headers +
crypto_sources + ssl_internal_headers + ssl_sources + pki_sources
all_headers = crypto_headers + ssl_headers + pki_headers + pki_internal_headers

if (is_msan) {
# MSan instrumentation is incompatible with assembly optimizations.
# BoringSSL's GAS-compatible assembly knows how to detect MSan, but the NASM
# assembly does not, so we check for MSan explicitly.
source_set("boringssl_asm") {
visibility = [ ":*" ]
public_configs = [ ":no_asm_config" ]
}
} else if (is_win && (current_cpu == "x86" || current_cpu == "x64")) {
# Windows' x86 and x86_64 assembly is built with NASM.
source_set("boringssl_asm") {
visibility = [ ":*" ]
public_configs = [ ":no_asm_config" ]
}
} else {
# All other targets use GAS-compatible assembler. BoringSSL's assembly files
# are all wrapped in processor checks for the corresponding target, so there
# is no need to add target conditions in the build.
source_set("boringssl_asm") {
visibility = [ ":*" ]
sources = rebase_path(bcm_sources_asm + crypto_sources_asm, ".", "src")
include_dirs = [ "src/include" ]
}
}

source_set("boringssl") {
sources = rebase_path(all_sources, ".", "src")
public = rebase_path(all_headers, ".", "src")

if (is_win) {
configs += [ ":no_asm_config" ]
} else {
deps = [ ":boringssl_asm" ]
}

public_configs = [ ":external_config" ]
configs += [ ":component_config" ]

configs -= [ "//build/config/compiler:chromium_code" ]
configs += [ "//build/config/compiler:no_chromium_code" ]
}
1 change: 1 addition & 0 deletions third_party/boringssl/OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
file:/tools/OWNERS_VM
2 changes: 0 additions & 2 deletions tools/gn.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,6 @@ def ToGnArgs(args, mode, arch, target_os, sanitizer, verify_sdk_hash,
if gn_args['target_os'] in ['linux', 'win']:
gn_args['dart_use_fallback_root_certificates'] = True

gn_args['bssl_use_clang_integrated_as'] = True

if gn_args['target_os'] == 'linux':
if gn_args['target_cpu'] == 'arm':
# Default to -mfloat-abi=hard and -mfpu=neon for arm on Linux as we're
Expand Down

0 comments on commit 11a1125

Please sign in to comment.