disable autocfg probe and move config options to gn for num_bigint
This commit is contained in:
@@ -562,12 +562,6 @@ Config.prototype.buildArgs = function () {
|
||||
// We want it to be enabled for all configurations
|
||||
args.disable_android_lint = false
|
||||
|
||||
if (this.targetArch === 'arm64') {
|
||||
// TODO: Ideally we should properly compile our rust libraries in order to
|
||||
// be able to use default 'standard' flow integrity. For now just revert
|
||||
// it to 'pac'.
|
||||
args.arm_control_flow_integrity = 'pac'
|
||||
}
|
||||
args.android_aab_to_apk = this.androidAabToApk
|
||||
|
||||
// These do not exist on android
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
diff --git a/build/rust/run_build_script.py b/build/rust/run_build_script.py
|
||||
index fe8eb107cd720ade5af9bed7e99f817565d23a8c..5617360ca88c936d6d82dca8ae13f469ed85631e 100755
|
||||
--- a/build/rust/run_build_script.py
|
||||
+++ b/build/rust/run_build_script.py
|
||||
@@ -101,11 +101,12 @@ def main():
|
||||
env["OUT_DIR"] = tempdir
|
||||
env["CARGO_MANIFEST_DIR"] = os.path.abspath(args.src_dir)
|
||||
env["HOST"] = host_triple(rustc_path)
|
||||
+ env["TARGET"] = env["HOST"]
|
||||
if args.target is None:
|
||||
- env["TARGET"] = env["HOST"]
|
||||
+ target = env["TARGET"]
|
||||
else:
|
||||
- env["TARGET"] = args.target
|
||||
- target_components = env["TARGET"].split("-")
|
||||
+ target = args.target
|
||||
+ target_components = target.split("-")
|
||||
if len(target_components) == 2:
|
||||
env["CARGO_CFG_TARGET_ARCH"] = target_components[0]
|
||||
env["CARGO_CFG_TARGET_VENDOR"] = ''
|
||||
@@ -1,14 +1,13 @@
|
||||
diff --git a/build/rust/rust_target.gni b/build/rust/rust_target.gni
|
||||
index 1fdad6338f3aeb5cf2d1811891bd26173e981525..37332a6483218c3084507ef55689710b60da4f31 100644
|
||||
index 1fdad6338f3aeb5cf2d1811891bd26173e981525..a0a56a47e95d5fea755f40a63ab0007532f2d858 100644
|
||||
--- a/build/rust/rust_target.gni
|
||||
+++ b/build/rust/rust_target.gni
|
||||
@@ -172,8 +172,7 @@ template("rust_target") {
|
||||
"outside the Chromium build.")
|
||||
@@ -173,7 +173,7 @@ template("rust_target") {
|
||||
_cxx_bindings = invoker.cxx_bindings
|
||||
}
|
||||
- _rustenv = [ "OUT_DIR=" +
|
||||
_rustenv = [ "OUT_DIR=" +
|
||||
- rebase_path(_env_out_dir, get_path_info(_crate_root, "dir")) ]
|
||||
+ _rustenv = [ "OUT_DIR=" + rebase_path(_env_out_dir) ]
|
||||
+ rebase_path(_env_out_dir) ]
|
||||
if (defined(invoker.rustenv)) {
|
||||
_rustenv += invoker.rustenv
|
||||
}
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
diff --git a/build/rust/std/rules/BUILD.gn b/build/rust/std/rules/BUILD.gn
|
||||
index ddf69ad82a76aa314e82550af81a4804998a6706..2b92e98ab0f381454f5e4673398396878f55ccfb 100644
|
||||
--- a/build/rust/std/rules/BUILD.gn
|
||||
+++ b/build/rust/std/rules/BUILD.gn
|
||||
@@ -343,7 +343,7 @@ cargo_crate("compiler_builtins") {
|
||||
output_dir =
|
||||
"$root_out_dir/local_rustc_sysroot/lib/rustlib/$rust_abi_target/lib/"
|
||||
|
||||
- if (current_cpu == "arm64") {
|
||||
+ if (current_cpu == "arm64" && !is_android && !is_ios) {
|
||||
build_script_outputs = [ "outlined_atomics.rs" ]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
From 4217a857d39dded221b63239893c200251ceaffe Mon Sep 17 00:00:00 2001
|
||||
From: bridiver <34129+bridiver@users.noreply.github.com>
|
||||
Date: Wed, 23 Aug 2023 07:34:18 -0700
|
||||
Subject: [PATCH] patch build.rs
|
||||
|
||||
---
|
||||
third_party/rust/lock_api/v0_4/crate/build.rs | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/third_party/rust/lock_api/v0_4/crate/build.rs b/third_party/rust/lock_api/v0_4/crate/build.rs
|
||||
index 886a3454c3..f52f18e7b3 100644
|
||||
--- a/third_party/rust/lock_api/v0_4/crate/build.rs
|
||||
+++ b/third_party/rust/lock_api/v0_4/crate/build.rs
|
||||
@@ -1,4 +1,5 @@
|
||||
fn main() {
|
||||
+ return; #[allow(unused)]
|
||||
let cfg = autocfg::new();
|
||||
|
||||
if cfg.probe_rustc_version(1, 61) {
|
||||
--
|
||||
2.34.1
|
||||
|
||||
+4
@@ -37,4 +37,8 @@ cargo_crate("lib") {
|
||||
build_deps = [ "//third_party/rust/autocfg/v1:buildrs_support" ]
|
||||
build_root = "crate/build.rs"
|
||||
build_sources = [ "crate/build.rs" ]
|
||||
rustflags = [
|
||||
"--cfg",
|
||||
"has_const_fn_trait_bound",
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
fn main() {
|
||||
return; #[allow(unused)]
|
||||
let cfg = autocfg::new();
|
||||
|
||||
if cfg.probe_rustc_version(1, 61) {
|
||||
|
||||
+4
@@ -65,4 +65,8 @@ cargo_crate("lib") {
|
||||
features = [ "std" ]
|
||||
build_root = "crate/build.rs"
|
||||
build_sources = [ "crate/build.rs" ]
|
||||
rustflags = [
|
||||
"--cfg",
|
||||
"has_i128",
|
||||
]
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ extern crate autocfg;
|
||||
use std::env;
|
||||
|
||||
fn main() {
|
||||
return; #[allow(unused)]
|
||||
let ac = autocfg::new();
|
||||
if ac.probe_type("i128") {
|
||||
println!("cargo:rustc-cfg=has_i128");
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
From da7bfb9cee19deccc0dc6dbf0823bbd438d0fa67 Mon Sep 17 00:00:00 2001
|
||||
From: bridiver <34129+bridiver@users.noreply.github.com>
|
||||
Date: Wed, 23 Aug 2023 09:23:16 -0700
|
||||
Subject: [PATCH] remove autocfg probe_type
|
||||
|
||||
---
|
||||
third_party/rust/num_bigint/v0_2/crate/build.rs | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/third_party/rust/num_bigint/v0_2/crate/build.rs b/third_party/rust/num_bigint/v0_2/crate/build.rs
|
||||
index e483c15fd7..3ea385c1c4 100644
|
||||
--- a/third_party/rust/num_bigint/v0_2/crate/build.rs
|
||||
+++ b/third_party/rust/num_bigint/v0_2/crate/build.rs
|
||||
@@ -3,6 +3,7 @@ extern crate autocfg;
|
||||
use std::env;
|
||||
|
||||
fn main() {
|
||||
+ return; #[allow(unused)]
|
||||
let ac = autocfg::new();
|
||||
if ac.probe_type("i128") {
|
||||
println!("cargo:rustc-cfg=has_i128");
|
||||
--
|
||||
2.34.1
|
||||
|
||||
+10
@@ -82,4 +82,14 @@ cargo_crate("lib") {
|
||||
build_root = "crate/build.rs"
|
||||
build_sources = [ "crate/build.rs" ]
|
||||
build_script_outputs = [ "radix_bases.rs" ]
|
||||
rustflags = [
|
||||
"--cfg",
|
||||
"has_try_from",
|
||||
]
|
||||
if (current_cpu == "arm64" || current_cpu == "x64") {
|
||||
rustflags += [
|
||||
"--cfg",
|
||||
"u64_digit",
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ use std::io::Write;
|
||||
use std::path::Path;
|
||||
|
||||
fn main() {
|
||||
/*
|
||||
let pointer_width = env::var("CARGO_CFG_TARGET_POINTER_WIDTH");
|
||||
let u64_digit = pointer_width.as_ref().map(String::as_str) == Ok("64");
|
||||
if u64_digit {
|
||||
@@ -32,6 +33,7 @@ fn main() {
|
||||
}
|
||||
|
||||
autocfg::rerun_path("build.rs");
|
||||
*/
|
||||
|
||||
write_radix_bases().unwrap();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
From 45c741b53bb268f78636c9501db06530b72cc69e Mon Sep 17 00:00:00 2001
|
||||
From: bridiver <34129+bridiver@users.noreply.github.com>
|
||||
Date: Tue, 22 Aug 2023 16:00:43 -0700
|
||||
Subject: [PATCH] temp
|
||||
|
||||
---
|
||||
third_party/rust/num_bigint/v0_3/crate/build.rs | 2 --
|
||||
1 file changed, 2 deletions(-)
|
||||
|
||||
diff --git a/third_party/rust/num_bigint/v0_3/crate/build.rs b/third_party/rust/num_bigint/v0_3/crate/build.rs
|
||||
index 3405cff8e5..3daed5e8d3 100644
|
||||
--- a/third_party/rust/num_bigint/v0_3/crate/build.rs
|
||||
+++ b/third_party/rust/num_bigint/v0_3/crate/build.rs
|
||||
@@ -5,7 +5,6 @@ use std::io::Write;
|
||||
use std::path::Path;
|
||||
|
||||
fn main() {
|
||||
- /*
|
||||
let pointer_width = env::var("CARGO_CFG_TARGET_POINTER_WIDTH");
|
||||
let u64_digit = pointer_width.as_ref().map(String::as_str) == Ok("64");
|
||||
if u64_digit {
|
||||
@@ -33,7 +32,6 @@ fn main() {
|
||||
}
|
||||
|
||||
autocfg::rerun_path("build.rs");
|
||||
-*/
|
||||
|
||||
write_radix_bases().unwrap();
|
||||
}
|
||||
--
|
||||
2.34.1
|
||||
|
||||
+10
@@ -84,4 +84,14 @@ cargo_crate("lib") {
|
||||
build_root = "crate/build.rs"
|
||||
build_sources = [ "crate/build.rs" ]
|
||||
build_script_outputs = [ "radix_bases.rs" ]
|
||||
rustflags = [
|
||||
"--cfg",
|
||||
"has_try_from",
|
||||
]
|
||||
if (current_cpu == "arm64" || current_cpu == "x64") {
|
||||
rustflags += [
|
||||
"--cfg",
|
||||
"u64_digit",
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ use std::io::Write;
|
||||
use std::path::Path;
|
||||
|
||||
fn main() {
|
||||
/*
|
||||
let pointer_width = env::var("CARGO_CFG_TARGET_POINTER_WIDTH");
|
||||
let u64_digit = pointer_width.as_ref().map(String::as_str) == Ok("64");
|
||||
if u64_digit {
|
||||
@@ -32,6 +33,7 @@ fn main() {
|
||||
}
|
||||
|
||||
autocfg::rerun_path("build.rs");
|
||||
*/
|
||||
|
||||
write_radix_bases().unwrap();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
From 5913c99a92cc3e77033010b346bf8328465a42f1 Mon Sep 17 00:00:00 2001
|
||||
From: bridiver <34129+bridiver@users.noreply.github.com>
|
||||
Date: Tue, 22 Aug 2023 16:06:53 -0700
|
||||
Subject: [PATCH] temp2
|
||||
|
||||
---
|
||||
third_party/rust/num_bigint/v0_4/crate/build.rs | 2 --
|
||||
1 file changed, 2 deletions(-)
|
||||
|
||||
diff --git a/third_party/rust/num_bigint/v0_4/crate/build.rs b/third_party/rust/num_bigint/v0_4/crate/build.rs
|
||||
index 284c22fe1a..3daed5e8d3 100644
|
||||
--- a/third_party/rust/num_bigint/v0_4/crate/build.rs
|
||||
+++ b/third_party/rust/num_bigint/v0_4/crate/build.rs
|
||||
@@ -5,7 +5,6 @@ use std::io::Write;
|
||||
use std::path::Path;
|
||||
|
||||
fn main() {
|
||||
- /*
|
||||
let pointer_width = env::var("CARGO_CFG_TARGET_POINTER_WIDTH");
|
||||
let u64_digit = pointer_width.as_ref().map(String::as_str) == Ok("64");
|
||||
if u64_digit {
|
||||
@@ -33,7 +32,6 @@ fn main() {
|
||||
}
|
||||
|
||||
autocfg::rerun_path("build.rs");
|
||||
- */
|
||||
|
||||
write_radix_bases().unwrap();
|
||||
}
|
||||
--
|
||||
2.34.1
|
||||
|
||||
+16
@@ -58,4 +58,20 @@ cargo_crate("lib") {
|
||||
]
|
||||
build_root = "crate/build.rs"
|
||||
build_sources = [ "crate/build.rs" ]
|
||||
rustflags = [
|
||||
"--cfg",
|
||||
"has_i128",
|
||||
"--cfg",
|
||||
"has_to_int_unchecked",
|
||||
"--cfg",
|
||||
"has_reverse_bits",
|
||||
"--cfg",
|
||||
"has_leading_trailing_ones",
|
||||
"--cfg",
|
||||
"has_int_assignop_ref",
|
||||
"--cfg",
|
||||
"has_div_euclid",
|
||||
"--cfg",
|
||||
"has_copysign",
|
||||
]
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ extern crate autocfg;
|
||||
use std::env;
|
||||
|
||||
fn main() {
|
||||
return; #[allow(unused)]
|
||||
let ac = autocfg::new();
|
||||
|
||||
// If the "i128" feature is explicity requested, don't bother probing for it.
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
From 4e24c13a8ddc7599c2c164b2c7d9eaa2d83e2d80 Mon Sep 17 00:00:00 2001
|
||||
From: bridiver <34129+bridiver@users.noreply.github.com>
|
||||
Date: Wed, 23 Aug 2023 13:14:39 -0700
|
||||
Subject: [PATCH] autocfg
|
||||
|
||||
---
|
||||
third_party/rust/num_traits/v0_2/crate/build.rs | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/third_party/rust/num_traits/v0_2/crate/build.rs b/third_party/rust/num_traits/v0_2/crate/build.rs
|
||||
index c7bf364f1c..21558be654 100644
|
||||
--- a/third_party/rust/num_traits/v0_2/crate/build.rs
|
||||
+++ b/third_party/rust/num_traits/v0_2/crate/build.rs
|
||||
@@ -3,6 +3,7 @@ extern crate autocfg;
|
||||
use std::env;
|
||||
|
||||
fn main() {
|
||||
+ return; #[allow(unused)]
|
||||
let ac = autocfg::new();
|
||||
|
||||
// If the "i128" feature is explicity requested, don't bother probing for it.
|
||||
--
|
||||
2.34.1
|
||||
|
||||
+1
@@ -1,4 +1,5 @@
|
||||
fn main() {
|
||||
return; #[allow(unused)]
|
||||
let cfg = match autocfg::AutoCfg::new() {
|
||||
Ok(cfg) => cfg,
|
||||
Err(e) => {
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
From 5178e6a72e04675d32b19c5dfbe185388550143e Mon Sep 17 00:00:00 2001
|
||||
From: bridiver <34129+bridiver@users.noreply.github.com>
|
||||
Date: Wed, 23 Aug 2023 09:22:12 -0700
|
||||
Subject: [PATCH] skip autocfg probe_type
|
||||
|
||||
---
|
||||
third_party/rust/slab/v0_4/crate/build.rs | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/third_party/rust/slab/v0_4/crate/build.rs b/third_party/rust/slab/v0_4/crate/build.rs
|
||||
index b60351aaf2..6a56d34911 100644
|
||||
--- a/third_party/rust/slab/v0_4/crate/build.rs
|
||||
+++ b/third_party/rust/slab/v0_4/crate/build.rs
|
||||
@@ -1,4 +1,5 @@
|
||||
fn main() {
|
||||
+ return; #[allow(unused)]
|
||||
let cfg = match autocfg::AutoCfg::new() {
|
||||
Ok(cfg) => cfg,
|
||||
Err(e) => {
|
||||
--
|
||||
2.34.1
|
||||
|
||||
Vendored
+19
@@ -271,6 +271,16 @@ cargo_manifest_dir =
|
||||
rustenv = [ "CARGO_MANIFEST_DIR=$cargo_manifest_dir" ]
|
||||
'''
|
||||
|
||||
[dependencies.lock_api]
|
||||
version = "0.4.9"
|
||||
allow-first-party-usage = false
|
||||
gn-variables-lib = '''
|
||||
rustflags = [
|
||||
"--cfg",
|
||||
"has_const_fn_trait_bound",
|
||||
]
|
||||
'''
|
||||
|
||||
[dependencies.typenum]
|
||||
version = "1"
|
||||
allow-first-party-usage = false
|
||||
@@ -289,6 +299,15 @@ rustenv = [
|
||||
version = "0.4"
|
||||
allow-first-party-usage = false
|
||||
build-script-outputs = [ "radix_bases.rs" ]
|
||||
gn-variables-lib = '''
|
||||
rustflags = [
|
||||
"--cfg",
|
||||
"has_try_from",
|
||||
]
|
||||
if (current_cpu == "arm64" || current_cpu == "x64") {
|
||||
rustflags += [ "--cfg", "u64_digit" ]
|
||||
}
|
||||
'''
|
||||
|
||||
[dependencies.selectors]
|
||||
version = "0.23"
|
||||
|
||||
Reference in New Issue
Block a user