|
| 1 | +diff --git i/testsuite/build w/testsuite/build |
| 2 | +index cf760c0..fe575b8 100755 |
| 3 | +--- i/testsuite/build |
| 4 | ++++ w/testsuite/build |
| 5 | +@@ -11,6 +11,7 @@ cargoflags="$1" |
| 6 | + shift |
| 7 | + buildtype="debug" |
| 8 | + cflags="-g3 -Og" |
| 9 | ++rustflags="" |
| 10 | + case "$cargoflags" in |
| 11 | + -*-release*) |
| 12 | + buildtype="release" |
| 13 | +@@ -27,6 +28,10 @@ if [ "$buildtype" = "release" ] |
| 14 | + then |
| 15 | + cflags="-O2" |
| 16 | + fi |
| 17 | ++if [ -e lib ] |
| 18 | ++then |
| 19 | ++ rustflags="-Clink-arg=-L$PWD/lib" |
| 20 | ++fi |
| 21 | + |
| 22 | + cd "`dirname "$0"`" |
| 23 | + cd "$LIBINGER" |
| 24 | +@@ -34,8 +39,11 @@ cd "$LIBINGER" |
| 25 | + set -ve |
| 26 | + ./configure || true |
| 27 | + mkdir -p "target/$buildtype" |
| 28 | +-cargo build $cargoflags |
| 29 | + cargo run $cargoflags >"target/$buildtype/libinger.h" |
| 30 | ++ |
| 31 | ++export RUSTFLAGS="-Cprefer-dynamic=no" |
| 32 | ++cargo build $cargoflags --lib |
| 33 | ++cargo build $cargoflags --lib |
| 34 | + cp external/libgotcha/libgotcha_api.h "target/$buildtype/libgotcha.h" |
| 35 | + cp external/libgotcha/libgotcha_repl.h "target/$buildtype" |
| 36 | + objcopy -Wsignal --globalize-symbol libgotcha_dlsym --globalize-symbol libgotcha_signal "target/$buildtype/deps/libgotcha-"*.rlib 2>/dev/null |
| 37 | +@@ -43,7 +51,7 @@ rm "target/$buildtype/deps/libinger.so" |
| 38 | + cd - |
| 39 | + c99 $cflags -Wall -Wextra -Wpedantic -Werror "$@" -c -fpic -fno-optimize-sibling-calls -D_GNU_SOURCE -Wno-missing-attributes -I"$OLDPWD/target/$buildtype" testinger.c |
| 40 | + cd - |
| 41 | +-cargo rustc $cargoflags --lib -- -Clink-arg="$OLDPWD/testinger.o" |
| 42 | ++eval cargo rustc "$cargoflags" --lib -- -Clink-arg="$OLDPWD/testinger.o" "$rustflags" "`sed -n -e's/",/"/g' -e's/^rustflags = \[\(.\+\)\]$/\1/p' .cargo/config`" |
| 43 | + cd - |
| 44 | + mv "$OLDPWD/target/$buildtype/libinger.so" libtestinger.so |
| 45 | + rm "$OLDPWD/target/$buildtype/deps/libinger.so" |
| 46 | +diff --git i/testsuite/test w/testsuite/test |
| 47 | +index cfef791..0c83013 100755 |
| 48 | +--- i/testsuite/test |
| 49 | ++++ w/testsuite/test |
| 50 | +@@ -1,5 +1,7 @@ |
| 51 | + #!/bin/sh |
| 52 | + |
| 53 | ++readonly VERSION="2.29" |
| 54 | ++ |
| 55 | + GNULIB="$*" |
| 56 | + if [ -z "$GNULIB" ] |
| 57 | + then |
| 58 | +@@ -7,9 +9,38 @@ then |
| 59 | + fi |
| 60 | + |
| 61 | + set -ve |
| 62 | +-[ ! -e libtestinger.so ] && ./build release |
| 63 | + [ ! -e gnulib/configure ] && "$GNULIB/gnulib-tool" --create-testdir --dir gnulib --single-configure `"$GNULIB/posix-modules"` |
| 64 | +-[ ! -e Makefile ] && gnulib/configure CFLAGS="-fpic -g3" |
| 65 | ++if [ ! -e Makefile ] |
| 66 | ++then |
| 67 | ++ cflags="" |
| 68 | ++ ldflags="" |
| 69 | ++ version="`ldd --version | head -n1 | rev | cut -d" " -f1 | rev`" |
| 70 | ++ if [ "$version" != "$VERSION" ] |
| 71 | ++ then |
| 72 | ++ echo >&2 |
| 73 | ++ echo "!!! It looks like your system uses glibc $version." >&2 |
| 74 | ++ echo "!!! We recommend running this suite on version $VERSION!" >&2 |
| 75 | ++ echo >&2 |
| 76 | ++ printf %s "Path to an alternative ld-linux.so (enter to use system's)? " |
| 77 | ++ read interp |
| 78 | ++ if [ -n "$interp" ] |
| 79 | ++ then |
| 80 | ++ interp="`realpath "$interp"`" |
| 81 | ++ ldflags="-Wl,-I$interp" |
| 82 | ++ |
| 83 | ++ lib="`dirname "$interp"`" |
| 84 | ++ ldflags="-L$lib $ldflags" |
| 85 | ++ ln -s "$lib" . |
| 86 | ++ rm -f libtestinger.so |
| 87 | ++ |
| 88 | ++ cflags="-I." |
| 89 | ++ mkdir sys |
| 90 | ++ echo "#error" >sys/single_threaded.h |
| 91 | ++ fi |
| 92 | ++ fi |
| 93 | ++ gnulib/configure CFLAGS="-fpic -g3 $cflags" LDFLAGS="$ldflags" |
| 94 | ++fi |
| 95 | ++[ ! -e libtestinger.so ] && ./build release |
| 96 | + make -j"`getconf _NPROCESSORS_ONLN`" |
| 97 | + [ ! -e gltests/test-suite.log ] && make check || true |
| 98 | + make check LD_PRELOAD="$PWD/libtestinger.so" LIBGOTCHA_NUMGROUPS="1" LIBGOTCHA_SKIP="`cat <<-tac |
0 commit comments