new file mode 100755
@@ -0,0 +1,31 @@
+#!/bin/sh
+# Build vdso using cross tools
+
+build_dir=error
+source_dir=error
+target_dir=error
+output=error
+
+while test $# -gt 0; do
+ opt="$1"
+ shift
+ case "$opt" in
+ -B) build_dir=$1; shift;;
+ -C) source_dir=$1; shift;;
+ -T) target_dir=$1; shift;;
+ -o) output=$1; shift;;
+ --) break;;
+ esac
+done
+
+frag="${build_dir}/tests/tcg/${target_dir}/config-target.mak"
+if ! test -f "$frag"; then
+ # No cross-compiler available
+ # Copy pre-build image into build tree
+ cp "${source_dir}/$(basename ${output})" "${output}"
+ exit $?
+fi
+
+# Extract cross-compiler from the makefile fragment, and build.
+CC=$(grep CC= "$frag" | sed s/CC=//)
+exec $CC -o "$output" $@
@@ -30,6 +30,7 @@ linux_user_ss.add(when: 'CONFIG_ARM_COMPATIBLE_SEMIHOSTING', if_true: files('sem
syscall_nr_generators = {}
+build_vdso_cmd = find_program('build-vdso.sh')
gen_vdso_exe = executable('gen-vdso', 'gen-vdso.c',
native: true, build_by_default: false)
gen_vdso = generator(gen_vdso_exe, output: '@BASENAME@.c.inc',
A shell script to build the vdso using the cross-compiler makefile fragment. If none detected, fall back to copying the pre-build vdso from the source directory. Signed-off-by: Richard Henderson <richard.henderson@linaro.org> --- linux-user/build-vdso.sh | 31 +++++++++++++++++++++++++++++++ linux-user/meson.build | 1 + 2 files changed, 32 insertions(+) create mode 100755 linux-user/build-vdso.sh