aboutsummaryrefslogtreecommitdiff
path: root/baseboards
diff options
context:
space:
mode:
authorAlexander Ivchenko <alexander.ivchenko@intel.com>2013-11-19 09:21:08 -0700
committerRob Savoye <rob@welcomehome.org>2013-11-19 09:21:08 -0700
commitbcc1f7e6ef8d1cb497f69924c39f454b9ea3583c (patch)
treecaf83fa83e7c70b90a574910ea6dfadef6dfa50b /baseboards
parent19449c886eb3a4224518e1d3d42b7cb7a58cfe9b (diff)
downloaddejagnu-bcc1f7e6ef8d1cb497f69924c39f454b9ea3583c.zip
dejagnu-bcc1f7e6ef8d1cb497f69924c39f454b9ea3583c.tar.gz
dejagnu-bcc1f7e6ef8d1cb497f69924c39f454b9ea3583c.tar.bz2
Improve ADB support for Android
Diffstat (limited to 'baseboards')
-rw-r--r--baseboards/androideabi.exp29
1 files changed, 22 insertions, 7 deletions
diff --git a/baseboards/androideabi.exp b/baseboards/androideabi.exp
index 4ba2d63..e84d150 100644
--- a/baseboards/androideabi.exp
+++ b/baseboards/androideabi.exp
@@ -16,6 +16,8 @@
# along with DejaGnu; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+process_multilib_options ""
+
load_generic_config "adb"
# We need this for find_gcc and *_include_flags/*_link_flags.
@@ -25,18 +27,21 @@ set_board_info compiler "[find_gcc]"
# We may need -mandroid.
set_board_info cflags "-mandroid"
-
-# Currently the dynamic linker does not support weak-references in
-# shared libraries. So we need to workaround using -static
-set_board_info ldflags "-mandroid -static"
+set_board_info ldflags "-mandroid"
#
# load PROG to DEST and run it with ARGS using adb
#
proc adb_load { dest prog args } {
- # This directory uses tmpfs, so it is the best place to run
+ # Default directory uses tmpfs, so it is the best place to run
# tests to avoid excessive wear of flash.
- set android_tmp_dir "/mnt/sdcard/.android_secure"
+ global android_tmp_dir
+ if { $android_tmp_dir != "" } {
+ verbose -log "android temporary directory is set to $android_tmp_dir" 3
+ } else {
+ set android_tmp_dir "/mnt/sdcard/.android_secure"
+ verbose -log "android temporary directory will be used by default $android_tmp_dir" 3
+ }
if { [llength $args] > 0 } {
set pargs [lindex $args 0]
@@ -58,12 +63,22 @@ proc adb_load { dest prog args } {
}
if [is_remote $dest] {
+ set localfile "./[file tail $prog].[pid]"
set remotefile "$android_tmp_dir/[file tail $prog].[pid]"
set remotefile [remote_download $dest $prog $remotefile]
if { $remotefile == "" } {
verbose -log "Download of $prog to [board_info $dest name] failed." 3
return "unresolved"
}
+ set retval [remote_exec $dest "test -x $remotefile"]
+ if { $retval != "0 {}" } {
+ # Android doesn't support symbolic input for chmod, therefore set executable permission by number
+ set retval [remote_exec $dest "chmod 755 $remotefile"]
+ if { $retval != "0 {}" } {
+ verbose -log "Setting executable permissions of $prog on [board_info $dest name] failed." 3
+ return "unresolved"
+ }
+ }
if [board_info $dest exists remote_link] {
if [[board_info $dest remote_link] $remotefile] {
verbose -log "Couldn't do remote link"
@@ -73,7 +88,7 @@ proc adb_load { dest prog args } {
return "unresolved"
}
}
- set status [remote_exec $dest $remotefile $pargs $inp]
+ set status [remote_exec $dest $localfile $pargs $inp]
remote_exec $dest rm $remotefile
} else {
set status [remote_exec $dest $prog $pargs $inp]