Hash :
18fc9197
Author :
Date :
2020-03-26T13:34:28
[meson] Run check-symbols.sh and check-static-inits.sh correctly * Search src/ build directory for objects in check-static-inits.sh * Find .def files in src/ build directory in src/check-symbols.sh * Pass builddir also in autotools also, we may just remove libs passing after autotools removal * Move harfbuzz_subset_def target so can be referenced as a check-static-inits.sh dependency
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
#!/bin/sh
LC_ALL=C
export LC_ALL
test -z "$srcdir" && srcdir=.
test -z "$builddir" && builddir=.
stat=0
if which objdump 2>/dev/null >/dev/null; then
:
else
echo "check-static-inits.sh: 'objdump' not found; skipping test"
exit 77
fi
OBJS=$(find $builddir/ -name '*.o')
if test "x`echo $OBJS`" = "x$OBJS" 2>/dev/null >/dev/null; then
echo "check-static-inits.sh: object files not found; skipping test"
exit 77
fi
tested=false
echo "Checking that no object file has static initializers"
for obj in $OBJS; do
if objdump -t "$obj" | grep '[.][cd]tors' | grep -v '\<00*\>'; then
echo "Ouch, $obj has static initializers/finalizers"
stat=1
fi
tested=true
done
echo "Checking that no object file has lazy static C++ constructors/destructors or other such stuff"
for obj in $OBJS; do
if objdump -t "$obj" | grep -q '__cxa_' && ! objdump -t "$obj" | grep -q __ubsan_handle; then
objdump -t "$obj" | grep '__cxa_'
echo "Ouch, $obj has lazy static C++ constructors/destructors or other such stuff"
stat=1
fi
tested=true
done
if ! $tested; then
echo "check-static-inits.sh: no objects found; skipping test"
exit 77
fi
exit $stat