Skip to content

Commit 3e28bc1

Browse files
committed
Make aarch64-linux-android check with real target
1 parent bedd810 commit 3e28bc1

File tree

5 files changed

+32
-24
lines changed

5 files changed

+32
-24
lines changed

mk/install.mk

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ CFG_ADB_DEVICE_STATUS=$(1)
6565
endef
6666

6767
$(foreach target,$(CFG_TARGET), \
68-
$(if $(findstring $(target),"arm-linux-androideabi"), \
68+
$(if $(or $(findstring $(target),"arm-linux-androideabi"),$(findstring $(target),"aarch64-linux-android")), \
6969
$(if $(findstring adb,$(CFG_ADB)), \
7070
$(if $(findstring device,$(shell $(CFG_ADB) devices 2>/dev/null | grep -E '^[_A-Za-z0-9-]+[[:blank:]]+device')), \
7171
$(info install: install-runtime-target for $(target) enabled \
@@ -117,8 +117,11 @@ install-runtime-target-$(1)-cleanup:
117117
$$(call ADB_SHELL,rm,$$(CFG_RUNTIME_PUSH_DIR)/$$(call CFG_LIB_GLOB_$(1),$$(crate)));)
118118
endef
119119

120-
$(eval $(call INSTALL_RUNTIME_TARGET_N,arm-linux-androideabi,$(CFG_BUILD)))
121-
$(eval $(call INSTALL_RUNTIME_TARGET_CLEANUP_N,arm-linux-androideabi))
120+
$(foreach target,$(CFG_TARGET), \
121+
$(if $(findstring $(CFG_ADB_DEVICE_STATUS),"true"), \
122+
$(eval $(call INSTALL_RUNTIME_TARGET_N,$(taget),$(CFG_BUILD))) \
123+
$(eval $(call INSTALL_RUNTIME_TARGET_CLEANUP_N,arm-linux-$(target))) \
124+
))
122125

123126
install-runtime-target: \
124127
install-runtime-target-arm-linux-androideabi-cleanup \

mk/tests.mk

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,14 +111,15 @@ $(foreach target,$(CFG_TARGET), \
111111
# for arm-linux-androidabi
112112
define DEF_ADB_DEVICE_STATUS
113113
CFG_ADB_DEVICE_STATUS=$(1)
114+
CFG_ANDROID_TARGET_TRIPLE=$(2)
114115
endef
115116

116117
$(foreach target,$(CFG_TARGET), \
117-
$(if $(findstring $(target),"arm-linux-androideabi"), \
118+
$(if $(or $(findstring $(target),"arm-linux-androideabi"),$(findstring $(target),"aarch64-linux-android")), \
118119
$(if $(findstring adb,$(CFG_ADB)), \
119120
$(if $(findstring device,$(shell $(CFG_ADB) devices 2>/dev/null | grep -E '^[:_A-Za-z0-9-]+[[:blank:]]+device')), \
120121
$(info check: android device attached) \
121-
$(eval $(call DEF_ADB_DEVICE_STATUS, true)), \
122+
$(eval $(call DEF_ADB_DEVICE_STATUS, true, $(target))), \
122123
$(info check: android device not attached) \
123124
$(eval $(call DEF_ADB_DEVICE_STATUS, false)) \
124125
), \
@@ -138,7 +139,7 @@ $(info check: android device test dir $(CFG_ADB_TEST_DIR) ready \
138139
$(shell $(CFG_ADB) shell mkdir $(CFG_ADB_TEST_DIR)/tmp) \
139140
$(shell $(CFG_ADB) push $(S)src/etc/adb_run_wrapper.sh $(CFG_ADB_TEST_DIR) 1>/dev/null) \
140141
$(foreach crate,$(TARGET_CRATES), \
141-
$(shell $(CFG_ADB) push $(TLIB2_T_arm-linux-androideabi_H_$(CFG_BUILD))/$(call CFG_LIB_GLOB_arm-linux-androideabi,$(crate)) \
142+
$(shell $(CFG_ADB) push $(TLIB2_T_$(CFG_ANDROID_TARGET_TRIPLE)_H_$(CFG_BUILD))/$(call CFG_LIB_GLOB_$(CFG_ANDROID_TARGET_TRIPLE),$(crate)) \
142143
$(CFG_ADB_TEST_DIR))) \
143144
)
144145
else
@@ -420,7 +421,7 @@ $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
420421
&& touch $$@
421422
endef
422423

423-
define DEF_TEST_CRATE_RULES_arm-linux-androideabi
424+
define DEF_TEST_CRATE_RULES_android
424425
check-stage$(1)-T-$(2)-H-$(3)-$(4)-exec: $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4))
425426

426427
$$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
@@ -461,9 +462,9 @@ $(foreach host,$(CFG_HOST), \
461462
$(foreach crate, $(TEST_CRATES), \
462463
$(if $(findstring $(target),$(CFG_BUILD)), \
463464
$(eval $(call DEF_TEST_CRATE_RULES,$(stage),$(target),$(host),$(crate))), \
464-
$(if $(findstring $(target),"arm-linux-androideabi"), \
465+
$(if $(or $(findstring $(target),"arm-linux-androideabi"), $(findstring $(target),"aarch64-linux-android")), \
465466
$(if $(findstring $(CFG_ADB_DEVICE_STATUS),"true"), \
466-
$(eval $(call DEF_TEST_CRATE_RULES_arm-linux-androideabi,$(stage),$(target),$(host),$(crate))), \
467+
$(eval $(call DEF_TEST_CRATE_RULES_android,$(stage),$(target),$(host),$(crate))), \
467468
$(eval $(call DEF_TEST_CRATE_RULES_null,$(stage),$(target),$(host),$(crate))) \
468469
), \
469470
$(eval $(call DEF_TEST_CRATE_RULES,$(stage),$(target),$(host),$(crate))) \

src/compiletest/compiletest.rs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,10 @@ pub fn parse_config(args: Vec<String> ) -> Config {
157157
adb_path: opt_str2(matches.opt_str("adb-path")),
158158
adb_test_dir: opt_str2(matches.opt_str("adb-test-dir")),
159159
adb_device_status:
160-
"arm-linux-androideabi" ==
161-
opt_str2(matches.opt_str("target")).as_slice() &&
160+
("arm-linux-androideabi" ==
161+
opt_str2(matches.opt_str("target")).as_slice() ||
162+
"aarch64-linux-android" ==
163+
opt_str2(matches.opt_str("target")).as_slice()) &&
162164
"(none)" !=
163165
opt_str2(matches.opt_str("adb-test-dir")).as_slice() &&
164166
!opt_str2(matches.opt_str("adb-test-dir")).is_empty(),
@@ -215,17 +217,18 @@ pub fn opt_str2(maybestr: Option<String>) -> String {
215217
}
216218

217219
pub fn run_tests(config: &Config) {
218-
if config.target.as_slice() == "arm-linux-androideabi" {
220+
if config.target.as_slice() == "arm-linux-androideabi" ||
221+
config.target.as_slice() == "aarch64-linux-android" {
219222
match config.mode {
220223
DebugInfoGdb => {
221-
println!("arm-linux-androideabi debug-info \
222-
test uses tcp 5039 port. please reserve it");
224+
println!("{} debug-info test uses tcp 5039 port.\
225+
please reserve it", config.target);
223226
}
224227
_ =>{}
225228
}
226229

227-
//arm-linux-androideabi debug-info test uses remote debugger
228-
//so, we test 1 task at once.
230+
// android debug-info test uses remote debugger
231+
// so, we test 1 task at once.
229232
// also trying to isolate problems with adb_run_wrapper.sh ilooping
230233
os::setenv("RUST_TEST_TASKS","1");
231234
}

src/compiletest/runtest.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ use test::MetricMap;
4242
pub fn run(config: Config, testfile: String) {
4343
match config.target.as_slice() {
4444

45-
"arm-linux-androideabi" => {
45+
"arm-linux-androideabi" | "aarch64-linux-android" => {
4646
if !config.adb_device_status {
4747
panic!("android device not available");
4848
}
@@ -383,7 +383,7 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
383383

384384
let debugger_run_result;
385385
match config.target.as_slice() {
386-
"arm-linux-androideabi" => {
386+
"arm-linux-androideabi" | "aarch64-linux-android" => {
387387

388388
cmds = cmds.replace("run", "continue").to_string();
389389

@@ -471,7 +471,7 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
471471
format!("-command={}", debugger_script.as_str().unwrap()));
472472

473473
let mut gdb_path = tool_path;
474-
gdb_path.push_str("/bin/arm-linux-androideabi-gdb");
474+
gdb_path.push_str(format!("/bin/{}-gdb", config.target).as_slice());
475475
let procsrv::Result {
476476
out,
477477
err,
@@ -485,7 +485,7 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
485485
.expect(format!("failed to exec `{:?}`", gdb_path).as_slice());
486486
let cmdline = {
487487
let cmdline = make_cmdline("",
488-
"arm-linux-androideabi-gdb",
488+
format!("{}-gdb", config.target).as_slice(),
489489
debugger_opts.as_slice());
490490
logv(config, format!("executing {}", cmdline));
491491
cmdline
@@ -1141,7 +1141,7 @@ fn exec_compiled_test(config: &Config, props: &TestProps,
11411141

11421142
match config.target.as_slice() {
11431143

1144-
"arm-linux-androideabi" => {
1144+
"arm-linux-androideabi" | "aarch64-linux-android" => {
11451145
_arm_exec_compiled_test(config, props, testfile, env)
11461146
}
11471147

@@ -1206,7 +1206,7 @@ fn compose_and_run_compiler(
12061206
}
12071207

12081208
match config.target.as_slice() {
1209-
"arm-linux-androideabi" => {
1209+
"arm-linux-androideabi" | "aarch64-linux-android" => {
12101210
_arm_push_aux_shared_library(config, testfile);
12111211
}
12121212
_ => {}

src/librustc_back/target/mod.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,11 +342,13 @@ impl Target {
342342
mips_unknown_linux_gnu,
343343
mipsel_unknown_linux_gnu,
344344
powerpc_unknown_linux_gnu,
345-
arm_linux_androideabi,
346345
arm_unknown_linux_gnueabi,
347346
arm_unknown_linux_gnueabihf,
348347
aarch64_unknown_linux_gnu,
349348

349+
arm_linux_androideabi,
350+
aarch64_linux_android,
351+
350352
x86_64_unknown_freebsd,
351353

352354
i686_unknown_dragonfly,
@@ -358,7 +360,6 @@ impl Target {
358360
i386_apple_ios,
359361
x86_64_apple_ios,
360362
aarch64_apple_ios,
361-
aarch64_linux_android,
362363
armv7_apple_ios,
363364
armv7s_apple_ios,
364365

0 commit comments

Comments
 (0)