1
1
use clap:: Parser ;
2
2
use itertools:: Itertools as _;
3
- use rustc_codegen_spirv_target_specs:: TARGET_SPEC_DIR_PATH ;
4
3
use std:: {
5
4
env, io,
6
5
path:: { Path , PathBuf } ,
@@ -30,10 +29,6 @@ impl Opt {
30
29
31
30
const CUDA_TARGET_SUFFIX : & str = "-nvidia-cuda" ;
32
31
33
- fn target_spec_json ( target : & str ) -> String {
34
- format ! ( "{TARGET_SPEC_DIR_PATH}/{target}.json" )
35
- }
36
-
37
32
#[ derive( Copy , Clone ) ]
38
33
enum DepKind {
39
34
CudaLib ,
@@ -171,7 +166,7 @@ impl Runner {
171
166
stage_id,
172
167
target_rustcflags : Some ( flags) ,
173
168
mode : mode. parse ( ) . expect ( "Invalid mode" ) ,
174
- target : target_spec_json ( & target ) ,
169
+ target,
175
170
src_base : self . tests_dir . join ( mode) ,
176
171
build_base : self . compiletest_build_dir . clone ( ) ,
177
172
bless : self . opt . bless ,
@@ -194,9 +189,9 @@ fn build_deps(deps_target_dir: &Path, codegen_backend_path: &Path, target: &str)
194
189
"build" ,
195
190
"-p" ,
196
191
"compiletests-deps-helper" ,
197
- "-Zbuild-std=core" ,
192
+ "-Zbuild-std=core,alloc " ,
198
193
"-Zbuild-std-features=compiler-builtins-mem" ,
199
- & * format ! ( "--target={}" , target_spec_json ( target) ) ,
194
+ & * format ! ( "--target={}" , target) ,
200
195
] )
201
196
. arg ( "--target-dir" )
202
197
. arg ( deps_target_dir)
@@ -352,9 +347,12 @@ fn rust_flags(codegen_backend_path: &Path) -> String {
352
347
& * format ! ( "-Zcodegen-backend={}" , codegen_backend_path. display( ) ) ,
353
348
"-Zcrate-attr=feature(register_tool)" ,
354
349
"-Zcrate-attr=register_tool(nvvm_internal)" . into ( ) ,
355
- // NOTE(LegNeato) flags copied from `cuda-builder` are all above this line.
356
350
"-Zcrate-attr=no_std" . into ( ) ,
357
351
"-Zsaturating_float_casts=false" . into ( ) ,
352
+ // TODO(RDambrosio016): Remove this once we can get meaningful error messages in panic to work.
353
+ // for now we enable it to remove some useless indirect calls in the ptx.
354
+ "-Zbuild-std-features=panic_immediate_abort" . into ( ) ,
355
+ // NOTE(LegNeato) flags copied from `cuda-builder` are all above this line.
358
356
// NOTE(LegNeato) flags copied from `rust-gpu`'s compiletests are all below this
359
357
// line.
360
358
// Ensure the codegen backend is emitted in `.d` files to force Cargo
0 commit comments