summaryrefslogtreecommitdiff
path: root/system/binutils/APKBUILD
blob: 1dbb98d34c98561401539355b0ccc401f4b3db18 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# Maintainer: Adelie Platform Group <adelie-devel@lists.adelielinux.org>
pkgname=binutils
pkgver=2.45
pkgrel=0
pkgdesc="Tools necessary to build programs"
url="https://www.gnu.org/software/binutils/"
arch="all"
license="GPL-2.0+ AND GPL-3.0+ AND LGPL-2.0+ AND LGPL-2.1+ AND LGPL-3.0+ AND BSD-3-Clause"
depends=""
makedepends_build="byacc flex texinfo"
makedepends_host="zlib-dev"
makedepends="$makedepends_build $makedepends_host"
checkdepends="dejagnu"
subpackages="$pkgname-dev $pkgname-doc $pkgname-lang $pkgname-libs"
source="https://ftp.gnu.org/gnu/$pkgname/$pkgname-$pkgver.tar.xz
	binutils-ld-fix-static-linking.patch
	disable-ifunc-tests.patch
	disable-pr26580-test.patch
	disable-preinit-array-tests.patch
	disable-relr-glibc-tests.patch
	disable-sframe-tests.patch
	musl-preinit-array.patch
	musl-versioned-syms.patch
	pr25749-test-size.patch
	remove-pr2404-tests.patch
	remove-pr19553c-test.patch
	visibility-musl.patch
	vsb-hammer.patch
	BTS-170.patch
	fix-deprecated-egrep-usage.patch
	"

if [ "$CHOST" != "$CTARGET" ]; then
	pkgname="$pkgname-$CTARGET_ARCH"
	subpackages=""
	options="!check"
	sonameprefix="$pkgname:"
	builddir="$srcdir"/binutils-$pkgver
fi

# secfixes: binutils
#   2.28-r1:
#     - CVE-2017-7614
#   2.31.1-r2:
#     - CVE-2018-19931
#     - CVE-2018-19932
#   2.32-r0:
#     - CVE-2018-1000876
#   2.32-r2:
#     - CVE-2019-9070
#     - CVE-2019-9071
#     - CVE-2019-9073
#     - CVE-2019-9074
#     - CVE-2019-9075
#     - CVE-2019-9077
#     - CVE-2019-12972
#     - CVE-2019-14250
#   2.32-r3:
#     - CVE-2019-14444
#   2.32-r5:
#     - CVE-2019-17450
#     - CVE-2019-17451

build() {
	_sysroot=/
	_cross_configure="--enable-install-libiberty"
	_arch_configure=""

	if [ "$CHOST" != "$CTARGET" ]; then
		_sysroot="$CBUILDROOT"
		_cross_configure="--disable-install-libiberty"
	fi

	# -z separate-code is currently causing kernel miscompiles on x86*
	case "$CTARGET_ARCH" in
	x86 | pmmx | i528) _arch_configure="--disable-separate-code" ;;
	x86_64) _arch_configure="--disable-separate-code --enable-targets=x86_64-pep" ;;
	esac

	case "$CTARGET_ARCH" in
	mips*)  _hash_style_configure="--enable-default-hash-style=sysv" ;;
	*)      _hash_style_configure="--enable-default-hash-style=gnu"	;;
	esac

	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--target=$CTARGET \
		--with-build-sysroot="$CBUILDROOT" \
		--with-sysroot=$_sysroot \
		--prefix=/usr \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--disable-multilib \
		--enable-shared \
		--enable-ld=default \
		--enable-64-bit-bfd \
		--enable-plugins \
		--enable-relro \
		--enable-gprofng=no \
		--disable-gold \
		--enable-deterministic-archives \
		$_cross_configure \
		$_arch_configure \
		$_hash_style_configure \
		--disable-werror \
		--with-system-zlib \
		--enable-lto
	make
}

check() {
	make check
}

package() {
	make install DESTDIR="$pkgdir"
	if [ -d "$pkgdir"/usr/lib64 ]; then
		die "Something really bad happened."
		mv "$pkgdir"/usr/lib64/* "$pkgdir"/usr/lib/
		rmdir "$pkgdir"/usr/lib64
	fi
	if [ "$CHOST" != "$CTARGET" ]; then
		# creating cross tools: remove any files that would conflict
		# with the native tools, or other cross tools
		rm -r "$pkgdir"/usr/share
		rm -f "$pkgdir"/usr/lib/libiberty.a
	fi
}

libs() {
	pkgdesc="Runtime libraries from binutils"

	mkdir -p "$subpkgdir"/usr/lib
	mv "$pkgdir"/usr/lib/lib*.so "$subpkgdir"/usr/lib/
}

sha512sums="c7b10a7466d9fd398d7a0b3f2a43318432668d714f2ec70069a31bdc93c86d28e0fe83792195727167743707fbae45337c0873a0786416db53bbf22860c16ce7  binutils-2.45.tar.xz
66574f66b289bddf7f5b97bb712d02acdb42887a22446cb6a60f6e0fbea166ff61c1d32e740d0ec194f7787dd048134856650e543742e6262043b4c20067f6e4  binutils-ld-fix-static-linking.patch
ae54a3728b6e674febf130979a434f525b77f93103eef9c023647a68eaf5b607dfe264ab553d2132f46e93956959d1adf71bbd176e80a42a33329e62f6f55c3e  disable-ifunc-tests.patch
4c39f6e55a69c41a155ef402ff05ec72b406416c22b95b45b3744b2abc6d483b271d355a0afbf1ae8f4ac39e69ef41c49b723f2d5e6b1cde77ff48aa2db8db40  disable-pr26580-test.patch
c04600d23616f54a480a91ed53bb11591830f6636d9172b732886a24c13386d426c4652079c18e62c493e6cb88d091d5df61682525abc212d2c5e116cb0b0931  disable-preinit-array-tests.patch
4b0089f72c676fadbbcffbd87d2715ca010a4a87392d677b0887b86ce5c2ba446fb45e079bcd4492c47d1479b91b4a2c5b2466746166081e04f4b24191239625  disable-relr-glibc-tests.patch
35953c58cf95a9b05af29e0560b1fc7037bcbb4753b10f1ac741c1ef6c62acb9237151027d88c2bec4f8755bd2b4974e937d9d2782cf32ab645f076c7841dc76  disable-sframe-tests.patch
15583105ff99b89cea11d9bd7f00360c353fc1f41b0cfae1201b4b0479efd9d2d6abd407edaff689c39c64d9c23d062aa3dd0c9eefb700c3d7773a92d9ef2c79  musl-preinit-array.patch
ad38c37ae67f60cf3091bf5012dbdaba0982a3e4eac5f3be400d989fb3f7400a4be2db0b8658357ec1e8be71eaddf012e9608ae8540f28fe9fa3af3d87e90fa3  musl-versioned-syms.patch
c76733b76daf5d4af17464777cb753c68063fdc6040d943962c78182ca65f46a2744d4437f6cc3b8ff5f09ff8c0f582690b7dc89eaaf4da48f9300a81b8b3803  pr25749-test-size.patch
c54fa146dd6838c7b55441943b2ca0e344d851615574a46464e253d3f4a9ef3594ef9cf2bc69b584032a8206bf891d0aae62fb38b32873dc60c9d51874ead2ae  remove-pr2404-tests.patch
06f9df891a4ae0e9f6f8b3282d3691ede7cc0f08d63bf722f942f3c94dd4d7f3907b7bb5a8087e63639569e61aed6c39b5f5da7ad6566e7ef278524aa32ada63  remove-pr19553c-test.patch
075565f9bc85c0fc4bd36c7a848f6b876b71fbbe0f572b5c21961687ab4e2cd00c784fba09fe92b214c4b1df871ebd6409e6c93dde5a0a6c1ef6e41a30b24520  visibility-musl.patch
262b5d554af9fe4d687a5593d74004419afbf52112104559539e1422325ab9ffad9845203f01636572622822408cefa198e29ea25428add89896f66f47616a71  vsb-hammer.patch
d8127bb41b11884fe7eff96157fd32b506bc680bda6b6d5a4eb6df6357e2c4fe93d3cf5dd9406903c89123c0cc88897836e4995bbd531a2cf9888effd9bb7ded  BTS-170.patch
95f2063ecb902148e53603211452ca21d4dec215c32a07c2eebc5881dbdc7cba34a7a49177fedf4db1d7d8542708af673a31930fd7d49a6a2eb00b47dbe6eeb9  fix-deprecated-egrep-usage.patch"