summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
Diffstat (limited to 'eclass')
-rw-r--r--eclass/fcaps.eclass19
-rw-r--r--eclass/toolchain.eclass8
2 files changed, 15 insertions, 12 deletions
diff --git a/eclass/fcaps.eclass b/eclass/fcaps.eclass
index 81c1ca62368c..0bbfc867716f 100644
--- a/eclass/fcaps.eclass
+++ b/eclass/fcaps.eclass
@@ -87,9 +87,8 @@ esac
# The caps mode is used to set the permission on the file if capabilities
# were properly set on the file. No change is applied by default.
#
-# If the system is unable to set capabilities, it will use the specified user,
-# group, and mode. The user and group default to 0. If mode is unspecified, no
-# change is applied.
+# If capabilities are not sucessfully applied, the permissions on the file are
+# updated according to the owner, group, and mode options, if provided.
#
# For example, "-m u+s" may be used to enable suid as a fallback when file caps
# are unavailable. This should be used with care, typically when the
@@ -103,8 +102,8 @@ fcaps() {
fi
# Process the user options first.
- local owner='0'
- local group='0'
+ local owner=
+ local group=
local mode=
local caps_mode=
@@ -183,12 +182,12 @@ fcaps() {
fi
fi
- # If we're still here, setcaps failed.
+ # If we're still here, setcaps failed or filecaps are disabled.
+ if [[ -n ${owner} || -n ${group} ]]; then
+ debug-print "${FUNCNAME}: setting owner on '${file}'"
+ chown "${owner}${group:+:}${group}" "${file}" || die
+ fi
if [[ -n ${mode} ]]; then
- if [[ -n ${owner} || -n ${group} ]]; then
- debug-print "${FUNCNAME}: setting owner on '${file}'"
- chown "${owner}:${group}" "${file}" || die
- fi
debug-print "${FUNCNAME}: setting mode on '${file}'"
chmod ${mode} "${file}" || die
fi
diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index 2afa6df1295a..4b90df79f0e7 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -424,7 +424,7 @@ if tc_has_feature zstd ; then
fi
if tc_has_feature valgrind ; then
- BDEPEND+=" valgrind? ( dev-debug/valgrind )"
+ DEPEND+=" valgrind? ( dev-debug/valgrind )"
fi
if [[ ${PN} != gnat-gpl ]] && tc_has_feature ada ; then
@@ -1801,7 +1801,11 @@ toolchain_src_configure() {
# We patch this in w/ PR66487-object-lifetime-instrumentation-for-Valgrind.patch,
# so it may not always be available.
if grep -q -- '--enable-valgrind-interop' "${S}"/libgcc/configure.ac ; then
- confgcc+=( $(use_enable valgrind valgrind-interop) )
+ if ! is_crosscompile || $(tc-getCPP ${CTARGET}) -E - <<<"#include <valgrind/memcheck.h>" >& /dev/null ; then
+ confgcc+=( $(use_enable valgrind valgrind-interop) )
+ else
+ confgcc+=( --disable-valgrind-interop )
+ fi
fi
fi