summaryrefslogtreecommitdiffstats
path: root/build/qemu-wrap
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
commit36d22d82aa202bb199967e9512281e9a53db42c9 (patch)
tree105e8c98ddea1c1e4784a60a5a6410fa416be2de /build/qemu-wrap
parentInitial commit. (diff)
downloadfirefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz
firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip
Adding upstream version 115.7.0esr.upstream/115.7.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'build/qemu-wrap')
-rwxr-xr-xbuild/qemu-wrap24
1 files changed, 24 insertions, 0 deletions
diff --git a/build/qemu-wrap b/build/qemu-wrap
new file mode 100755
index 0000000000..e33938955d
--- /dev/null
+++ b/build/qemu-wrap
@@ -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 \ No newline at end of file