152 lines
4.8 KiB
Bash
152 lines
4.8 KiB
Bash
SUMMARY="Assembler, linker and binary tools for ARM microcontrollers"
|
|
DESCRIPTION="The GNU Binutils are a collection of binary tools.
|
|
|
|
The main ones are:
|
|
- ld - the GNU linker.
|
|
- as - the GNU assembler.
|
|
|
|
But they also include:
|
|
- addr2line - converts addresses into filenames and line numbers.
|
|
- ar - a utility for creating, modifying and extracting of archives.
|
|
- c++filt - filter to demangle encoded C++ symbols.
|
|
- nm - lists symbols from object files.
|
|
- objcopy - copys and translates object files.
|
|
- objdump - displays information from object files.
|
|
- ranlib - generates an index to the contents of an archive.
|
|
- readelf - displays information from any ELF format object file.
|
|
- size - lists the section sizes of an object or archive file.
|
|
- strings - lists printable strings from files.
|
|
- strip - discards symbols.
|
|
|
|
The tools of this package can be used for cross-builds to \
|
|
$effectiveTargetMachineTriple."
|
|
HOMEPAGE="http://www.gnu.org/software/binutils"
|
|
COPYRIGHT="1988-2016 Free Software Foundation, Inc."
|
|
LICENSE="GNU GPL v3
|
|
GNU LGPL v3"
|
|
REVISION="5"
|
|
srcGitRev="68e96393c7be88bc0e577404869a07ad3c0b48b3"
|
|
SOURCE_URI="https://github.com/haiku/buildtools/archive/$srcGitRev.tar.gz"
|
|
CHECKSUM_SHA256="95743a550c7e2b561273a1e349a270c659b0c454209de9cd7fc105395fec66fd"
|
|
SOURCE_DIR="buildtools-$srcGitRev/binutils"
|
|
SOURCE_FILENAME="binutils-$portVersion.tar.gz"
|
|
|
|
ARCHITECTURES="?all !x86_gcc2"
|
|
SECONDARY_ARCHITECTURES="x86"
|
|
|
|
targetArch="arm-none-eabi"
|
|
targetU="arm_none_eabi"
|
|
|
|
PROVIDES="
|
|
${targetU}_binutils$secondaryArchSuffix = $portVersion compat >= 2.23
|
|
cmd:${targetU}_addr2line$secondaryArchSuffix = $portVersion compat >= 2.23
|
|
cmd:${targetU}_ar$secondaryArchSuffix = $portVersion compat >= 2.23
|
|
cmd:${targetU}_as$secondaryArchSuffix = $portVersion compat >= 2.23
|
|
cmd:${targetU}_c++filt$secondaryArchSuffix = $portVersion compat >= 2.23
|
|
cmd:${targetU}_elfedit$secondaryArchSuffix = $portVersion compat >= 2.23
|
|
cmd:${targetU}_gprof$secondaryArchSuffix = $portVersion compat >= 2.23
|
|
cmd:${targetU}_ld$secondaryArchSuffix = $portVersion compat >= 2.23
|
|
cmd:${targetU}_ld.bfd$secondaryArchSuffix = $portVersion compat >= 2.23
|
|
cmd:${targetU}_nm$secondaryArchSuffix = $portVersion compat >= 2.23
|
|
cmd:${targetU}_objcopy$secondaryArchSuffix = $portVersion compat >= 2.23
|
|
cmd:${targetU}_objdump$secondaryArchSuffix = $portVersion compat >= 2.23
|
|
cmd:${targetU}_ranlib$secondaryArchSuffix = $portVersion compat >= 2.23
|
|
cmd:${targetU}_readelf$secondaryArchSuffix = $portVersion compat >= 2.23
|
|
cmd:${targetU}_size$secondaryArchSuffix = $portVersion compat >= 2.23
|
|
cmd:${targetU}_strings$secondaryArchSuffix = $portVersion compat >= 2.23
|
|
cmd:${targetU}_strip$secondaryArchSuffix = $portVersion compat >= 2.23
|
|
lib:${targetU}_libbfd_2.26.1$secondaryArchSuffix = $portVersion compat >= 2.23
|
|
lib:${targetU}_libopcodes_2.26.1$secondaryArchSuffix = $portVersion compat >= 2.23
|
|
"
|
|
|
|
REQUIRES="
|
|
haiku$secondaryArchSuffix
|
|
lib:libbfd_2.26.1$secondaryArchSuffix
|
|
lib:libopcodes_2.26.1$secondaryArchSuffix
|
|
"
|
|
BUILD_REQUIRES="
|
|
haiku${secondaryArchSuffix}_devel
|
|
cmd:find
|
|
cmd:xargs
|
|
"
|
|
BUILD_PREREQUIRES="
|
|
cmd:autoconf
|
|
cmd:awk
|
|
cmd:find
|
|
cmd:flex
|
|
cmd:gcc$secondaryArchSuffix
|
|
cmd:ld$secondaryArchSuffix
|
|
cmd:make
|
|
cmd:makeinfo
|
|
cmd:sed
|
|
cmd:strip
|
|
cmd:tar
|
|
cmd:xargs
|
|
"
|
|
|
|
BUILD_PACKAGE_ACTIVATION_PHASE=INSTALL
|
|
|
|
sourceDir=$(pwd)
|
|
relativeInstallDir="develop/tools/${targetArch}"
|
|
installDir="$prefix/$relativeInstallDir"
|
|
objectsDir=$(pwd)/../${portVersionedName}-obj
|
|
|
|
BUILD()
|
|
{
|
|
rm -rf $objectsDir
|
|
|
|
# Touch all *.info files, as newer texinfos don't like their format
|
|
(cd $sourceDir; find . -name \*.info | xargs touch)
|
|
|
|
(cd $sourceDir; find . -name \*.y | sed 's/.y$/.c/g' | xargs touch)
|
|
(cd $sourceDir; find . -name \*.y | sed 's/.y$/.h/g' | xargs touch)
|
|
|
|
mkdir -p $objectsDir
|
|
cd $objectsDir
|
|
|
|
CFLAGS=-O2 CXXFLAGS=-O2 runConfigure "$sourceDir/configure" \
|
|
--exec-prefix=$installDir \
|
|
--includedir=$includeDir/binutils \
|
|
--docdir=$docDir --with-sysroot=$installDir \
|
|
--enable-deterministic-archives --enable-shared=yes \
|
|
--disable-nls --target=${targetArch}
|
|
|
|
make $jobArgs LEXLIB=
|
|
}
|
|
|
|
INSTALL()
|
|
{
|
|
cd $objectsDir
|
|
|
|
make install
|
|
|
|
# no info documentation
|
|
rm -r $infoDir
|
|
|
|
### Strip #################################################
|
|
|
|
echo "Strip debug info"
|
|
|
|
strip --strip-debug $binDir/*
|
|
|
|
### Symlinks ##############################################
|
|
|
|
echo "Creating required symlinks"
|
|
|
|
# There are copies of a subset of the commands below installDir. We
|
|
# overwrite those with symlinks to the ones in binDir.
|
|
for file in $installDir/${targetArch}/bin/*; do
|
|
symlinkRelative -sfn $binDir/${targetArch}-$(basename $file) $file
|
|
done
|
|
|
|
### Cleanup #################################################
|
|
|
|
echo "Cleanup"
|
|
|
|
# delete man pages for commands that we aren't including
|
|
cd $manDir
|
|
for cmd in dlltool nlmconv windmc windres; do
|
|
rm -f man1/$cmd.1
|
|
done
|
|
}
|