# Maintainer: Natanael Copa global pkgname := 'binutils' global pkgver := '2.28' global pkgrel := '2' global pkgdesc := '"Tools necessary to build programs'" global url := '"http://www.gnu.org/software/binutils/'" global depends := ''"" global makedepends_build := '"bison flex texinfo'" global makedepends_host := '"zlib-dev'" global makedepends := ""$makedepends_build $makedepends_host"" global arch := '"all'" global license := '"GPL2 GPL3+ LGPL2 BSD'" global subpackages := ""$pkgname-dev $pkgname-doc $pkgname-libs $pkgname-gold"" global source := ""http://ftp.gnu.org/gnu/$pkgname/$pkgname-$pkgver.tar.bz2 binutils-ld-fix-static-linking.patch hash-style-gnu.patch CVE-2017-7614.patch "" global builddir := ""$srcdir/$pkgname-$pkgver"" if test $CHOST != $CTARGET { global pkgname := ""$pkgname-$CTARGET_ARCH"" global subpackages := ''"" global sonameprefix := ""$pkgname:"" } # secfixes: # 2.28-r1: # - CVE-2017-7614 proc build { var _sysroot = '/' var _cross_configure = '"--enable-install-libiberty'" var _arch_configure = ''"" if test $CHOST != $CTARGET { _sysroot := $CBUILDROOT _cross_configure := '"--disable-install-libiberty'" } if test $CARCH = "x86_64" { _arch_configure := '"--enable-targets=x86_64-pep'" } cd $builddir ./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-gold=yes \ --enable-64-bit-bfd \ --enable-plugins \ --enable-relro \ --enable-deterministic-archives \ $_cross_configure \ $_arch_configure \ --disable-werror \ --disable-nls \ --with-system-zlib \ || return 1 make || return 1 } proc package { cd $builddir make install DESTDIR="$pkgdir" || return 1 if test -d "$pkgdir"/usr/lib64 { mv "$pkgdir"/usr/lib64/* "$pkgdir"/usr/lib/ rmdir "$pkgdir"/usr/lib64 } if test $CHOST != $CTARGET { # 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 } } proc libs { global pkgdesc := '"Runtime libraries from binutils - libbfd and libopcodes'" mkdir -p "$subpkgdir"/usr/lib mv "$pkgdir"/usr/lib/lib*.so "$subpkgdir"/usr/lib/ || return 1 } proc gold { global pkgdesc := '"GNU binutils - gold linker'" if test -e "$pkgdir"/usr/bin/ld.gold { mkdir -p "$subpkgdir"/usr/bin mv "$pkgdir"/usr/bin/ld.gold "$subpkgdir"/usr/bin } mkdir -p "$subpkgdir"/usr/$CTARGET/bin mv "$pkgdir"/usr/$CTARGET/bin/ld.gold "$subpkgdir"/usr/$CTARGET/bin/ld.gold } global sha512sums := '"ede2e4e59a800260eea8c14eafbaee94e30abadafd5c419a3370f9f62213cf027d6400a1d4970b6958bd4d220e675dcd483a708107016e7abd5c99d7392ba8fd binutils-2.28.tar.bz2 ecee33b0e435aa704af1c334e560f201638ff79e199aa11ed78a72f7c9b46f85fbb227af5748e735fd681d1965fcc42ac81b0c8824e540430ce0c706c81e8b49 binutils-ld-fix-static-linking.patch 24e853bf4b58621a77921087e599da2ace47ba3079e2d50fb5d08ae399be5f060c5fdd7f65257bcc0526aebc66e68b98aafd45d714c035da8ea2bdc3d8d4e375 hash-style-gnu.patch 03e2329a216eaaaebc00a2b487a8ffa57657845ea3428f24a1029eabaca2103cb00f39cb4824fe6b70ce9c124e0f850c893746fcf203a6a69288d19df624c60a CVE-2017-7614.patch'" (CommandList children: [ (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:pkgname) op:Equal rhs:{(binutils)} spids:[3])] spids: [3] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:pkgver) op:Equal rhs:{(2.28)} spids:[6])] spids: [6] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:pkgrel) op:Equal rhs:{(2)} spids:[9])] spids: [9] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:pkgdesc) op: Equal rhs: {(DQ ("Tools necessary to build programs"))} spids: [12] ) ] spids: [12] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:url) op: Equal rhs: {(DQ ("http://www.gnu.org/software/binutils/"))} spids: [17] ) ] spids: [17] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:depends) op:Equal rhs:{(DQ )} spids:[22])] spids: [22] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:makedepends_build) op: Equal rhs: {(DQ ("bison flex texinfo"))} spids: [26] ) ] spids: [26] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:makedepends_host) op: Equal rhs: {(DQ (zlib-dev))} spids: [31] ) ] spids: [31] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:makedepends) op: Equal rhs: {(DQ ($ VSub_Name "$makedepends_build") (" ") ($ VSub_Name "$makedepends_host"))} spids: [36] ) ] spids: [36] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:arch) op:Equal rhs:{(DQ (all))} spids:[43])] spids: [43] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:license) op: Equal rhs: {(DQ ("GPL2 GPL3+ LGPL2 BSD"))} spids: [48] ) ] spids: [48] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:subpackages) op: Equal rhs: { (DQ ($ VSub_Name "$pkgname") ("-dev ") ($ VSub_Name "$pkgname") ("-doc ") ($ VSub_Name "$pkgname") ("-libs ") ($ VSub_Name "$pkgname") (-gold) ) } spids: [53] ) ] spids: [53] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:source) op: Equal rhs: { (DQ ("http://ftp.gnu.org/gnu/") ($ VSub_Name "$pkgname") (/) ($ VSub_Name "$pkgname") (-) ($ VSub_Name "$pkgver") (".tar.bz2\n") ("\tbinutils-ld-fix-static-linking.patch\n") ("\thash-style-gnu.patch\n") ("\tCVE-2017-7614.patch\n") ("\t") ) } spids: [65] ) ] spids: [65] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:builddir) op: Equal rhs: {(DQ ($ VSub_Name "$srcdir") (/) ($ VSub_Name "$pkgname") (-) ($ VSub_Name "$pkgver"))} spids: [80] ) ] spids: [80] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(DQ ($ VSub_Name "$CHOST"))} {(KW_Bang "!") (Lit_Other "=")} {(DQ ($ VSub_Name "$CTARGET"))} {(Lit_Other "]")} ) terminator: ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:pkgname) op: Equal rhs: {(DQ ($ VSub_Name "$pkgname") (-) ($ VSub_Name "$CTARGET_ARCH"))} spids: [111] ) ] spids: [111] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:subpackages) op:Equal rhs:{(DQ )} spids:[119])] spids: [119] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:sonameprefix) op: Equal rhs: {(DQ ($ VSub_Name "$pkgname") (":"))} spids: [124] ) ] spids: [124] ) ] spids: [-1 108] ) ] spids: [-1 130] ) (FuncDef name: build body: (BraceGroup children: [ (Assignment keyword: Assign_Local pairs: [(assign_pair lhs:(LhsName name:_sysroot) op:Equal rhs:{(/)} spids:[152])] spids: [150] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:_cross_configure) op: Equal rhs: {(DQ (--enable-install-libiberty))} spids: [158] ) ] spids: [156] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:_arch_configure) op: Equal rhs: {(DQ )} spids: [166] ) ] spids: [164] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(DQ ($ VSub_Name "$CHOST"))} {(KW_Bang "!") (Lit_Other "=")} {(DQ ($ VSub_Name "$CTARGET"))} {(Lit_Other "]")} ) terminator: ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:_sysroot) op: Equal rhs: {(DQ ($ VSub_Name "$CBUILDROOT"))} spids: [193] ) ] spids: [193] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:_cross_configure) op: Equal rhs: {(DQ (--disable-install-libiberty))} spids: [199] ) ] spids: [199] ) ] spids: [-1 190] ) ] spids: [-1 205] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(DQ ($ VSub_Name "$CARCH"))} {(Lit_Other "=")} {(DQ (x86_64))} {(Lit_Other "]")} ) terminator: ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:_arch_configure) op: Equal rhs: {(DQ ("--enable-targets=x86_64-pep"))} spids: [229] ) ] spids: [229] ) ] spids: [-1 226] ) ] spids: [-1 235] ) (C {(cd)} {(DQ ($ VSub_Name "$builddir"))}) (AndOr children: [ (C {(./configure)} {(--build) (Lit_Other "=") ($ VSub_Name "$CBUILD")} {(--host) (Lit_Other "=") ($ VSub_Name "$CHOST")} {(--target) (Lit_Other "=") ($ VSub_Name "$CTARGET")} {(--with-build-sysroot) (Lit_Other "=") (DQ ($ VSub_Name "$CBUILDROOT"))} {(--with-sysroot) (Lit_Other "=") ($ VSub_Name "$_sysroot")} {(--prefix) (Lit_Other "=") (/usr)} {(--mandir) (Lit_Other "=") (/usr/share/man)} {(--infodir) (Lit_Other "=") (/usr/share/info)} {(--disable-multilib)} {(--enable-shared)} {(--enable-ld) (Lit_Other "=") (default)} {(--enable-gold) (Lit_Other "=") (yes)} {(--enable-64-bit-bfd)} {(--enable-plugins)} {(--enable-relro)} {(--enable-deterministic-archives)} {($ VSub_Name "$_cross_configure")} {($ VSub_Name "$_arch_configure")} {(--disable-werror)} {(--disable-nls)} {(--with-system-zlib)} ) (ControlFlow token: arg_word:{(1)}) ] op_id: Op_DPipe ) (AndOr children: [(C {(make)}) (ControlFlow token: arg_word:{(1)})] op_id: Op_DPipe ) ] spids: [147] ) spids: [143 146] ) (FuncDef name: package body: (BraceGroup children: [ (C {(cd)} {(DQ ($ VSub_Name "$builddir"))}) (AndOr children: [ (C {(make)} {(install)} {(Lit_VarLike "DESTDIR=") (DQ ($ VSub_Name "$pkgdir"))}) (ControlFlow token: arg_word:{(1)}) ] op_id: Op_DPipe ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(-d)} {(DQ ($ VSub_Name "$pkgdir")) (/usr/lib64)} {(Lit_Other "]")} ) terminator: ) ] action: [ (C {(mv)} {(DQ ($ VSub_Name "$pkgdir")) (/usr/lib64/) (Lit_Other "*")} {(DQ ($ VSub_Name "$pkgdir")) (/usr/lib/)} ) (C {(rmdir)} {(DQ ($ VSub_Name "$pkgdir")) (/usr/lib64)}) ] spids: [-1 418] ) ] spids: [-1 443] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(DQ ($ VSub_Name "$CHOST"))} {(KW_Bang "!") (Lit_Other "=")} {(DQ ($ VSub_Name "$CTARGET"))} {(Lit_Other "]")} ) terminator: ) ] action: [ (C {(rm)} {(-r)} {(DQ ($ VSub_Name "$pkgdir")) (/usr/share)}) (C {(rm)} {(-f)} {(DQ ($ VSub_Name "$pkgdir")) (/usr/lib/libiberty.a)}) ] spids: [-1 464] ) ] spids: [-1 495] ) ] spids: [378] ) spids: [374 377] ) (FuncDef name: libs body: (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:pkgdesc) op: Equal rhs: {(DQ ("Runtime libraries from binutils - libbfd and libopcodes"))} spids: [507] ) ] spids: [507] ) (C {(mkdir)} {(-p)} {(DQ ($ VSub_Name "$subpkgdir")) (/usr/lib)}) (AndOr children: [ (C {(mv)} {(DQ ($ VSub_Name "$pkgdir")) (/usr/lib/lib) (Lit_Other "*") (.so)} {(DQ ($ VSub_Name "$subpkgdir")) (/usr/lib/)} ) (ControlFlow token: arg_word:{(1)}) ] op_id: Op_DPipe ) ] spids: [504] ) spids: [500 503] ) (FuncDef name: gold body: (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:pkgdesc) op: Equal rhs: {(DQ ("GNU binutils - gold linker"))} spids: [554] ) ] spids: [554] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(-e)} {(DQ ($ VSub_Name "$pkgdir")) (/usr/bin/ld.gold)} {(Lit_Other "]")} ) terminator: ) ] action: [ (C {(mkdir)} {(-p)} {(DQ ($ VSub_Name "$subpkgdir")) (/usr/bin)}) (C {(mv)} {(DQ ($ VSub_Name "$pkgdir")) (/usr/bin/ld.gold)} {(DQ ($ VSub_Name "$subpkgdir")) (/usr/bin)} ) ] spids: [-1 575] ) ] spids: [-1 601] ) (C {(mkdir)} {(-p)} {(DQ ($ VSub_Name "$subpkgdir")) (/usr/) ($ VSub_Name "$CTARGET") (/bin)} ) (C {(mv)} {(DQ ($ VSub_Name "$pkgdir")) (/usr/) ($ VSub_Name "$CTARGET") (/bin/ld.gold)} {(DQ ($ VSub_Name "$subpkgdir")) (/usr/) ($ VSub_Name "$CTARGET") (/bin/ld.gold)} ) ] spids: [551] ) spids: [547 550] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:sha512sums) op: Equal rhs: { (DQ ( "ede2e4e59a800260eea8c14eafbaee94e30abadafd5c419a3370f9f62213cf027d6400a1d4970b6958bd4d220e675dcd483a708107016e7abd5c99d7392ba8fd binutils-2.28.tar.bz2\n" ) ( "ecee33b0e435aa704af1c334e560f201638ff79e199aa11ed78a72f7c9b46f85fbb227af5748e735fd681d1965fcc42ac81b0c8824e540430ce0c706c81e8b49 binutils-ld-fix-static-linking.patch\n" ) ( "24e853bf4b58621a77921087e599da2ace47ba3079e2d50fb5d08ae399be5f060c5fdd7f65257bcc0526aebc66e68b98aafd45d714c035da8ea2bdc3d8d4e375 hash-style-gnu.patch\n" ) ( "03e2329a216eaaaebc00a2b487a8ffa57657845ea3428f24a1029eabaca2103cb00f39cb4824fe6b70ce9c124e0f850c893746fcf203a6a69288d19df624c60a CVE-2017-7614.patch" ) ) } spids: [635] ) ] spids: [635] ) ] )