Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 252354
Collapse All | Expand All

(-)bin/prepstrip (-5 / +22 lines)
Lines 30-41 Link Here
30
	ewarn "be found. This feature will not work unless debugedit is installed!"
30
	ewarn "be found. This feature will not work unless debugedit is installed!"
31
fi
31
fi
32
32
33
inode_var_name() {
34
	if  [[ $USERLAND = BSD ]] ; then
35
		stat -f 'INODE_%d_%i' "$1"
36
	else
37
		stat -c 'INODE_%d_%i' "$1"
38
	fi
39
}
40
33
save_elf_sources() {
41
save_elf_sources() {
34
	hasq installsources ${FEATURES} || return 0
42
	hasq installsources ${FEATURES} || return 0
35
	hasq installsources ${RESTRICT} && return 0
43
	hasq installsources ${RESTRICT} && return 0
36
	type -P debugedit >/dev/null || return 0
44
	type -P debugedit >/dev/null || return 0
37
45
38
	local x=$1
46
	local x=$1
47
	local inode=$(inode_var_name "$x")
48
	[[ -n ${!inode} ]] && return 0
39
	local sources_dir=/usr/src/debug/${CATEGORY}/${PF}
49
	local sources_dir=/usr/src/debug/${CATEGORY}/${PF}
40
	debugedit -b "${WORKDIR}" -d "${sources_dir}" \
50
	debugedit -b "${WORKDIR}" -d "${sources_dir}" \
41
		-l "${T}"/debug.sources "${x}"
51
		-l "${T}"/debug.sources "${x}"
Lines 60-71 Link Here
60
	local buildid="$( type -P debugedit >/dev/null && debugedit -i "${x}" )"
70
	local buildid="$( type -P debugedit >/dev/null && debugedit -i "${x}" )"
61
71
62
	mkdir -p $(dirname "${y}")
72
	mkdir -p $(dirname "${y}")
63
	${OBJCOPY} --only-keep-debug "${x}" "${y}"
64
	${OBJCOPY} --add-gnu-debuglink="${y}" "${x}"
65
	[[ -g ${x} ]] && chmod go-r "${y}"
66
	[[ -u ${x} ]] && chmod go-r "${y}"
67
	chmod a-x,o-w "${y}"
68
73
74
	local inode=$(inode_var_name "$x")
75
	if [[ -n ${!inode} ]] ; then
76
		ln "${D}usr/lib/debug/${!inode:${#D}}.debug" "$y"
77
	else
78
		eval $inode=\"$x\"
79
		${OBJCOPY} --only-keep-debug "${x}" "${y}"
80
		${OBJCOPY} --add-gnu-debuglink="${y}" "${x}"
81
		[[ -g ${x} ]] && chmod go-r "${y}"
82
		[[ -u ${x} ]] && chmod go-r "${y}"
83
		chmod a-x,o-w "${y}"
84
	fi
85
69
	if [[ -n ${buildid} ]] ; then
86
	if [[ -n ${buildid} ]] ; then
70
		local buildid_dir="${D}usr/lib/debug/.build-id/${buildid:0:2}"
87
		local buildid_dir="${D}usr/lib/debug/.build-id/${buildid:0:2}"
71
		local buildid_file="${buildid_dir}/${buildid:2}"
88
		local buildid_file="${buildid_dir}/${buildid:2}"

Return to bug 252354