Skip to content

Commit 0f3e865

Browse files
committed
test: Use set sysroot for more NDK compatibility
Recent versions of the Android NDK no longer ship debuggers like `arm-linux-androideabi-gdb`, but instead one prebuilt binary `gdb`. We can symlink this into place at least to get our detection still working, but it now needs to be told what the sysroot is so it can correctly do... something. Long story short, tests didn't pass with this change and after this change they pass.
1 parent dd6e8d4 commit 0f3e865

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/tools/compiletest/src/runtest.rs

+6-5
Original file line numberDiff line numberDiff line change
@@ -433,9 +433,15 @@ actual:\n\
433433

434434
cmds = cmds.replace("run", "continue");
435435

436+
let tool_path = match self.config.android_cross_path.to_str() {
437+
Some(x) => x.to_owned(),
438+
None => self.fatal("cannot find android cross path")
439+
};
440+
436441
// write debugger script
437442
let mut script_str = String::with_capacity(2048);
438443
script_str.push_str(&format!("set charset {}\n", Self::charset()));
444+
script_str.push_str(&format!("set sysroot {}\n", tool_path));
439445
script_str.push_str(&format!("file {}\n", exe_file.to_str().unwrap()));
440446
script_str.push_str("target remote :5039\n");
441447
script_str.push_str(&format!("set solib-search-path \
@@ -508,11 +514,6 @@ actual:\n\
508514
}
509515
}
510516

511-
let tool_path = match self.config.android_cross_path.to_str() {
512-
Some(x) => x.to_owned(),
513-
None => self.fatal("cannot find android cross path")
514-
};
515-
516517
let debugger_script = self.make_out_name("debugger.script");
517518
// FIXME (#9639): This needs to handle non-utf8 paths
518519
let debugger_opts =

0 commit comments

Comments
 (0)