bump to rust 1.59

This commit is contained in:
bridiver
2022-10-20 11:02:59 -04:00
committed by Mihai PLESA
parent 1776fde282
commit 3f73bf5038
7 changed files with 43 additions and 39 deletions
-20
View File
@@ -373,26 +373,6 @@ if (is_mac) {
brave_chrome_framework_bundle_deps = [ "//brave:framework_bundle_data" ]
brave_chrome_framework_contents = [ "Frameworks" ]
brave_chrome_framework_ldflags = []
# this needs to match the guards on //chrome:verify_chrome_framework_order
if (!is_component_build && chrome_pgo_phase != 1) {
brave_chrome_framework_public_deps += [
# TODO(bridiver) - this doesn't have to be a public dep
"//brave/build/rust:generate_unexport_list",
]
brave_chrome_framework_ldflags += [
# prevent export of all rust symbols
"-Wl,-unexported_symbols_list," +
rebase_path(unexport_list_path, root_build_dir),
]
}
if (!is_component_build && !use_lld) {
brave_chrome_framework_ldflags += [
# https://bugzilla.mozilla.org/show_bug.cgi?id=1188030#c14
# Supposedly this bug was fixed, but it's still happening for us
"-Wl,-no_compact_unwind",
]
}
}
brave_chrome_browser_sources += brave_browser_autocomplete_sources
+9 -1
View File
@@ -18,9 +18,14 @@ rust_lib_output_path =
"$rust_lib_build_path/${cargo_lib_prefix}brave_rust${cargo_lib_suffix}"
template("rust_ffi") {
source_set(target_name) {
static_library(target_name) {
libs = [ rust_lib_output_path ]
all_dependent_configs = [
"//brave/build/rust:strip_rust_symbols",
"//brave/build/rust:too_many_personalities_workaround",
]
if (is_mac) {
frameworks = [ "Security.framework" ]
@@ -32,6 +37,9 @@ template("rust_ffi") {
}
deps = [ "//brave/build/rust:rust_lib" ]
if (is_apple) {
deps += [ "//brave/build/rust:generate_unexport_list" ]
}
if (defined(invoker.deps)) {
deps += invoker.deps
}
+22
View File
@@ -4,6 +4,28 @@ if (is_mac) {
import("//build/config/mac/mac_sdk.gni")
}
if (is_apple) {
unexport_list_path = "$root_build_dir/brave_rust/rust_lib.unexports"
}
# Too many personalities workaround. Will be fixed in llvm see
# https://reviews.llvm.org/D135728
config("too_many_personalities_workaround") {
if (is_apple && !is_component_build && !use_lld) {
ldflags = [ "-Wl,-no_compact_unwind" ]
}
}
config("strip_rust_symbols") {
if (is_apple) {
ldflags = [
# prevent export of all rust symbols
"-Wl,-unexported_symbols_list," +
rebase_path(unexport_list_path, root_build_dir),
]
}
}
cargo_build("rust_lib") {
visibility = [ ":*" ]
inputs = [
+10 -6
View File
@@ -15,15 +15,13 @@ declare_args() {
}
if (cargo_profile == "") {
if (is_official_build) {
cargo_profile = "release"
} else {
if (is_debug) {
cargo_profile = "dev"
} else {
cargo_profile = "release"
}
}
unexport_list_path = "$root_build_dir/brave_rust/rust_lib.unexports"
rustc_target = ""
rustc_toolchain = ""
cargo_lib_prefix = ""
@@ -55,6 +53,12 @@ enable_rust_lto = too_many_personality_profiles_workaround
if (enable_rust_lto) {
default_rustflags += [ "-Cembed-bitcode=yes" ]
default_rustflags += [ "-Clto" ]
} else {
default_rustflags += [ "-Cembed-bitcode=no" ]
}
if (is_official_build) {
default_rustflags += [ "-Ccodegen-units=1" ]
}
if (is_debug) {
@@ -62,7 +66,7 @@ if (is_debug) {
# must always be optimized for too_many_personality_profiles_workaround to work
default_rustflags += [ "-Copt-level=1" ]
} else {
default_rustflags += [ "-Copt-level=0" ]
default_rustflags += [ "-Copt-level=0" ]
}
} else if (optimize_for_size) {
default_rustflags += [ "-Copt-level=s" ]
-10
View File
@@ -3,7 +3,6 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import("//brave/build/rust/config.gni")
import("//brave/ios/browser/api/ads/headers.gni")
import("//brave/ios/browser/api/brave_shields/headers.gni")
import("//brave/ios/browser/api/brave_stats/headers.gni")
@@ -28,14 +27,6 @@ config("internal_config") {
visibility = [ ":*" ]
ldflags =
[ "-Wl,-rpath,/usr/lib/swift,-rpath,@executable_path/../Frameworks" ]
if (!use_lld) {
ldflags += [ "-Wl,-no_compact_unwind" ]
}
ldflags += [
# prevent export of all rust symbols
"-Wl,-unexported_symbols_list," +
rebase_path(unexport_list_path, root_build_dir),
]
}
group("brave_ios") {
@@ -107,7 +98,6 @@ ios_framework_bundle("brave_core_ios_framework") {
deps = [
":brave_core_umbrella_header",
"//brave/build/rust:generate_unexport_list",
"//brave/ios/app",
]
+1 -1
View File
@@ -32,7 +32,7 @@ def run_cargo(command, args):
if args.toolchain:
toolchains_path = os.path.abspath(
os.path.join(rustup_path, 'toolchains', args.toolchain, "bin"))
os.path.join(rustup_home, 'toolchains', args.toolchain, "bin"))
env['PATH'] = toolchains_path + os.pathsep + env['PATH']
if args.clang_bin_path is not None and not sys.platform.startswith('win'):
+1 -1
View File
@@ -8,7 +8,7 @@ import os
# Version number and URL for pre-configured rust dependency package
# e.g. rust_deps_mac_0.1.0.gz
DEPS_PACKAGES_URL = "https://brave-build-deps-public.s3.brave.com"
RUST_DEPS_PACKAGE_VERSION = "1.0.0"
RUST_DEPS_PACKAGE_VERSION = "1.1.0"
MAC_TOOLCHAIN_ROOT = os.path.join(os.path.dirname(os.path.dirname(
os.path.dirname(__file__))),
'build', 'mac_files')