Lines 1058-1065
Link Here
|
1058 |
fi |
1058 |
fi |
1059 |
|
1059 |
|
1060 |
# TEXTREL's are baaaaaaaad |
1060 |
# TEXTREL's are baaaaaaaad |
1061 |
f=$(scanelf -qyRF '%t %p' "${D}") |
1061 |
# Allow devs to mark things as ignorable ... e.g. things that are |
1062 |
if [[ -n ${f} ]] ; then |
1062 |
# binary-only and upstream isn't cooperating (nvidia-glx) ... we |
|
|
1063 |
# allow ebuild authors to set QA_TEXTRELS_arch and QA_TEXTRELS ... |
1064 |
# the former overrides the latter ... regexes allowed ! :) |
1065 |
qa_var="QA_TEXTRELS_${ARCH}" |
1066 |
[[ -n ${!qa_var} ]] && QA_TEXTRELS=${!qa_var} |
1067 |
[[ -n ${QA_STRICT_TEXTRELS} ]] && QA_TEXTRELS="" |
1068 |
QA_TEXTRELS=$(echo ${QA_TEXTRELS}) # strip newlines |
1069 |
f="" |
1070 |
s=$(scanelf -qyRF '"#t%p"' "${D}" | grep -v 'usr/lib/debug/') |
1071 |
s=$(echo ${s}) # strip newlines |
1072 |
# eval needed to get ${QA_TEXTRELS} expanded so bash splits |
1073 |
# words taking account of spaces in quoted words. |
1074 |
eval "for s in ${s}; do |
1075 |
for t in ${QA_TEXTRELS}; do |
1076 |
[[ \${s} =~ \"^\${t}$\" ]] && continue 2 |
1077 |
done |
1078 |
f=\"\${f}\${s}\n\" |
1079 |
done" |
1080 |
if [[ -n ${f[@]} ]] ; then |
1063 |
echo -ne '\a\n' |
1081 |
echo -ne '\a\n' |
1064 |
echo "QA Notice: the following files contain runtime text relocations" |
1082 |
echo "QA Notice: the following files contain runtime text relocations" |
1065 |
echo " Text relocations require a lot of extra work to be preformed by the" |
1083 |
echo " Text relocations require a lot of extra work to be preformed by the" |
Lines 1067-1088
Link Here
|
1067 |
echo " and might not function properly on other architectures hppa for example." |
1085 |
echo " and might not function properly on other architectures hppa for example." |
1068 |
echo " If you are a programmer please take a closer look at this package and" |
1086 |
echo " If you are a programmer please take a closer look at this package and" |
1069 |
echo " consider writing a patch which addresses this problem." |
1087 |
echo " consider writing a patch which addresses this problem." |
1070 |
echo "${f}" |
1088 |
printf "${f}" |
1071 |
echo -ne '\a\n' |
1089 |
echo -ne '\a\n' |
1072 |
[[ ${FEATURES/stricter} != "${FEATURES}" ]] \ |
1090 |
[[ ${FEATURES/stricter} != "${FEATURES}" ]] \ |
1073 |
&& die "Aborting due to textrels" |
1091 |
&& die "Aborting due to textrels" |
1074 |
sleep 1 |
1092 |
sleep 1 |
1075 |
fi |
1093 |
fi |
1076 |
|
1094 |
|
1077 |
# Check for files with executable stacks |
1095 |
# Also, executable stacks only matter on linux (and just glibc atm ...) |
1078 |
f=$(scanelf -qyRF '%e %p' "${D}") |
1096 |
f="" |
|
|
1097 |
case ${CTARGET:-${CHOST}} in |
1098 |
*-linux-gnu*) |
1099 |
# Check for files with executable stacks, but only on arches which |
1100 |
# are supported at the moment. Keep this list in sync with |
1101 |
# http://hardened.gentoo.org/gnu-stack.xml (Arch Status) |
1102 |
case ${CTARGET:-${CHOST}} in |
1103 |
i?86*|ia64*|m68k*|s390*|x86_64*) |
1104 |
# Allow devs to mark things as ignorable ... e.g. things |
1105 |
# that are binary-only and upstream isn't cooperating ... |
1106 |
# we allow ebuild authors to set QA_EXECSTACK_arch and |
1107 |
# QA_EXECSTACK ... the former overrides the latter ... |
1108 |
# regexes allowed ! :) |
1109 |
|
1110 |
qa_var="QA_EXECSTACK_${ARCH}" |
1111 |
[[ -n ${!qa_var} ]] && QA_EXECSTACK=${!qa_var} |
1112 |
[[ -n ${QA_STRICT_EXECSTACK} ]] && QA_EXECSTACK="" |
1113 |
QA_EXECSTACK=$(echo ${QA_EXECSTACK}) # strip newlines |
1114 |
s=$(scanelf -qyRF '"#e%p"' "${D}" | grep -v 'usr/lib/debug/') |
1115 |
s=$(echo ${s}) # strip newlines |
1116 |
# eval needed to get ${QA_TEXTRELS} expanded so bash splits |
1117 |
# words taking account of spaces in quoted words. |
1118 |
eval "for s in ${s}; do |
1119 |
for e in ${QA_EXECSTACK}; do |
1120 |
[[ \${s} =~ \"^\${e}$\" ]] && continue 2 |
1121 |
done |
1122 |
f=\"\${f}\${s}\n\" |
1123 |
done" |
1124 |
;; |
1125 |
esac |
1126 |
;; |
1127 |
esac |
1079 |
if [[ -n ${f} ]] ; then |
1128 |
if [[ -n ${f} ]] ; then |
1080 |
echo -ne '\a\n' |
1129 |
echo -ne '\a\n' |
1081 |
echo "QA Notice: the following files contain executable stacks" |
1130 |
echo "QA Notice: the following files contain executable stacks" |
1082 |
echo " Files with executable stacks will not work properly (or at all!)" |
1131 |
echo " Files with executable stacks will not work properly (or at all!)" |
1083 |
echo " on some architectures/operating systems. A bug should be filed" |
1132 |
echo " on some architectures/operating systems. A bug should be filed" |
1084 |
echo " at http://bugs.gentoo.org/ to make sure the file is fixed." |
1133 |
echo " at http://bugs.gentoo.org/ to make sure the file is fixed." |
1085 |
echo "${f}" |
1134 |
printf "${f}" |
1086 |
echo -ne '\a\n' |
1135 |
echo -ne '\a\n' |
1087 |
[[ ${FEATURES/stricter} != "${FEATURES}" ]] \ |
1136 |
[[ ${FEATURES/stricter} != "${FEATURES}" ]] \ |
1088 |
&& die "Aborting due to +x stack" |
1137 |
&& die "Aborting due to +x stack" |