diff options
Diffstat (limited to 'Build/source/libs/harfbuzz/harfbuzz-src/src/check-static-inits.sh')
-rwxr-xr-x | Build/source/libs/harfbuzz/harfbuzz-src/src/check-static-inits.sh | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/check-static-inits.sh b/Build/source/libs/harfbuzz/harfbuzz-src/src/check-static-inits.sh index def25c70143..cdfdee8fc40 100755 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/check-static-inits.sh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/check-static-inits.sh @@ -4,7 +4,7 @@ LC_ALL=C export LC_ALL test -z "$srcdir" && srcdir=. -test -z "$libs" && libs=.libs +test -z "$builddir" && builddir=. stat=0 if which objdump 2>/dev/null >/dev/null; then @@ -14,18 +14,21 @@ else exit 77 fi -OBJS=$libs/*.o +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" @@ -35,6 +38,12 @@ for obj in $OBJS; do 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 |