File tree 5 files changed +164
-138
lines changed
5 files changed +164
-138
lines changed Original file line number Diff line number Diff line change @@ -1961,10 +1961,8 @@ config("default_warnings") {
1961
1961
# TODO(crbug.com/344680447): Fix and re-enable.
1962
1962
cflags_cc += [ " -Wno-missing-template-arg-list-after-template-kw" ]
1963
1963
1964
- if (llvm_force_head_revision ) {
1965
- # TODO(crbug.com/356172342): Fix and re-enable.
1966
- cflags_cc += [ " -Wno-dangling-assignment-gsl" ]
1967
- }
1964
+ # TODO(crbug.com/356172342): Fix and re-enable.
1965
+ cflags_cc += [ " -Wno-dangling-assignment-gsl" ]
1968
1966
}
1969
1967
}
1970
1968
@@ -1981,7 +1979,7 @@ config("default_warnings") {
1981
1979
}
1982
1980
1983
1981
# TODO(crbug.com/354162568): Clean up and enable.
1984
- if (llvm_force_head_revision && is_apple && use_lld ) {
1982
+ if (is_apple && use_lld ) {
1985
1983
ldflags += [ " -Wl,--no-warn-duplicate-rpath" ]
1986
1984
}
1987
1985
Original file line number Diff line number Diff line change @@ -425,6 +425,19 @@ template("cargo_crate") {
425
425
rust_abi_target ,
426
426
]
427
427
}
428
+ if (current_cpu == " arm64" || current_cpu == " x64" ) {
429
+ args += [
430
+ " --pointer-width" ,
431
+ " 64" ,
432
+ ]
433
+ } else if (current_cpu == " arm" || current_cpu == " x86" ) {
434
+ args += [
435
+ " --pointer-width" ,
436
+ " 32" ,
437
+ ]
438
+ } else {
439
+ assert (false , " Architecture not supported" )
440
+ }
428
441
if (defined (invoker .features )) {
429
442
args += [ " --features" ]
430
443
args += invoker .features
Original file line number Diff line number Diff line change @@ -76,6 +76,7 @@ def main():
76
76
required = True ,
77
77
help = 'where to write output rustc flags' )
78
78
parser .add_argument ('--target' , help = 'rust target triple' )
79
+ parser .add_argument ('--pointer-width' , help = 'rust target pointer width' )
79
80
parser .add_argument ('--features' , help = 'features' , nargs = '+' )
80
81
parser .add_argument ('--env' , help = 'environment variable' , nargs = '+' )
81
82
parser .add_argument ('--rust-prefix' , required = True , help = 'rust path prefix' )
@@ -103,6 +104,7 @@ def main():
103
104
env ["OUT_DIR" ] = tempdir
104
105
env ["CARGO_MANIFEST_DIR" ] = os .path .abspath (args .src_dir )
105
106
env ["HOST" ] = host_triple (rustc_path )
107
+ env ["CARGO_CFG_TARGET_POINTER_WIDTH" ] = args .pointer_width
106
108
if args .target is None :
107
109
env ["TARGET" ] = env ["HOST" ]
108
110
else :
@@ -132,6 +134,7 @@ def main():
132
134
env ["CARGO_CFG_TARGET_OS" ] = "android"
133
135
elif env ["CARGO_CFG_TARGET_OS" ] == "darwin" :
134
136
env ["CARGO_CFG_TARGET_OS" ] = "macos"
137
+ env ["CARGO_CFG_TARGET_POINTER_WIDTH" ] = args .pointer_width
135
138
if args .features :
136
139
for f in args .features :
137
140
feature_name = f .upper ().replace ("-" , "_" )
You can’t perform that action at this time.
0 commit comments