diff --git a/ChangeLog b/ChangeLog
index cba6f6e..8741778 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2012-12-17  Alexander Ivchenko  <alexander.ivchenko@intel.com>
+
+	* Makefile.am (pkgdata_SCRIPTS): Add lib/bridge.exp and exec.sh.
+	* Makefile.in: Ditto.
+	* baseboards/unix.exp: Add support for bridge method.
+	* lib/framework.exp (iscross): New.
+	* lib/dg.exp (dg-process-target): Add check for iscross.
+	* lib/remote.exp (remote_spawn): Add support for bridge method.
+	(remote_spawn_target): New.
+	* runtest.exp: Likewise.
+	* exec.sh: New.
+	* lib/bridge.exp: New.
+
 2012-12-05  Ben Elliston  <bje@gnu.org>
 
 	* example/hello: Remove.
diff --git a/Makefile.am b/Makefile.am
index b6aa911..04bf4f0 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -41,7 +41,8 @@ pkgdata_SCRIPTS = \
   lib/debugger.exp lib/dejagnu.exp lib/dg.exp lib/framework.exp \
   lib/ftp.exp lib/kermit.exp lib/libgloss.exp lib/remote.exp \
   lib/rlogin.exp lib/rsh.exp lib/standard.exp lib/target.exp \
-  lib/targetdb.exp lib/telnet.exp lib/tip.exp lib/utils.exp
+  lib/targetdb.exp lib/telnet.exp lib/tip.exp lib/utils.exp \
+  lib/bridge.exp
 
 configdir = $(pkgdatadir)/config
 config_DATA = config/README
@@ -194,7 +195,7 @@ baseboard_SCRIPTS = \
 	baseboards/xscale-cygmon.exp \
 	baseboards/xtensa-sim.exp
 
-pkgdata_DATA = stub-loader.c testglue.c
+pkgdata_DATA = stub-loader.c testglue.c exec.sh
 
 djlibexecdir = $(pkgdatadir)/libexec
 djlibexec_SCRIPTS = config.guess
diff --git a/Makefile.in b/Makefile.in
index c829939..c7d7022 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -266,7 +266,8 @@ pkgdata_SCRIPTS = \
   lib/debugger.exp lib/dejagnu.exp lib/dg.exp lib/framework.exp \
   lib/ftp.exp lib/kermit.exp lib/libgloss.exp lib/remote.exp \
   lib/rlogin.exp lib/rsh.exp lib/standard.exp lib/target.exp \
-  lib/targetdb.exp lib/telnet.exp lib/tip.exp lib/utils.exp
+  lib/targetdb.exp lib/telnet.exp lib/tip.exp lib/utils.exp \
+  lib/bridge.exp
 
 configdir = $(pkgdatadir)/config
 config_DATA = config/README
@@ -419,7 +420,7 @@ baseboard_SCRIPTS = \
 	baseboards/xscale-cygmon.exp \
 	baseboards/xtensa-sim.exp
 
-pkgdata_DATA = stub-loader.c testglue.c
+pkgdata_DATA = stub-loader.c testglue.c exec.sh
 djlibexecdir = $(pkgdatadir)/libexec
 djlibexec_SCRIPTS = config.guess
 
diff --git a/baseboards/unix.exp b/baseboards/unix.exp
index cf64a9e..2030ebf 100644
--- a/baseboards/unix.exp
+++ b/baseboards/unix.exp
@@ -19,6 +19,8 @@
 
 # The canonical unix board description.
 load_generic_config "unix"
+set bridge_file ""
+set cross_target 0
 
 process_multilib_options ""
 
@@ -35,3 +37,46 @@ if { [istarget "*-*-cygwin*"] } {
 if { [istarget "alpha*-*"] } {
     set_board_info ieee_multilib_flags "-mieee"
 }
+
+# For the following targets we can build binaries locally
+# and run them remotely on the specified target via the bridge.
+# We will exit if and only if:
+#    1) We cannot find the bridge or the target device.
+#    2) We cannot create an execution folder.
+#    3) We cannot set the needed attributes.
+
+global board
+if { [istarget "*-android*" ] && ! [ isnative ] } {
+    set cross_target 1
+    set bridge "adb"
+    set_board_info target_bridge $bridge
+    set_board_info bridge_path "[find_bridge $bridge]"
+
+    if { [info exists device_serial] } {
+	puts "unix.exp: device_serial=\"${device_serial}\" in site.exp"
+	set len [string length $device_serial]
+	if { $len == 0 || $len == 2 && $device_serial == {""} } {
+	    set device_serial [find_device_serial]
+	} else {
+	    if { [string first "\"" $device_serial 0] != 0} {
+		set new_serial "\""
+		append new_serial $device_serial
+		set device_serial $new_serial
+	    }
+	    set len [string length $device_serial]
+	    set last_index [expr "$len - 1"]
+	    if { [string last "\"" $device_serial end] != $last_index } {
+		append device_serial "\""
+	    }
+	}
+	set_board_info device_serial $device_serial
+    } else {
+	puts "WARNING: unix.exp: device_serial is absent in site.exp"
+	set device_serial [find_device_serial]
+	set_board_info device_serial $device_serial
+    }
+
+    bridge_init "android"
+    create_exec_folder
+}
+return 0
diff --git a/exec.sh b/exec.sh
new file mode 100644
index 0000000..277ca2f
--- /dev/null
+++ b/exec.sh
@@ -0,0 +1,17 @@
+#!/system/bin/sh
+target_exec_folder=$1
+test_common_name=$2
+cd $target_exec_folder
+stde="ecn_stderr"
+if test -s $stde; then
+    rm $stde
+    sleep 0.05
+    touch $stde
+    sleep 0.12
+fi
+file=$test_common_name
+./$file  2>>$stde
+rc_code=$?
+sleep 0.05
+echo $rc_code >>$stde
+exit 0
diff --git a/lib/bridge.exp b/lib/bridge.exp
new file mode 100644
index 0000000..50bfa72
--- /dev/null
+++ b/lib/bridge.exp
@@ -0,0 +1,519 @@
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+# 2002, 2003, 2005, 2006, 2007, 2008, 2009, 2010, 2012
+# Free Software Foundation, Inc.
+#
+# This file is part of DejaGnu.
+#
+# DejaGnu is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# DejaGnu is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with DejaGnu; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# Contributed by Intel Corporation.
+# This file was written by Iliya Vereshchagin  <ilyax.g.vereschagin@intel.com>.
+#
+
+# Name of the current change directory command as parameter
+set change_dir_on_target ""
+# Name of the current make directory command as parameter
+set make_dir_on_target ""
+# Name of the current change mode rights to full access command as parameter
+set chmod_on_target ""
+# Name of the current remove file command as parameter
+set rm_on_target ""
+# Name of the current display directory files command as parameter
+set ls_on_target ""
+# Name of the current exec.sh shell script as parameter
+set exec_sh ""
+# Common name of the current test on target as parameter
+set test_common_name_on_target ""
+# Common prefix for bridge launch including device serial
+set bridge_prefix ""
+# File name with stderr and return code of the current test
+set err_filename ""
+# Destination folder on the host for pulling of the $err_filename
+set dest_folder ""
+# Regular expression for message about correct file transfer with bridge
+set bridge_file_transfer_ok ""
+# Name of bridge shell option as parameter
+set bridge_shell_option ""
+# Name of bridge push option as parameter
+set bridge_push_option ""
+# Name of bridge pull option as parameter
+set bridge_pull_option ""
+# List of delays before 1st, 2nd, 3d attempt of $err_filename pulling
+set delays_list ""
+
+# Purpose:    Bridge parameters initialization.
+# Parameters: os_type - the name of operation system.
+# Returns:    Path to the bridge.
+proc bridge_init { os_type } {
+    global board_info
+    global bridge_prefix
+    global change_dir_on_target
+    global make_dir_on_target
+    global chmod_on_target
+    global rm_on_target
+    global ls_on_target
+    global exec_sh
+    global test_common_name_on_target
+    global target_exec_folder
+    global err_filename
+    global bridge_file_transfer_ok
+    global bridge_file
+    global bridge_shell_option
+    global bridge_push_option
+    global bridge_pull_option
+    global delays_list
+
+    if { $os_type == "android" } {
+	set change_dir_on_target "cd"
+	set make_dir_on_target "mkdir -p"
+	set chmod_on_target "chmod 777"
+	set rm_on_target "rm"
+	set ls_on_target "ls -l"
+
+	# this name is specified in Makefile.in, Makefile.am
+	# and file with this name must be present in the folder
+	# where this library is placed.
+	set exec_sh "exec.sh"
+	set test_common_name_on_target "exec_common_name.x0"
+	set err_filename "ecn_stderr"
+	set bridge_file_transfer_ok "* KB?s (*"
+	set bridge_shell_option "shell"
+	set bridge_push_option "push"
+	set bridge_pull_option "pull"
+	set delays_list [list 0 600 8000]
+
+	set bridge_prefix $bridge_file
+	append bridge_prefix " -s " [ board_info "unix" "device_serial" ] " "
+	puts "bridge_init: bridge_prefix=$bridge_prefix"
+	puts "bridge_init: target_exec_folder=$target_exec_folder"
+	if { $target_exec_folder == ""} {
+	    puts "ERROR: target_exec_folder is empty. Specify a correct not empty value in site.exp"
+	    exit 1
+	}
+    }
+}
+
+# Purpose:    Bridge path search.
+# Parameters: bridge - the name of the program that will perform
+#             the communication between the host and the target.
+# Returns:    The path to the bridge.
+proc find_bridge { bridge } {
+    global tool_root_dir
+    global bridge_file
+
+    if {![is_remote host]} {
+	set bridge_file [lookfor_file "." $bridge]
+	if { $bridge_file != "" } {
+	    set bridge_path "[file dirname $bridge_file]/"
+	} else {
+	    set x "which $bridge"
+	    set xRC ""
+	    if { [ catch { eval exec $x  } xRC ] == 0 } {
+		set bridge_path "[file dirname $xRC]/"
+		set bridge_file [ file join $bridge_path $bridge ]
+	    } else {
+		set bridge_path ""
+	    }
+	}
+    } else {
+	set bridge_path ""
+    }
+    verbose "bridge_path=$bridge_path"
+
+    if { "$bridge_path" == "" } {
+	puts "$bridge WAS NOT FOUND by find_bridge procedure of DejaGnu"
+	exit 1
+    }
+
+    return $bridge_path
+}
+
+# Purpose:    Creation of $target_exec_folder and transfer $exec_sh file
+#             (initially created on the host) to the target with setting up
+#             all the needed attributes.
+#             Exit is possible because of an unresolved problem on target.
+# Parameters: 4 implicit ones and they are enumerated as global variables
+#             at the beginning of the procedure.
+# Returns:    0 in case of SUCCESS.
+#             Exit in case of FAIL.
+proc create_exec_folder { } {
+    global libdir
+    global bridge_file
+    global device_serial
+    global tmpdir
+
+    global target_exec_folder
+    global exec_sh
+
+    # Does $target_exec_folder already exist?
+    set tef_exists 0
+
+    # Have we created $target_exec_folder?
+    set tef_created "0"
+
+    # Check up whether the $target_exec_folder already exists or not
+    verbose "bridge_file=$bridge_file"
+    verbose "device_serial=$device_serial"
+    verbose "target_exec_folder=$target_exec_folder"
+
+    set tef_exists [expr ! [bridge_cd $target_exec_folder] ]
+    if { ! [expr $tef_exists] } {  ;#  does not exist - we create the folder
+	set tef_created [expr ! [bridge_mkdir $target_exec_folder] ]
+	bridge_chmod $target_exec_folder
+    } else {   ;# the folder exists
+	bridge_rm $target_exec_folder/* 1
+    }
+
+    if { [expr $tef_exists] || [expr $tef_created] } {
+	bridge_touch $target_exec_folder/$exec_sh
+	set x [expr ! [bridge_ls $target_exec_folder/$exec_sh] ]
+	if { $x == "0" } {
+	    puts "$exec_sh was NOT created"
+	    puts "$target_exec_folder already exists but its attribute is READONLY"
+	    puts "You should change the folder to another one in site.exp"
+	    exit 1
+	} else {
+	    if { ! [file exists $libdir/$exec_sh] } {
+		puts "$libdir/$exec_sh does not exist"
+		exit 1
+	    }
+	    if { [bridge_push $libdir/$exec_sh ""] == 0 } {
+		bridge_chmod $target_exec_folder/$exec_sh
+	    } else {
+		puts "$target_exec_folder/$exec_sh was not transfered to target"
+		exit 1
+	    }
+
+	    set_board_info target_exec_folder $target_exec_folder
+	    return 0
+	}
+    } else {
+	puts "$target_exec_folder does not exist on target"
+	exit 1
+    }
+}
+
+# Purpose:    The execution of the command with $bridge_shell_option.
+#             Exit is possible if the target device is not found.
+# Parameters: The command to execute.
+# Returns:    The resulting message issued by the bridge.
+proc bridge_execute { c } {
+    global bridge_file
+    global device_serial
+    global bridge_shell_option
+
+    set cmd "$bridge_file -s $device_serial "
+    append cmd $bridge_shell_option " \"$c\""
+    catch { eval exec ${cmd} } m
+    if { [string match "*device not found*" $m] } {
+	puts "${m}"
+	exit 1
+    }
+    return $m
+}
+
+# Purpose:    Searching device_serial in the output of the bridge
+#             with option 'devices'.
+#             Exit is possible if the target device is not found,
+#             or if non-empty value of device_serial was not specified
+#             in site.exp but the proc detected more than one device.
+# Parameters: Implicit one is $bridge_file.
+# Returns:    Device serial in quotes.
+proc find_device_serial {} {
+    global bridge_file
+
+    set current_folder [pwd]
+    append current_folder "\/" xxxx
+    set cmd  "$bridge_file devices | grep -e \"device\$\" | tee $current_folder"
+    catch  { eval exec ${cmd} } m
+    if { $m == 1 } {
+	puts "catch returned $m"
+	puts "$bridge_file devices FAILED"
+	file delete $current_folder
+	exit 1
+    }
+    set line ""
+    set fname ${current_folder}
+    set fd [open ${fname}]
+    set i 0
+    set dev_serial ""
+    while {[gets $fd line] >= 0} {
+	set i [expr "$i + 1"]
+	set pieces_list [ split $line {	}]
+	set dev_serial [ lindex $pieces_list 0 ]
+    }
+    close $fd
+    if { $i == 1 && [string length $dev_serial] > 0 } {
+    } else {
+	if { $i > 1} {
+	    puts "Bridge sees $i devices:"
+	    set fd [open ${fname}]
+	    while {[gets $fd line] >= 0} {
+		puts "$line"
+	    }
+	    close $fd
+	    puts "Specify a value for device_serial in site.exp"
+	}
+	if { $i == 0 } {
+	    puts "Launch a device of target"
+	}
+	file delete $current_folder
+	exit 1
+    }
+    file delete $current_folder
+    set ds {"}
+    append ds $dev_serial {"}
+    puts "find_device_serial: $dev_serial device was detected on target and used"
+    return $ds
+}
+
+# Purpose:    The transfer of the file(s) specified by the parameter 'src'
+#             (with full path) to $target_exec_folder on target with push
+#             option of the bridge.
+#             After the transaction is complete we will check the message,
+#             issued by the bridge.
+#             If a single file is transfered then parameter 'new_file_name'
+#             can contain a new name of the file on target.
+# Parameters: See above.
+# Returns:    0 in case of SUCCESS.
+#             >0 in case of FAIL.
+proc bridge_push { src new_file_name } {
+    global bridge_file
+    global device_serial
+    global target_exec_folder
+    global bridge_file_transfer_ok
+    global bridge_push_option
+
+    set cmd "$bridge_file -s $device_serial "
+    append cmd "$bridge_push_option $src $target_exec_folder/$new_file_name"
+    catch { eval exec ${cmd} } bridgeRC
+    if {[string match $bridge_file_transfer_ok $bridgeRC]} {
+	return 0
+    }
+    if {! [message_check_no_file $bridgeRC] } {
+	puts ""
+	return 1
+    }
+    return 2
+}
+
+# Purpose:    The transfer of the file(s) specified by the parameter 'what' to
+#             'where' folder on the host with pull option of the bridge.
+# Parameters: See above.
+# Returns:    0 in case of SUCCESS.
+#             >0 in case of FAIL.
+proc bridge_pull { what where } {
+    global bridge_file
+    global device_serial
+    global target_exec_folder
+    global bridge_file_transfer_ok
+    global bridge_pull_option
+
+    set cmd  "$bridge_file -s $device_serial "
+    append cmd "$bridge_pull_option "
+    append cmd ${target_exec_folder} "\/" ${what} " "
+    if { ${where} == "." } {
+	append cmd [pwd]
+    } else {
+	append cmd $where
+    }
+    catch { eval exec ${cmd} } bridgeRC
+    if { [ string match $bridge_file_transfer_ok $bridgeRC ] } {
+	return 0
+    } else {
+	return 1
+    }
+}
+
+# Purpose:    Changing current folder on the target to the folder specified
+#             by the parameter 'folder'.
+#             After the transaction is complete we will check the message,
+#             issued by the bridge.
+# Parameters: See above.
+# Returns:    0 in case of SUCCESS.
+#             >0 in case of FAIL.
+proc bridge_cd { folder } {
+    global change_dir_on_target
+
+    set cmd  "$change_dir_on_target ${folder}"
+    set cmd_RC [bridge_execute $cmd]
+    if {! [message_check_no_file $cmd_RC] } {
+	return 1
+    }
+    return 0
+}
+
+# Purpose:    Create an empty file.
+# Parameters: The file name with full path of the created file.
+# Returns:    0 in case of SUCCESS.
+#             >0 in case of FAIL.
+proc bridge_touch { what } {
+    set cmd  "touch ${what}"
+    set cmd_RC [bridge_execute $cmd]
+    if {! [message_check_no_file $cmd_RC] } {
+	return 1
+    }
+    return 0
+}
+
+# Purpose:    Check up file presence.
+# Parameters: The file name with full path of the sought-for file.
+# Returns:    0 in case of SUCCESS.
+#             >0 in case of FAIL.
+proc bridge_ls { what } {
+    global ls_on_target
+
+    set cmd  "$ls_on_target ${what}"
+    set cmd_RC [bridge_execute $cmd]
+    if {! [message_check_no_file $cmd_RC] } {
+	return 1
+    }
+    return 0
+}
+
+# Purpose:    Create the directory on the target.
+#             After creating we will check the message, issued by the
+#             called bridge_execute procedure.
+# Parameters: folder - directory to create.
+# Returns:    0 in case of SUCCESS.
+#             exit in case of FAIL.
+proc bridge_mkdir { folder  } {
+    global make_dir_on_target
+
+    set cmd "$make_dir_on_target ${folder}"
+    set cmd_RC [bridge_execute $cmd]
+    if { [string match "*mkdir*" $cmd_RC ] } {
+	puts "$folder was not created on target"
+	puts "${cmd}"
+	puts "You should change the folder to another one in site.exp"
+	exit 1
+    }
+    return 0
+}
+
+# Purpose:    Change mode bits  of the file or the folder specified by
+#             parameter 'folder' to the value specified in the implicit
+#             parameter 'chmod_on_target' addressed by a global command.
+#             After creating we will check the message, issued by the
+#             called bridge_execute procedure.
+# Parameters: See above.
+# Returns:    0 in case of SUCCESS.
+#             exit in case of FAIL.
+proc bridge_chmod { folder  } {
+    global chmod_on_target
+
+    set cmd "$chmod_on_target ${folder}"
+    set cmd_RC [bridge_execute $cmd]
+    if { [string match "*chmod*" $cmd_RC ] } {
+	puts "Attributes for $folder were not set OK via $chmod_on_target"
+	puts "${cmd}"
+	exit 1
+    }
+    return 0
+}
+
+# Purpose:    Remove each specified file by target's command, defined in the
+#             implicit parameter 'rm_on_target' addressed by Tcl global command.
+#             After creating we will check the message, issued by the
+#             called bridge_execute procedure.
+# Parameters: what    - file or files defined by a regular expression with
+#                       absolute path.
+#             to_exit - 1 means to exit from DejaGnu in case of error message.
+# Returns:    0 if the compliance to the error pattern is not reached.
+#             1 if the compliance is reached (the error took place)
+#             and parameter 'to_exit' is not equal to 1, otherwise - Exit.
+proc bridge_rm { what to_exit } {
+    global rm_on_target
+
+    set cmd "$rm_on_target ${what}"
+    set cmd_RC [bridge_execute $cmd]
+    if { [string match "*failed*" $cmd_RC ] } {
+	if { $to_exit == 1 } {
+	    puts "Folder $what already exists but its attribute is READONLY"
+	    puts "You should change the folder to another one in site.exp"
+	    exit 1
+	} else {
+	    return 1
+	}
+    }
+    return 0
+}
+
+# Purpose:    Check up for matching to the explicitly specified error in the
+#             message included in the single parameter of the procedure.
+# Parameters: See above.
+# Returns:    1 if the error is absent, otherwise - 0.
+proc message_check_no_file { mess } {
+    if { [ expr [ string match "*No such file or directory*" $mess ] ? "0" : "1" ] == "0" } {
+	return 0
+    } else {
+	return 1
+    }
+}
+
+# Purpose:    Pull $err_filename file from the target, write all its content
+#             to stdout and read a return code of the test.
+#             If parameter 'delay' is greater than 0, then the delay is made
+#             before the pulling. In case of success this also updates the
+#             upper variable 'modRC'.
+# Parameters: - tst is the name of the executed test;
+#             - delay (see above for description).
+# Returns:    0 in case of SUCCESS.
+#             >0 in case of FAIL.
+proc bridge_analyze_test_result {tst delay } {
+    global err_filename
+    global dest_folder
+
+    upvar modRC modRC
+
+    if { [expr $delay] > 0  } {
+	after $delay
+    }
+
+    if { [ bridge_pull ${err_filename} ${dest_folder} ] != 0 } { ;# stderr was NOT pulled
+	return 1
+    } else { ;# stderr was pulled
+	set err_line ""
+	set err_fname ""
+	append err_fname ${dest_folder} ${err_filename}
+	set fd_err [open ${err_fname}]
+	set modRC ""
+	while {[gets $fd_err err_line] >= 0} {
+	    lappend err_rows_list ${err_line}
+	}
+
+	# struggle with ^@255 in the last row: deletion of first two signs
+	set m [lindex $err_rows_list end]
+	if { ( [ string length $m ] == 4) && ([ string range $m 1 end] == "255" ) } {
+	    set m [string range $m 1 end]
+	}
+	if { ${m} != "" && [string is integer $m] } {
+	    set modRC $m
+	    set err_rows_list [lreplace $err_rows_list end end] ;# rc removal
+	}
+	foreach r $err_rows_list {
+	    puts "$tst: ${r}"
+	}
+	unset err_rows_list
+	close $fd_err
+
+	if { ${modRC} == "" } {
+	    set modRC "Unknown"
+	    return 2
+	}
+
+	return 0
+    }
+}
diff --git a/lib/dg.exp b/lib/dg.exp
index 889585f..6ddcc49 100644
--- a/lib/dg.exp
+++ b/lib/dg.exp
@@ -217,6 +217,7 @@ proc dg-process-target { selector } {
     global target_triplet
 
     set isnative [isnative]
+    set iscross  [iscross]
     set triplet_match 0
 
     #send_user "dg-process-target: $selector\n"
@@ -234,7 +235,7 @@ proc dg-process-target { selector } {
 
     # ??? This should work but it doesn't.  tcl bug?
     #if [regexp "^${what}(( \[^ \]+-\[^ \]+-\[^ \]+)|( native))+$" $selector tmp selector]
-    if {[regexp "^${what}( \[^ \]+-\[^ \]+-\[^ \]+| native)+$" $selector]} {
+    if {[regexp "^${what}( \[^ \]+-\[^ \]+-\[^ \]+| native| cross)+$" $selector]} {
 	regsub "^${what} " $selector "" selector
 	#send_user "selector: $selector\n"
 	foreach triplet $selector {
@@ -242,6 +243,8 @@ proc dg-process-target { selector } {
 		set triplet_match 1
 	    } elseif { $isnative && $triplet == "native" } {
 		set triplet_match 1
+	    } elseif { $iscross  && $triplet == "cross" } {
+		set triplet_match 1
 	    }
 	}
     } else {
diff --git a/lib/framework.exp b/lib/framework.exp
index 32aaa74..d22589e 100644
--- a/lib/framework.exp
+++ b/lib/framework.exp
@@ -248,6 +248,13 @@ proc istarget { args } {
     return 0
 }
 
+# Returns 1 if running cross, otherwise 0.
+#
+proc iscross { } {
+    global cross_target
+    return $cross_target
+}
+
 # Check to see if we're running the tests in a native environment
 # Returns 1 if running native, 0 if on a target.
 #
diff --git a/lib/remote.exp b/lib/remote.exp
index 5cfe43a..aa38b06 100644
--- a/lib/remote.exp
+++ b/lib/remote.exp
@@ -789,9 +789,18 @@ proc remote_spawn { dest commandline args } {
 
 	if { [llength $args] > 0 } {
 	    if { [lindex $args 0] == "readonly" } {
-		set result [catch { open "| ${commandline} |& cat" "r" } id]
-		if { $result != 0 } {
-		    return -1
+		if { $dest == "unix" && [board_info $dest exists target_bridge] } {
+		    set result ""
+		    set id ""
+		    set rst_rc [ remote_spawn_target $dest $commandline $args ]
+		    if { $rst_rc != 0 } {
+			return -1
+		    }
+		} else {
+		    set result [catch { open "| ${commandline} |& cat" "r" } id]
+		    if { $result != 0 } {
+			return -1
+		    }
 		}
 	    } else {
 		set result [catch {open "| ${commandline}" "w"} id]
@@ -838,6 +847,77 @@ proc remote_spawn { dest commandline args } {
     }
 }
 
+# It is a part of the above remote_spawn procedure
+# modified for push/pull technology of tests' execution
+# when target_triplet does not match host_triplet.
+#
+proc remote_spawn_target { dest commandline args } {
+    global board_info
+    global bridge_prefix
+    global target_exec_folder
+    global test_common_name_on_target
+    global exec_sh
+    global err_filename
+    global dest_folder
+    global bridge_shell_option
+    global delays_list
+
+    upvar result result
+    upvar id id
+
+    set test_name [file tail $commandline]
+    if { [bridge_push $commandline $test_common_name_on_target] >= 1 } {
+	puts "push $commandline TO  ${target_exec_folder}/$test_common_name_on_target FAILED."
+	return -1
+    }
+
+    if { $dest_folder == "" } {
+	set dest_folder [pwd]
+	append dest_folder "\/"
+    }
+    set commandline ""
+    append commandline ${bridge_prefix} $bridge_shell_option " " \
+	${target_exec_folder} \
+	"/$exec_sh $target_exec_folder $test_common_name_on_target"
+    set modRC "Unknown"
+
+    set pulls_limit 3
+    set pulls 0 ;# pull number from 0
+
+    set runs_limit 2 ;# this value must be less or equaled to $pulls_limit
+    set runs 0 ;# test run number from 0
+
+    while { $pulls < $pulls_limit } {
+	if { $runs < $runs_limit  } {
+	    if { [expr $runs] > 0 } {
+		puts "$test_name: REPEATED EXECUTION"
+		set pieces_list [split $test_name "."]
+		set src_name [lindex $pieces_list 0]
+		bridge_rm $target_exec_folder/$src_name.* 0 ;# cleaning
+	    }
+	    set result [catch { open "| ${commandline} |& cat" "r" } id]
+	}
+	if { [expr $pulls] == [expr "$pulls_limit - 1"] } {
+	    puts "$test_name: BIG DELAY"
+	}
+	if { [bridge_analyze_test_result $test_name [lindex $delays_list $pulls] ] == 0 } {
+	    break
+	}
+	if { [expr $runs] < [expr "$runs_limit -1"]  } {
+	    catch { close $id }
+	}
+	set runs [expr "$runs + 1"]
+	set pulls [expr "$pulls + 1"]
+    }
+
+    set result $modRC ;# correct return code
+    if { "$result" != "0" } {
+	    puts "$test_name: return_code=$result"
+	    return -1
+    }
+    return 0
+}
+
 proc remote_raw_spawn { dest commandline } {
     return [call_remote raw spawn "$dest" "$commandline"]
 }
diff --git a/runtest.exp b/runtest.exp
index 78da782..43a7970 100644
--- a/runtest.exp
+++ b/runtest.exp
@@ -789,7 +789,7 @@ proc setup_target_hook { whole_name name } {
 
     if { ![isnative] && ![is_remote target] } {
 	global env build_triplet target_triplet
-	if { (![info exists env(DEJAGNU)]) && ($build_triplet != $target_triplet) } {
+	if { (![info exists env(DEJAGNU)]) && ($build_triplet != $target_triplet) && [board_info $name exists target_bridge] == 0 } {
 	    warning "Assuming target board is the local machine (which is probably wrong).\nYou may need to set your DEJAGNU environment variable."
 	}
     }
@@ -959,6 +959,7 @@ load_lib remote.exp
 load_lib target.exp
 load_lib targetdb.exp
 load_lib libgloss.exp
+load_lib bridge.exp
 
 # Initialize the test counters and reset them to 0.
 init_testcounts
