summaryrefslogblamecommitdiff
path: root/system/binutils/APKBUILD
blob: 06f7c4cb6f5937e80a5efefc3f9c7552504ef6dd (plain) (tree)
1
2
3
4
5
6
7
8
9
                                                                        
                

           
                                           
                                            
          
                                                                                          
          
                                      


                                                  
                                                                   
                                                                
                                    
                                            
                                 

                                  
                                         

                                      
                               

                                 
                               
                                 
                                 
                                  

                             
                             
                                 

                     
                                        
         





                                        
                                           

  
                    
            



                      










                        

                      


                      

         


                                                     





                                                              




                                                                                        





                                                                           














                                                    
                                     
                                




                                                 

                                    
            

 



                  
           
                                      
                                           
                                                    










                                                                            
        
                                                 

                                     
                                                          

 







                                                                                                                                                                      
                                                                                                                                                            
                                                                                                                                                         

                                                                                                                                                           
                                                                                                                                                         

                                                                                                                                                           
                                                                                                                                                            

                                                                                                                                                       
                                                                                                                                                       
                                                                                                                                                           


                                                                                                                                                                   
# Maintainer: Adelie Platform Group <adelie-devel@lists.adelielinux.org>
pkgname=binutils
pkgver=2.42
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
	ar-deterministic-tests.patch
	binutils-ld-fix-static-linking.patch
	disable-ifunc-tests.patch
	disable-mbind2b.patch
	disable-pr26580-test.patch
	disable-preinit-array-tests.patch
	disable-relr-glibc-tests.patch
	disable-sframe-tests.patch
	libctf-32bit-test.patch
	musl-preinit-array.patch
	musl-versioned-syms.patch
	pr25749-test-size.patch
	remove-pr2404-tests.patch
	remove-pr19719-test.patch
	remove-pr19553c-test.patch
	visibility-musl.patch
	vsb-hammer.patch
	x86_64-mark-plt.patch
	x86_64-missing-test.patch
	BTS-170.patch
	BTS-196.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="155f3ba14cd220102f4f29a4f1e5cfee3c48aa03b74603460d05afb73c70d6657a9d87eee6eb88bf13203fe6f31177a5c9addc04384e956e7da8069c8ecd20a6  binutils-2.42.tar.xz
07a9a47c5955a1911cab5387134cfacfff82f5521066bb61f671c7e0d07ce64c31c4162a57234604b470d24f27093cb23202ad05bebc34479957c6fe64dbc8fb  ar-deterministic-tests.patch
3736ea519eab417bc05f9851954e644a4d1b44f4641fb5685ff2238bd2da775f20611edfdcd3a72eb1f2a31ba2a98e3fd97fe9d57714b7d9846553eb881a3435  binutils-ld-fix-static-linking.patch
5eef9c29066f906fc133736efdfb9c94a897f08650bb741dc0ea8b5614563166d2afa9018c045569c853ae7cabe08ef5ec3539eb7b53df55b39b8c659a8c8b72  disable-ifunc-tests.patch
b9f5c09aec2e6423f31fae48a26b8138f65569e63f28dc2190cb73abc2493832cc33362443ec0f24e7833bf2eb0f14ce78045d82fd8ebb4097eafd1f1a34a3fe  disable-mbind2b.patch
086f97e52c536e68b082716d054d32be50b0947cab9c62d87b1959efbf8f99423b6dc52f79da4a6dedc588a577132cb062a071928cd2b85449a107b89c3771de  disable-pr26580-test.patch
6568983766b0b9e947c21fc12f29d41b79a2a0c0c162e0d2c00120713da76bec7b6369333dbdca9d53dd0c81e2cd438c20e30076893742bfb8e14dbc89301c57  disable-preinit-array-tests.patch
4b0089f72c676fadbbcffbd87d2715ca010a4a87392d677b0887b86ce5c2ba446fb45e079bcd4492c47d1479b91b4a2c5b2466746166081e04f4b24191239625  disable-relr-glibc-tests.patch
e8ebb984e9b13b75114c8092d1ad2d0c1b3bb59bf10e66ca250151e79844125a23f74b8c4142210c8e574785c35e0ee1df0499e0cfd6ef59e8e80d58121963e1  disable-sframe-tests.patch
4948b963906a72075873f2988289294f6c1eb60297ac2bdee5d8646ad8a23f8f16d98b3e4f048fb625d347be28028a87247241a8dca030b4847450951b7aca32  libctf-32bit-test.patch
1f22d31b4bc1ed96d9aa1fc49c4328c6516cbb196c0d86db3f68665b948a4950911bb23d53c6f3b82703cddf9380f706355177842f12aa7fc11dd0124feadd3e  musl-preinit-array.patch
ad38c37ae67f60cf3091bf5012dbdaba0982a3e4eac5f3be400d989fb3f7400a4be2db0b8658357ec1e8be71eaddf012e9608ae8540f28fe9fa3af3d87e90fa3  musl-versioned-syms.patch
c76733b76daf5d4af17464777cb753c68063fdc6040d943962c78182ca65f46a2744d4437f6cc3b8ff5f09ff8c0f582690b7dc89eaaf4da48f9300a81b8b3803  pr25749-test-size.patch
c54fa146dd6838c7b55441943b2ca0e344d851615574a46464e253d3f4a9ef3594ef9cf2bc69b584032a8206bf891d0aae62fb38b32873dc60c9d51874ead2ae  remove-pr2404-tests.patch
b4bd7b5d2ad3705c7db0924c73bd91d5f8ef07e73f146c250af7d794387ab219b02254b1b61060a524f2c27c04e14a401e4ce7ed50367f424f8c03874318c2c1  remove-pr19719-test.patch
06f9df891a4ae0e9f6f8b3282d3691ede7cc0f08d63bf722f942f3c94dd4d7f3907b7bb5a8087e63639569e61aed6c39b5f5da7ad6566e7ef278524aa32ada63  remove-pr19553c-test.patch
075565f9bc85c0fc4bd36c7a848f6b876b71fbbe0f572b5c21961687ab4e2cd00c784fba09fe92b214c4b1df871ebd6409e6c93dde5a0a6c1ef6e41a30b24520  visibility-musl.patch
55bdb08f93563449b170ba8623cd7d4409c8f22abb15fca23bc87f23cc43cd580fa149e68271e65fdf2c29ddb0a15cd78d6f0de1a50332fdc026ea1b7d0ec7b8  vsb-hammer.patch
fcd71dc0e664bce0d1066b6adec9b8eebb85eb589061ad7e88934dbda4d5f8849ff6db97299a8026840515e44a73de5e131e3209052be45e807706e79ef8a045  x86_64-mark-plt.patch
f524acb49e7ce14133a11b237858aaadc84f4c3290b6e59335ec293fc6cc0e65c9bdd47c2b68bf75bb3a39ebe2e61df4f7bf941acec69d79968aa68915ade4d5  x86_64-missing-test.patch
c62365110dd0a550e55f1445b197f1f968849b1079439cda0d44778772964779b4ab1142ccc662ba75ebb040e09ef4b4bfc253f4632db24ed783155be2f5f3b1  BTS-170.patch
ab7d0c1fa74862bf9364d5e2228200054a2c5c4351c979dc7a9850f630d74034edffba740b468e009c5419a3cec110322364303f8af28dcdbfbe672c3c16f450  BTS-196.patch
95f2063ecb902148e53603211452ca21d4dec215c32a07c2eebc5881dbdc7cba34a7a49177fedf4db1d7d8542708af673a31930fd7d49a6a2eb00b47dbe6eeb9  fix-deprecated-egrep-usage.patch"