harfbuzz/src/check-static-inits.sh

40 lines
873 B
Bash
Raw Normal View History

#!/bin/sh
LC_ALL=C
export LC_ALL
test -z "$srcdir" && srcdir=.
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
2012-08-08 20:48:41 +02:00
OBJS=.libs/*.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
echo "Checking that no object file has static initializers"
2012-08-08 20:48:41 +02:00
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
done
2012-08-29 01:08:36 +02:00
echo "Checking that no object file has lazy static C++ constructors/destructors or other such stuff"
2012-08-08 20:48:41 +02:00
for obj in $OBJS; do
if objdump -t "$obj" | grep '__cxa_'; then
2012-08-29 01:08:36 +02:00
echo "Ouch, $obj has lazy static C++ constructors/destructors or other such stuff"
stat=1
fi
done
exit $stat