Diff binutils-2.34-r2 with a binutils-2.35.2

/usr/portage/sys-devel/binutils/binutils-2.35.2.ebuild 2023-10-09 14:52:35.476368501 +0300
8 8
DESCRIPTION="Tools necessary to build programs"
9 9
HOMEPAGE="https://sourceware.org/binutils/"
10 10
LICENSE="GPL-3+"
11
IUSE="default-gold doc +gold multitarget +nls +plugins static-libs test"
11
IUSE="cet default-gold doc +gold multitarget +nls +plugins static-libs test vanilla"
12 12
REQUIRED_USE="default-gold? ( gold )"
13 13

  
14
# Variables that can be set here:
14
# Variables that can be set here  (ignored for live ebuilds)
15 15
# PATCH_VER          - the patchset version
16 16
#                      Default: empty, no patching
17 17
# PATCH_BINUTILS_VER - the binutils version in the patchset name
......
19 19
# PATCH_DEV          - Use download URI https://dev.gentoo.org/~{PATCH_DEV}/distfiles/...
20 20
#                      for the patchsets
21 21

  
22
PATCH_VER=6
22
PATCH_VER=1
23 23
PATCH_DEV=dilfridge
24 24

  
25
case ${PV} in
26
	9999)
27
		EGIT_REPO_URI="https://sourceware.org/git/binutils-gdb.git"
28
		inherit git-r3
29
		S=${WORKDIR}/binutils
30
		EGIT_CHECKOUT_DIR=${S}
31
		SLOT=${PV}
32
		;;
33
	*)
34
		SRC_URI="mirror://gnu/binutils/binutils-${PV}.tar.xz"
35
		SLOT=$(ver_cut 1-2)
36
		KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86"
37
		;;
38
esac
39

  
40
#
41
# The Gentoo patchset
42
#
43
PATCH_BINUTILS_VER=${PATCH_BINUTILS_VER:-${PV}}
44
PATCH_DEV=${PATCH_DEV:-slyfox}
45

  
46
[[ -z ${PATCH_VER} ]] || SRC_URI="${SRC_URI}
47
	https://dev.gentoo.org/~${PATCH_DEV}/distfiles/binutils-${PATCH_BINUTILS_VER}-patches-${PATCH_VER}.tar.xz"
25
if [[ ${PV} == 9999* ]]; then
26
	inherit git-r3
27
	SLOT=${PV}
28
else
29
	PATCH_BINUTILS_VER=${PATCH_BINUTILS_VER:-${PV}}
30
	PATCH_DEV=${PATCH_DEV:-slyfox}
31
	SRC_URI="mirror://gnu/binutils/binutils-${PV}.tar.xz"
32
	[[ -z ${PATCH_VER} ]] || SRC_URI="${SRC_URI}
33
		https://dev.gentoo.org/~${PATCH_DEV}/distfiles/binutils-${PATCH_BINUTILS_VER}-patches-${PATCH_VER}.tar.xz"
34
	SLOT=$(ver_cut 1-2)
35
	KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86"
36
fi
48 37

  
49 38
#
50 39
# The cross-compile logic
......
67 56
DEPEND="${RDEPEND}"
68 57
BDEPEND="
69 58
	doc? ( sys-apps/texinfo )
70
	test? ( dev-util/dejagnu )
59
	test? (
60
		dev-util/dejagnu
61
		sys-devel/bc
62
	)
71 63
	nls? ( sys-devel/gettext )
72 64
	sys-devel/flex
73 65
	app-alternatives/yacc
......
75 67

  
76 68
RESTRICT="!test? ( test )"
77 69

  
70
PATCHES=(
71
	"${FILESDIR}"/${PN}-2.35.1-cet.patch
72
	"${FILESDIR}"/${PN}-2.35.2-powerpc-tests.patch
73
)
74

  
78 75
MY_BUILDDIR=${WORKDIR}/build
79 76

  
80 77
src_unpack() {
81
	case ${PV} in
82
		*9999)
83
			git-r3_src_unpack
84
			;;
85
		*)
86
			;;
87
	esac
88
	default
89
	mkdir -p "${MY_BUILDDIR}"
78
	if [[ ${PV} == 9999* ]] ; then
79
		EGIT_REPO_URI="https://anongit.gentoo.org/git/proj/toolchain/binutils-patches.git"
80
		EGIT_CHECKOUT_DIR=${WORKDIR}/patches-git
81
		git-r3_src_unpack
82
		mv patches-git/9999 patch || die
83

  
84
		EGIT_REPO_URI="https://sourceware.org/git/binutils-gdb.git"
85
		S=${WORKDIR}/binutils
86
		EGIT_CHECKOUT_DIR=${S}
87
		git-r3_src_unpack
88
	else
89
		unpack ${P}.tar.xz
90

  
91
		cd "${WORKDIR}" || die
92
		unpack binutils-${PATCH_BINUTILS_VER}-patches-${PATCH_VER}.tar.xz
93
	fi
94

  
95
	cd "${WORKDIR}" || die
96
	mkdir -p "${MY_BUILDDIR}" || die
90 97
}
91 98

  
92 99
src_prepare() {
93
	if [[ -n ${PATCH_VER} ]] ; then
94
		einfo "Applying binutils-${PATCH_BINUTILS_VER} patchset ${PATCH_VER}"
95
		eapply "${WORKDIR}/patch"/*.patch
100
	local patchsetname
101
	if [[ ${PV} == 9999* ]] ; then
102
		patchsetname="from git master"
103
	else
104
		patchsetname="${PATCH_BINUTILS_VER}-${PATCH_VER}"
105
	fi
106

  
107
	if [[ -n ${PATCH_VER} ]] || [[ ${PV} == 9999* ]] ; then
108
		if ! use vanilla; then
109
			einfo "Applying binutils patchset ${patchsetname}"
110
			eapply "${WORKDIR}/patch"
111
			einfo "Done."
112
		fi
96 113
	fi
97 114

  
98 115
	# Make sure our explicit libdir paths don't get clobbered. #562460
......
233 250
		--enable-relro
234 251
		# Newer versions (>=2.24) make this an explicit option. #497268
235 252
		--enable-install-libiberty
253
		# Available from 2.35 on
254
		--enable-textrel-check=warning
236 255
		--disable-werror
237 256
		--with-bugurl="$(toolchain-binutils_bugurl)"
238 257
		--with-pkgversion="$(toolchain-binutils_pkgversion)"
......
250 269
		# avoid automagic dependency on (currently prefix) systems
251 270
		# systems with debuginfod library, bug #754753
252 271
		--without-debuginfod
272

  
273
		# Allow user to opt into CET for host libraries.
274
		# Ideally we would like automagic-or-disabled here.
275
		# But the check does not quite work on i686: bug #760926.
276
		$(use_enable cet)
253 277
	)
254 278
	echo ./configure "${myconf[@]}"
255 279
	"${S}"/configure "${myconf[@]}" || die
Thank you!