summaryrefslogtreecommitdiffstats
path: root/bin/misc-functions.sh
diff options
context:
space:
mode:
Diffstat (limited to 'bin/misc-functions.sh')
-rwxr-xr-xbin/misc-functions.sh40
1 files changed, 40 insertions, 0 deletions
diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index 358288932..b536a63e9 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -308,6 +308,46 @@ install_qa_check() {
sleep 1
fi
+ # Check for files built without respecting CFLAGS
+ if [[ "${CFLAGS}" == *-frecord-gcc-switches* ]] && [[ "${PN}" != *-bin ]] ; then
+ qa_var="QA_DT_SWITCHES_${ARCH/-/_}"
+ eval "[[ -n \${!qa_var} ]] && QA_DT_SWITCHES=(\"\${${qa_var}[@]}\")"
+ f=$(scanelf -qyRF '%k %p' -k \!.GCC.command.line "${ED}" | sed -e "s:\!.GCC.command.line ::")
+ if [[ -n ${f} ]] ; then
+ echo "${f}" > "${T}"/scanelf-ignored-CFLAGS.log
+ if [ "${QA_STRICT_DT_SWITCHES-unset}" == unset ] ; then
+ if [[ ${#QA_DT_SWITCHES[@]} -gt 1 ]] ; then
+ for x in "${QA_DT_SWITCHES[@]}" ; do
+ sed -e "s#^${x#/}\$##" -i "${T}"/scanelf-ignored-CFLAGS.log
+ done
+ else
+ local shopts=$-
+ set -o noglob
+ for x in ${QA_DT_SWITCHES} ; do
+ sed -e "s#^${x#/}\$##" -i "${T}"/scanelf-ignored-CFLAGS.log
+ done
+ set +o noglob
+ set -${shopts}
+ fi
+ fi
+ # Filter anything under /usr/lib/debug/ in order to avoid
+ # duplicate warnings for splitdebug files.
+ sed -e "s#^usr/lib/debug/.*##" -e "/^\$/d" -e "s#^#/#" \
+ -i "${T}"/scanelf-ignored-CFLAGS.log
+ f=$(<"${T}"/scanelf-ignored-CFLAGS.log)
+ if [[ -n ${f} ]] ; then
+ vecho -ne '\n'
+ eqawarn "${BAD}QA Notice: Files built without respecting CFLAGS have been detected${NORMAL}"
+ eqawarn " Please include the following list of files in your report:"
+ eqawarn "${f}"
+ vecho -ne '\n'
+ sleep 1
+ else
+ rm -f "${T}"/scanelf-ignored-CFLAGS.log
+ fi
+ fi
+ fi
+
# Check for files built without respecting LDFLAGS
if [[ "${LDFLAGS}" == *,--hash-style=gnu* ]] && [[ "${PN}" != *-bin ]] ; then
qa_var="QA_DT_HASH_${ARCH/-/_}"