mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-06-06 18:04:54 +02:00
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=blob_plain;f=binutils/NEWS;hb=refs/heads/binutils-2_44-branch
173 lines
3.8 KiB
Text
173 lines
3.8 KiB
Text
# Contributor: Stefan Wagner <stw@bit-strickerei.de>
|
|
# Maintainer: Marian Buschsieweke <marian.buschsieweke@posteo.net>
|
|
# Based on binutils-avr
|
|
_pkgbase=binutils
|
|
pkgname="$_pkgbase-cross-embedded"
|
|
pkgver=2.44
|
|
pkgrel=0
|
|
pkgdesc="tools necessary to build programs for embedded targets"
|
|
url="https://www.gnu.org/software/binutils/"
|
|
makedepends="gettext libtool autoconf automake bison texinfo zlib-dev zstd-dev"
|
|
arch="all"
|
|
license="GPL-2.0-or-later AND LGPL-2.1-or-later AND BSD-3-Clause"
|
|
source="https://ftp.gnu.org/gnu/$_pkgbase/$_pkgbase-$pkgver.tar.xz"
|
|
builddir="$srcdir/$_pkgbase-$pkgver"
|
|
|
|
# classify targets as exotic or mainstream. Only build support for
|
|
# exotic targets on typical developer / CI hardware (x86_86, aarach64).
|
|
_targets_mainstream="
|
|
arm-none-eabi
|
|
avr
|
|
riscv-none-elf
|
|
"
|
|
|
|
_targets_exotic="
|
|
msp430-elf
|
|
or1k-elf
|
|
aarch64-none-elf
|
|
xtensa-none-elf
|
|
xtensa-esp32-elf
|
|
xtensa-esp32s2-elf
|
|
xtensa-esp32s3-elf
|
|
xtensa-esp8266-elf
|
|
"
|
|
|
|
case "$CARCH" in
|
|
x86_64|aarch64|loongarch64)
|
|
# support all targets on typical workstation / notebook / CI servers
|
|
_targets="$_targets_mainstream $_targets_exotic"
|
|
makedepends="$makedepends xtensa-dynconfig"
|
|
;;
|
|
*)
|
|
# support only mainstream targets on exotic hosts
|
|
_targets="$_targets_mainstream"
|
|
;;
|
|
esac
|
|
|
|
for target in $_targets; do
|
|
case "$target" in
|
|
xtensa-esp*-elf)
|
|
subpackages="$_pkgbase-$target:_install_esp $subpackages"
|
|
;;
|
|
*)
|
|
subpackages="$_pkgbase-$target:_install_subpkg $subpackages"
|
|
;;
|
|
esac
|
|
done
|
|
|
|
# secfixes:
|
|
# 2.37-r0:
|
|
# - CVE-2020-35448
|
|
|
|
build() {
|
|
for target in $_targets; do
|
|
case "$target" in
|
|
xtensa-esp*-elf)
|
|
# no need to build for ESP targets, we will just provide
|
|
# wrappers to xtensa-none-elf with xtensa-dynconfig
|
|
;;
|
|
*)
|
|
local workingdir
|
|
workingdir="$srcdir/build-$target"
|
|
mkdir -p "$workingdir"
|
|
cd "$workingdir"
|
|
"$builddir"/configure \
|
|
--target=$target \
|
|
--with-sysroot=/usr/$target \
|
|
--prefix=/usr/ \
|
|
--libdir=/usr/$target/lib \
|
|
--infodir=/deleteme/info \
|
|
--htmldir=/deleteme/html \
|
|
--pdfdir=/deleteme/pdf \
|
|
--mandir=/deleteme/man \
|
|
--with-gnu-as \
|
|
--with-gnu-ld \
|
|
--enable-deterministic-archieves \
|
|
--enable-interwork \
|
|
--enable-lto \
|
|
--enable-multilib \
|
|
--enable-plugins \
|
|
--enable-ld=default \
|
|
--disable-nls
|
|
make tooldir=/usr
|
|
esac
|
|
done
|
|
}
|
|
|
|
check() {
|
|
for target in $_targets; do
|
|
case "$target" in
|
|
xtensa-esp*-elf)
|
|
# only wrappers, nothing to check
|
|
;;
|
|
*)
|
|
local workingdir
|
|
workingdir="$srcdir/build-$target"
|
|
cd "$workingdir"
|
|
make check
|
|
;;
|
|
esac
|
|
done
|
|
}
|
|
|
|
package() {
|
|
for target in $_targets; do
|
|
depends="$depends $_pkgbase-$target"
|
|
done
|
|
mkdir -p "$pkgdir"
|
|
}
|
|
|
|
_install_subpkg() {
|
|
local target
|
|
target="${subpkgname#"$_pkgbase-"}"
|
|
pkgdesc="Tools necessary to build programs for $target"
|
|
workingdir="$srcdir/build-$target"
|
|
cd "$workingdir"
|
|
make install DESTDIR="$subpkgdir"
|
|
rm -rf "$subpkgdir"/deleteme
|
|
for bin in ar as nm objcopy objdump ranlib strip readelf; do
|
|
rm -f "$subpkgdir"/usr/bin/"$bin"
|
|
done
|
|
}
|
|
|
|
_install_esp() {
|
|
local target
|
|
target="${subpkgname#"$_pkgbase-"}"
|
|
local mcu
|
|
mcu="${target#xtensa-}"
|
|
mcu="${mcu%-elf}"
|
|
pkgdesc="Tools necessary to build programs for $target"
|
|
depends="binutils-xtensa-none-elf=$pkgver-r$pkgrel xtensa-dynconfig-$mcu"
|
|
arch="noarch"
|
|
local cmds
|
|
cmds="
|
|
addr2line
|
|
ar
|
|
as
|
|
c++filt
|
|
elfedit
|
|
gprof
|
|
ld
|
|
ld.bfd
|
|
nm
|
|
objcopy
|
|
objdump
|
|
ranlib
|
|
readelf
|
|
size
|
|
strings
|
|
strip
|
|
"
|
|
mkdir -p "$subpkgdir/usr/bin"
|
|
for cmd in $cmds; do
|
|
cat > "$subpkgdir/usr/bin/$target-$cmd" << EOF
|
|
#!/bin/sh
|
|
exec env XTENSA_GNU_CONFIG=/usr/lib/xtensa-dynconfig/xtensa_$mcu.so xtensa-none-elf-$cmd "\$@"
|
|
EOF
|
|
chmod +x "$subpkgdir/usr/bin/$target-$cmd"
|
|
done
|
|
}
|
|
|
|
sha512sums="
|
|
b85d3bbc0e334cf67a96219d3c7c65fbf3e832b2c98a7417bf131f3645a0307057ec81cd2b29ff2563cec53e3d42f73e2c60cc5708e80d4a730efdcc6ae14ad7 binutils-2.44.tar.xz
|
|
"
|