About | Home | Search


HOWTO: binutils
Description: Various GNU compilers, assemblers, linkers, debuggers, etc.
Click here for ChangeLog
NOTE: I use GNU tar >= 1.13.25 so it's -j for .tar.bz2 files,
it's safe to assume that make, gcc, binutils, fileutils/coreutils, gawk, sed, and grep are prerequisites for almost everything


# binutils
# ========
# Slackware 11.0: binutils 2.15.92.0.2
# Slackware 12.0, 12.1: binutils 2.17.50.0.17
# Slackware 12.2: binutils 2.18.50.0.9

# If you use kernel 2.4.16 or less you should probably use binutils
# 2.11.92.0.10  I no longer have access to anything that old, so I can't
# verify whether or not newer versions work with it.
#
# If you use Slackware 7.1 or less, add "LIBS=-lintl" to the beginning
# of the configure line that you use.

# In the past there have been two slightly different home pages for
# binutils, but as I write this, they're the same:
# http://www.gnu.org/software/binutils/
# http://sources.redhat.com/binutils/

# I pass --disable-nls to configure below because I'm in the US and only
# read/write English (well).  If this is not the case for you, leave that
# off below.


# binutils 2.19.1 - latest stable
# ===============
# Prerequisites:
# itself (you need as, ranlib, etc. to build this)

cd
test -f installed/binutils-2.19.1.tar.bz2 &&
 mv installed/binutils-2.19.1.tar.bz2 .
test ! -f binutils-2.19.1.tar.bz2 &&
 wget http://ftp.gnu.org/gnu/binutils/binutils-2.19.1.tar.bz2

# Verify tarball w/ md5sum:
echo "09a8c5821a2dfdbb20665bc0bd680791  binutils-2.19.1.tar.bz2" | md5sum -c

# Verify tarball w/ sha1sum:
# (this came from my gpg-verified tarball)
echo "88c91e36cde93433e4c4c2b2e3417777aad84526  binutils-2.19.1.tar.bz2" | \
 sha1sum -c

# Verify tarball w/ gpg:
( gpg --recv-keys 4AE55E93 > /dev/null 2>&1 || gpg --verify 4AE55E93 ) &&
 wget -nc http://ftp.gnu.org/gnu/binutils/binutils-2.19.1.tar.bz2.sig &&
  gpg --verify binutils-2.19.1.tar.bz2.sig && rm binutils-2.19.1.tar.bz2.sig

mkdir -p -m 0700 src
cd src
find -maxdepth 1 -type d -name "binutils-*" -exec rm -r {} \;
tar xjvf ~/binutils-2.19.1.tar.bz2
cd binutils-2.19.1
test $UID = 0 && chown -R root:root .
chmod -R u+w .

# Verify the extracted files with md5sum, if it outputs nothing, then
# they're all OK:
md5sum -c md5.sum | egrep -v ": OK$"

./configure --prefix=/usr --disable-nls
make

# Become root to install it
su

test -x /sbin/removepkg && /sbin/removepkg binutils
find /usr/share/locale -type f -name "binutils.mo" -exec rm {} \;
cp binutils/ranlib binutils/strings /usr/bin/
cp gas/as-new /usr/bin/as
cp ld/ld-new /usr/bin/ld
cp binutils/strip-new /usr/bin/strip

# If you'd like to create a binutils package for Slackware with checkinstall,
# follow these instructions instead of running 'make install' below

# If you did not create and install a package
make install

# Make sure everything is owned by your non-root user (or root if you're
# doing this as root) so you'll be able to remove the source directory
# later.
chown -R $USER .

# Become yourself again
exit

cd
mkdir -p -m 0700 installed
rm -f installed/binutils-*.tar.*
mv binutils-2.19.1.tar.bz2 installed/


# binutils 2.19.51.0.2 - latest beta
# ====================
# Use this one with the latest kernels, but remember that it's a beta; you
# may have trouble building/linking/___ing certain things, not likely, but
# definitely possible.

# Check the release notes before installing it:
# release.binutils-2.19.51.0.2

cd
test -f installed/binutils-2.19.51.0.2.tar.bz2 &&
 mv installed/binutils-2.19.51.0.2.tar.bz2 .
test ! -f binutils-2.19.51.0.2.tar.bz2 &&
 wget http://ftp.kernel.org/pub/linux/devel/binutils/\
binutils-2.19.51.0.2.tar.bz2

# Verify tarball w/ md5sum:
# (this came from my gpg-verified tarball)
echo "2b019d9f3c46a5bb775b42ab55f199cc  binutils-2.19.51.0.2.tar.bz2" \
 | md5sum -c

# Verify tarball w/ sha1sum:
# (this also came from my gpg-verified tarball)
echo "2e95ac091dba3fa9e3c4150ca64449fae6a25210  \
binutils-2.19.51.0.2.tar.bz2" | sha1sum -c

# Verify tarball w/ gpg:
( gpg --list-keys 517D0F0E > /dev/null 2>&1 || gpg --recv-keys 517D0F0E ) &&
 wget -nc http://ftp.kernel.org/pub/linux/devel/binutils/\
binutils-2.19.51.0.2.tar.bz2.sign &&
  gpg --verify binutils-2.19.51.0.2.tar.bz2.sign &&
   rm binutils-2.19.51.0.2.tar.bz2.sign

mkdir -p -m 0700 src
cd src
find -maxdepth 1 -type d -name "binutils-*" -exec rm -r {} \;
tar xjvf ~/binutils-2.19.51.0.2.tar.bz2
cd binutils-2.19.51.0.2
test $UID = 0 && chown -R root:root .
chmod -R u+w .
./configure --prefix=/usr --disable-nls
make

# Become root to install it
su

test -x /sbin/removepkg && /sbin/removepkg binutils
find /usr/share/locale -type f -name "binutils.mo" -exec rm {} \;
cp binutils/ranlib binutils/strings /usr/bin/
cp gas/as-new /usr/bin/as
cp ld/ld-new /usr/bin/ld
make install

# Make sure everything is owned by your non-root user (or root if you're
# doing this as root) so you'll be able to remove the source directory
# later.
chown -R $USER .

# Become yourself again
exit

cd
mkdir -p -m 0700 installed
rm -f installed/binutils-*.tar.*
mv binutils-2.19.51.0.2.tar.bz2 installed/

Back to the list


Last updated: Fri, 26 Mar 2010 13:18:56 -0400
Jason Englander <jason at englanders dot us>