From 58d0eae5174b6f727a1155f6b67fc9cd664fbca0 Mon Sep 17 00:00:00 2001 From: Javernaut Date: Fri, 22 Nov 2019 18:29:52 +0200 Subject: [PATCH] exit 1 if output binaries contain Text Relocations. This will fail the CI job. --- .travis.yml | 1 - ffmpeg-android-maker.sh | 9 ++++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6bc2e03..6c363b6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,4 +9,3 @@ before_install: - cat $ANDROID_NDK_HOME/source.properties script: - bash -e ffmpeg-android-maker.sh - - cat stats/text-relocations.txt diff --git a/ffmpeg-android-maker.sh b/ffmpeg-android-maker.sh index 88caff3..3e0c64f 100755 --- a/ffmpeg-android-maker.sh +++ b/ffmpeg-android-maker.sh @@ -190,7 +190,14 @@ function assemble() { # Saving stats about text relocation presence. # If the result file doesn't have 'TEXTREL' at all, then we are good. - ${CROSS_PREFIX}readelf --dynamic ${BUILD_DIR}/${ABI}/lib/*.so | grep 'TEXTREL\|File' >> ${STATS_DIR}/text-relocations.txt + TEXT_REL_STATS_FILE=${STATS_DIR}/text-relocations.txt + ${CROSS_PREFIX}readelf --dynamic ${BUILD_DIR}/${ABI}/lib/*.so | grep 'TEXTREL\|File' >> ${TEXT_REL_STATS_FILE} + + if grep -q TEXTREL ${TEXT_REL_STATS_FILE}; then + echo "There are text relocations in output files:" + cat ${TEXT_REL_STATS_FILE} + exit 1 + fi cd ${BASE_DIR} }