123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174 |
- # Contributor: Márcio Silva <coadde@hyperbola.info>
- # Maintainer: David P. <megver83@parabola.nu>
- # toolchain build order: {kernel}-api-headers->glibc->binutils->gcc->binutils->glibc
- # toolchain (for cross-compiler) build order:
- # {kernel}-api-headers(host system)->glibc(host system)
- # ->binutils(host system)->gcc(host system)->binutils(host system)->glibc(host system)
- # ->binutils(cross)->gcc(cross)
- # ->kernel-api-headers(target system)->glibc(target system)
- # ->binutils(target system)->gcc(target system)->binutils(target system)
- # ->glibc(target system)
- # NOTE: libtool requires rebuilt with each new gcc version
- #--------------------------------------------------------------------------------
- # cross-compile table
- #--------------------------------------------------------------------------------
- # +-------------+-------------+-----------------------------------------------------------------------------------------------------+-----------+---------+
- # | -march | CARCH | CTARGET (_CTARGET) | Multilib | QEMU |
- # +-------------+-------------+-------------+-----------+---------------------------------------------------------------------------+-----------+---------+
- # | _march | CARCH | _arch | <machine> | _os_target (GNU/*) | _multilib | - |
- # +-------------+-------------+-------------+-----------+---------------------------------------------------------------------------+-----------+---------+
- # | x86_64 | x86_64 | x86_64 | unknown | {linux,kfreebsd,kopenbsd,knetbsd,kdragonflybsd,kopensolaris}-gnu|elf | yes | bin/sys |
- # | i[3-7]86 | i[3-7]86 | i[3-7]86 | pc | gnu|{linux,kfreebsd,kopenbsd,knetbsd,kopensolaris}-gnu|elf | no | bin/sys |
- # | armv8-a | aarch64 | aarch64 | unknown | {linux,kfreebsd,knetbsd}-gnu|elf | no | bin/sys |
- # | armv8-a | aarch64_be | aarch64_be | unknown | {linux,kfreebsd,knetbsd}-gnu|elf | no | bin/sys |
- # | armv7-a | armv7h | armv7l | unknown | {linux,kfreebsd,kopenbsd,knetbsd,kopensolaris}-gnueabihf|elf | no | bin/sys |
- # | armv6 | armv6h | armv6l | unknown | {linux,kfreebsd,kopenbsd,knetbsd,kopensolaris}-gnueabihf|elf | no | bin/sys |
- # | armv5te | arm | armv5tel | unknown | {linux,kfreebsd,kopenbsd,knetbsd,kopensolaris}-gnueabi | no | bin/sys |
- # | * | arm | arm | unknown | eabi | no | bin/sys |
- # | arm | armeb | armeb | unknown | {linux,kfreebsd,kopenbsd,knetbsd}-gnueabi|eabi | no | bin |
- # | mips64el | mips64el | mips64el | unknown | {linux,kfreebsd,kopenbsd,knetbsd}-gnu|elf | no | bin/sys |
- # | mips64 | mips64 | mips64 | unknown | {linux,kfreebsd,kopenbsd,knetbsd}-gnu|elf | no | bin/sys |
- # | * | mipsel | mipsel | unknown | {linux,kfreebsd,kopenbsd,knetbsd}-gnu|elf | no | bin/sys |
- # | * | mips | mips | unknown | {linux,kfreebsd,kopenbsd,knetbsd}-gnu|elf | no | bin/sys |
- #v| powerpc64 | powerpc64 | powerpc64 | unknown | {linux,kfreebsd,kopenbsd,knetbsd}-gnu{,eabi}|{elf,eabi} | no | bin/sys |x|eabi
- #x| powerpc64le | powerpc64le | powerpc64le | unknown | {linux,kfreebsd,kopenbsd,knetbsd}-gnu{,eabi}|{elf,eabi} | no | bin |
- # | powerpc | powerpc | powerpc | unknown | {linux,kfreebsd,kopenbsd,knetbsd}-gnu{,eabi}|{elf,eabi} | no | bin/sys |
- # | powerpcle | powerpcle | powerpcle | unknown | {linux,kfreebsd,kopenbsd,knetbsd}-gnu{,eabi}|{elf,eabi} | no | - |
- # | - | spu | spu | unknown | elf | no | - |
- # | - | sh64 | sh64 | unknown | {linux,kopenbsd,knetbsd}-gnu|elf | no | - |
- # | - | sh64le | sh64le | unknown | {linux,kopenbsd,knetbsd}-gnu|elf | no | - |
- # | - | sh4 | sh4 | unknown | {linux,kopenbsd,knetbsd}-gnu|elf | no | bin/sys |
- # | - | sh4le | sh4le | unknown | {linux,kopenbsd,knetbsd}-gnu|elf | no | bin/sys |
- # | - | sh | sh | unknown | {linux,kopenbsd,knetbsd}-gnu|elf | no | - @ |
- # | - | shle | shle | unknown | {linux,kopenbsd,knetbsd}-gnu|elf | no | - @ |
- # | - | m68k | m68k | unknown | gnu|{linux,knetbsd}-gnu|elf | no | bin/sys |
- # | - | avr | avr | unknown | linux-gnu|elf | no | - |
- # | - | xtensa | xtensa | unknown | linux-gnu|elf | no | sys |
- # | - | lm32 | lm32 | unknown | linux-gnu|elf | no | sys |
- # | - | or32 | or32 | unknown | linux-gnu|elf | no | bin/sys |x|linux-gnu
- # +-------------+-------------+-------------+-----------+---------------------------------------------------------------------------+-----------+---------+
- # For "Wine, Darling and DOSBox"
- # +-------------+-------------+-------------+-----------+---------------------------------------------------------------------------+-----------+---------+
- # | x86_64 | x86_64 | x86_64 | unknown | mingw64(Wine)|darwin | yes | bin/sys |
- # | i[3-7]86 | i[3-7]86 | i[3-7]86 | pc | mingw32(Wine)|msdosdjgpp(DOSBox)|darwin | no | bin/sys |
- # | armv7-a | armv7h | armv7l | unknown | mingw-arm(Wine)|darwin | no | bin/sys |
- # | powerpc | powerpc | powerpc | unknown | darwin | no | bin/sys |
- # +-------------+-------------+-------------+-----------+---------------------------------------------------------------------------+-----------+---------+
- # opt : Multilib is optional
- # * : Any supported by architecture.
- # - : None.
- # @ : bin/sys (Only sh4 and sh4l support)
- # < : experimental support. (future)
- #--------------------------------------------------------------------------------
- # Choosing the correct pkgdesc
- #--------------------------------------------------------------------------------
- # You must know wether your toolchain is a bare-metal one, if it's specifically for big-endian or
- # little-endian order and know its full name, if possible. Here are some useful tips:
- #
- # * If the toolchain has no operating system (see the toolchain triplet, <_os_target>), then it's a
- # bare-metal toolchain, in which case you have to specify it in the pkgdesc
- #
- # * Do a bit of research in forums, wikis and documents about the target you plan to build, a good
- # idea is to see the description that other distros put (e.g. Debian) if they have the same toolchain
- #
- # Example: arm-linux-gnueabi-{gcc,binutils,$etc}
- # This toolchain has GNU/Linux as OS, so it's not a bare-metal one. It's for armel, which
- # stands for "ARM EABI little-endian", but the gnueabi part means it uses the GNU EABI. You can find
- # that info in Debian's gcc-arm-linux-gnueabi and a couple of FLOSS and programmers community forums.
- # Toolchain triplet: <_arch>-<machine>-<_os_target>
- # <machine> is generally optional and uneeded
- _target=x86_64-pc-linux-gnu
- # This are some options for names. Change $_target_name in pkgdesc according to the target architecture
- case ${_target%%-*} in
- arm*) _target_name=ARM
- ;;
- aarch64*) _target_name=ARM64
- ;;
- xtensa) _target_name=Xtensa
- ;;
- sh*) _target_name=SuperH
- ;;
- powerpc*) _target_name=PowerPC
- ;;
- riscv*) _target_name=RISC-V
- ;;
- mips*) _target_name=MIPS
- ;;
- i686) _target_name=x86
- ;;
- *) _target_name=${_target%%-*}
- ;;
- esac
- pkgname=$_target-binutils
- pkgver=2.34
- pkgrel=1
- pkgdesc="A set of programs to assemble and manipulate binary and object files for the $_target_name target"
- arch=('i686' 'x86_64' 'armv7h' 'aarch64' 'mips64el')
- url='https://www.gnu.org/software/binutils/'
- license=(GPL)
- depends=(zlib)
- source=(https://ftp.gnu.org/gnu/binutils/binutils-$pkgver.tar.bz2{,.sig})
- sha512sums=('f47e7304e102c7bbc97958a08093e27796b9051d1567ce4fbb723d39ef3e29efa325ee14a1bdcc462a925a7f9bbbc9aee28294c6dc23850f371030f3835a8067'
- 'SKIP')
- validpgpkeys=('EAF1C276A747E9ED86210CBAC3126D3B4AE55E93' # Tristan Gingold <gingold@adacore.com>
- '3A24BC1E8FB409FA9F14371813FCEF89DD9E3C4F') # Nick Clifton (Chief Binutils Maintainer) <nickc@redhat.com>
- prepare() {
- cd binutils-$pkgver
- sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" libiberty/configure
- }
- build() {
- cd binutils-$pkgver
- if [ "${CARCH}" != "i686" ]; then
- # enabling gold linker at i686 makes the install fail
- enable_gold='--enable-gold'
- fi
- ./configure --target=$_target \
- --with-sysroot=/usr/$_target \
- --prefix=/usr \
- --disable-multilib \
- --with-gnu-as \
- --with-gnu-ld \
- --disable-nls \
- --enable-ld=default \
- $enable_gold \
- --enable-plugins \
- --enable-deterministic-archives
- make
- }
- check() {
- cd binutils-$pkgver
-
- # unset LDFLAGS as testsuite makes assumptions about which ones are active
- # do not abort on errors - manually check log files
- make LDFLAGS="" -k check || true
- }
- package() {
- cd binutils-$pkgver
- make DESTDIR="$pkgdir" install
- # Remove file conflicting with host binutils and manpages for MS Windows tools
- rm "$pkgdir"/usr/share/man/man1/$_target-{dlltool,windres,windmc}*
- # Remove info documents that conflict with host version
- rm -r "$pkgdir"/usr/share/info
- }
|