forked from mozilla/gecko-dev
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add in support for running a cross-shell directly in qemu (bug 807936…
…, r=ted)
- Loading branch information
Marty Rosenberg
committed
Nov 15, 2012
1 parent
5cb2973
commit 544dc37
Showing
5 changed files
with
71 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
# this script creates a wrapper shell script for an executable. The idea is the actual executable cannot be | ||
# executed natively (it was cross compiled), but we want to run tests natively. Running this script | ||
# as part of the compilation process will move the non-native executable to a new location, and replace it | ||
# with a script that will run it under qemu. | ||
while [[ -n $1 ]]; do | ||
case $1 in | ||
--qemu) QEMU="$2"; shift 2;; | ||
--libdir) LIBDIR="$2"; shift 2;; | ||
--ld) LD="$2"; shift 2;; | ||
*) exe="$1"; shift;; | ||
esac | ||
done | ||
if [[ -z $LIBDIR ]]; then | ||
echo "You need to specify a directory for the cross libraries when you configure the shell" | ||
echo "You can do this with --with-cross-lib=" | ||
exit 1 | ||
fi | ||
LD=${LD:-$LIBDIR/ld-linux.so.3} | ||
mv $exe $exe.target | ||
# Just hardcode the path to the executable. It'll be pretty obvious if it is doing the wrong thing. | ||
|
||
echo $'#!/bin/bash\n' $QEMU -E LD_LIBRARY_PATH="${LIBDIR}" "$LD" "$(readlink -f "$exe.target")" '"$@"' >"$exe" | ||
chmod +x $exe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
# this script creates a wrapper shell script for an executable. The idea is the actual executable cannot be | ||
# executed natively (it was cross compiled), but we want to run tests natively. Running this script | ||
# as part of the compilation process will move the non-native executable to a new location, and replace it | ||
# with a script that will run it under qemu. | ||
while [[ -n $1 ]]; do | ||
case $1 in | ||
--qemu) QEMU="$2"; shift 2;; | ||
--libdir) LIBDIR="$2"; shift 2;; | ||
--ld) LD="$2"; shift 2;; | ||
*) exe="$1"; shift;; | ||
esac | ||
done | ||
if [[ -z $LIBDIR ]]; then | ||
echo "You need to specify a directory for the cross libraries when you configure the shell" | ||
echo "You can do this with --with-cross-lib=" | ||
exit 1 | ||
fi | ||
LD=${LD:-$LIBDIR/ld-linux.so.3} | ||
mv $exe $exe.target | ||
# Just hardcode the path to the executable. It'll be pretty obvious if it is doing the wrong thing. | ||
|
||
echo $'#!/bin/bash\n' $QEMU -E LD_LIBRARY_PATH="${LIBDIR}" "$LD" "$(readlink -f "$exe.target")" '"$@"' >"$exe" | ||
chmod +x $exe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters