# 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.31.1 - latest stable
# ===============
# Prerequisites:
# Bison
# m4
# flex
# texinfo
# itself (you need as, ranlib, etc. to build this)
# Get it
cd
test -f installed/binutils-2.31.1.tar.bz2 &&
mv installed/binutils-2.31.1.tar.bz2 .
test ! -f binutils-2.31.1.tar.bz2 &&
wget http://ftpmirror.gnu.org/binutils/binutils-2.31.1.tar.bz2
# Verify tarball w/ sha1sum:
# (this came from my gpg-verified tarball)
echo "1c5b0801b4857031d5626d917808cbd5c6401a4b binutils-2.31.1.tar.bz2" | sha1sum -c
# Extract the source
mkdir -p -m 0700 src
cd src
find -maxdepth 1 -type d -name "binutils-*" -exec rm -r {} \;
tar xjvf ~/binutils-2.31.1.tar.bz2
cd binutils-2.31.1
test $UID = 0 && chown -R root:root .
# Verify the extracted files with md5sum, if it outputs nothing, then
# they're all OK:
md5sum -c md5.sum | egrep -v ": OK$"
# Configure the build for 64-bit
test $(uname -m) = 'x86_64' &&
./configure --prefix=/usr --infodir=/usr/info --libdir=/usr/lib64 --mandir=/usr/man --disable-nls
# Configure the build for anything else
test $(uname -m) != 'x86_64' &&
./configure --prefix=/usr --infodir=/usr/info --mandir=/usr/man --disable-nls
# Build
make
# Become root to install it
su
# Remove the Slackware package
test -x /sbin/removepkg && /sbin/removepkg binutils
find /usr/share/locale -type f -name "binutils.mo" -exec rm {} \;
# Copy newly compiled binaries in place so we can use them to install this
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 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 $(logname) .
chmod -R u+rw .
# Become yourself again
exit
# Save the source for later
cd
mkdir -p -m 0700 installed
rm -f installed/binutils-*.tar.*
mv binutils-2.31.1.tar.bz2 installed/
# binutils 2.21.52.0.2 - latest beta
# ====================
## I'll leave this outdated section unchanged for now. No more
## beta versions at ftp.kernel.org, will check out frequency of snapshots
## at sourceware.org vs removing this section in favor of the git
## repository
# 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.
cd
test -f installed/binutils-2.21.52.0.2.tar.bz2 &&
mv installed/binutils-2.21.52.0.2.tar.bz2 .
test ! -f binutils-2.21.52.0.2.tar.bz2 &&
wget http://ftp.kernel.org/pub/linux/devel/binutils/binutils-2.21.52.0.2.tar.bz2
# Verify tarball w/ md5sum:
# (this came from my gpg-verified tarball)
echo "680e4cdfecfa14f5590b994150aa5c7e binutils-2.21.52.0.2.tar.bz2" | md5sum -c
# Verify tarball w/ sha1sum:
# (this also came from my gpg-verified tarball)
echo "db1a4ac65d71cb1bcaa587aa7936ea5445355fac binutils-2.21.52.0.2.tar.bz2" | sha1sum -c
mkdir -p -m 0700 src
cd src
find -maxdepth 1 -type d -name "binutils-*" -exec rm -r {} \;
tar xjvf ~/binutils-2.21.52.0.2.tar.bz2
cd binutils-2.21.52.0.2
test $UID = 0 && chown -R root:root .
# Configure and build it
./configure --prefix=/usr --infodir=/usr/info --mandir=/usr/man --disable-nls
make
# Become root to install it
su
# Remove the Slackware package
test -x /sbin/removepkg && /sbin/removepkg binutils
find /usr/share/locale -type f -name "binutils.mo" -exec rm {} \;
# Copy newly compiled binaries in place so we can use them to install this
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
# Install it
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 .
chmod -R u+rw .