gcc - GNU compiler collection ChangeLog

HOWTO


# GCC
# ===
# If I specify "GCC", I mean the GNU Compiler Collection as a whole.  If I
# specify "gcc", I mean /usr/bin/gcc.  It's certainly possible that I am
# inconsistent in their use, but not on purpose :-)

# Messing around with important things like GCC is probably a bad idea
# unless you know exactly what you're doing and you also need the
# new version you're trying to install for some feature or optimizations
# or something like that.
#
# If you can not stick to the version of GCC that came with Slackware,
# you may want to check https://packages.slackware.com/
# or SlackBuilds.org

# Keep in mind, GCC is a prerequisite of itself.  You need GCC to compile
# GCC.  If you do not have GCC installed, install the Slackware package
# for your version of Slackware (cat /etc/slackware-version).

# GCC Releases - Latest in each branch, release date, mirror sites, etc.

# As I type this, GCC's supported releases are: 8.1, 7.3, 6.4
# The current development release is 9.0
#
# Due to possible unknown bugs, I would stay away from the development
# release, and maybe even the latest regular supported one if stability
# and build-ability is the top priority on the box you're installing it on.
# ...a client's remote server, etc.  If you do install it, don't be
# surprised if you have to Google looking for patches when you try to build
# various things that have been out for a while.

# Note: do not downgrade GCC unless you either know what to expect or if
# you're insane.  ie. libstdc++.so.5 may be linked to the wrong library
# file (from the higher version of gcc), etc.

# Once GCC is upgraded, a replacement /usr/lib*/libgcc_s.so.? will be
# installed in place of the one listed in /var/adm/packages/*elflibs*
# (elflibs-* < Slackware 10.0, aaa_elflibs-* >= Slackware 10.0).  If you
# want to keep the package files cleaned up, open up that file with a text
# editor and remove that line - not really necessary.

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

# Prerequisites for all releases:
# gzip >= 1.2.4 (if you download it as .tar.gz)
# bzip2 >= 1.0.2 (if you download it as .tar.bz2)
# tar >= 1.14 (the "tar" in gcc-x.x.x.tar.x)


# GCC 7.3 (released January 25, 2018)
# =======
# Once the source is extracted, read INSTALL/prerequisites.html
# (with lynx) for details about which prerequisites are required
# and what they are required for

# Prerequisites:
# An older version of GCC
# C standard library (glibc) and headers
# GNAT (for the Ada compiler)
# The bash shell, or another POSIX-compatible shell
# bison
# GNU awk
# GNU binutils
# GNU make >= 3.8.0
# Perl >= 5.6.1
# GMP >= 4.3.2
# MPFR >= 2.4.2
# MPC >= 0.8.1
# isl >= 0.15 (for Graphite loop optimizations)
# bdwgc/bdw-gc

# Prerequisites - for generated documentation:
# Texinfo >= 4.7 (for makeinfo, 'make dvi', 'make pdf' requires >= 4.8)
# Outdated teTeX or current TeX Live (texi2dvi, texi2pdf - for 'make dvi', 'make pdf')

# Prerequisites - if modifying GCC source:
# autoconf >= 2.64 and m4 >= 1.4.6 (if you need to re-generate configure, ...)
# automake >= 1.11.6 (if modifying Makefile.am)
# gettext >= 0.14.5 (to regenerate gcc.pot)
# gperf >= 2.7.2 (if modifying gperf files)
# DejaGnu 1.4.4, Expect, Tcl (required for test suite)
# autogen >= 5.5.4 and guile >= 1.4.1 (to regenerate some of fixinc/*, for 'make check')
# Flex >= 2.5.4 (if modifying *.l files)
# Sphinx >= 1.0 (if modifying *.rst files)

# GCC 7.3 announcement
# GCC 7 Release Series - release history, changes, docs
# GCC 7.3 manuals

# Get it
cd
test -f installed/gcc-7.3.0.tar.xz && mv installed/gcc-7.3.0.tar.xz .
test ! -f gcc-7.3.0.tar.xz &&
wget https://ftp.gnu.org/gnu/gcc/gcc-7.3.0/gcc-7.3.0.tar.xz

# Verify tarball w/ sha1sum:
# (this came from my gpg-verified tarball)
echo "9689b9cae7b2886fdaa08449a26701f095c04e48  gcc-7.3.0.tar.xz" | \
sha1sum -c

# Verify tarball w/ sha256sum:
# (this also came from my gpg-verified tarball)
echo "832ca6ae04636adbb430e865a1451adf6979ab44ca1c8374f61fba65645ce1\
5c  gcc-7.3.0.tar.xz" | sha256sum -c

# Verify tarball w/ gpg:
( gpg --list-keys FC26A641 > /dev/null 2>&1 || gpg --recv-keys FC26A641 ) &&
wget -nc https://ftp.gnu.org/gnu/gcc/gcc-7.3.0/gcc-7.3.0.tar.xz.sig &&
  gpg --verify gcc-7.3.0.tar.xz.sig && rm gcc-7.3.0.tar.xz.sig

# Extract the source
mkdir -p -m 0700 src
cd src
find -maxdepth 1 -type d -name "gcc-*" -exec rm -r {} \;
tar xJvf ~/gcc-7.3.0.tar.xz
cd gcc-7.3.0
test $UID = 0 && chown -R root:root .

# Verify that the files in the distribution are OK
md5sum -c MD5SUMS | grep -Ev "OK$"

# Read ./README, ./NEWS, ChangeLog if upgrading and read:
# lynx INSTALL/index.html
# GCC 7.3 manuals

# They recommend creating a build directory outside of the source tree
cd ..
mkdir -p objdir-gcc-7.3.0
cd objdir-gcc-7.3.0

# If you've already been in here before
test -f Makefile && make distclean

# Configure the build for 64-bit
test $(uname -m) = 'x86_64' &&
../gcc-7.3.0/configure \
--prefix=/usr \
--infodir=/usr/info \
--libdir=/usr/lib64 \
--mandir=/usr/man \
--enable-shared \
--enable-bootstrap \
--enable-languages=ada,brig,c,c++,fortran,go,lto,objc \
--enable-threads=posix \
--enable-checking=release \
--enable-objc-gc \
--with-system-zlib \
--enable-__cxa_atexit \
--disable-libssp \
--disable-werror \
--with-gnu-ld \
--disable-multilib \
--enable-objc-gc \
--disable-nls

# Configure the build for anything else
# (same as 64-bit minus --libdir and --disable-multilib)
test $(uname -m) != 'x86_64' &&
../gcc-7.3.0/configure \
--prefix=/usr \
--infodir=/usr/info \
--mandir=/usr/man \
--enable-shared \
--enable-bootstrap \
--enable-languages=ada,brig,c,c++,fortran,go,lto,objc \
--enable-threads=posix \
--enable-checking=release \
--enable-objc-gc \
--with-system-zlib \
--enable-__cxa_atexit \
--disable-libssp \
--disable-werror \
--with-gnu-ld \
--enable-objc-gc \
--disable-nls

# Build it
make -j 7 bootstrap

# Check the build (see prerequisites above)
make check

# Become root to install it
su

# DO NOT remove your existing GCC yet.  Run 'make install' first to get the
# new version installed.  Then remove the package for the old GCC.  Then run
# 'make install' again.

# Install it
make install

# Your old gcc should still be there as /usr/bin/gccVERSION
# Programs are in /usr/bin, libraries are in /usr/lib*/, but most of
# the other files are in /usr/libexec/gcc/TARGET/VERSION/, so
# you may still be able to use the old one if need be.
#
# Some things like /usr/bin/cpp, /usr/lib*/libgcc_s.so* have been
# replaced already, because they use the same filename no matter the
# GCC release.
#
# If you don't need them any more, remove the old GCC's Slackware packages
# If it goes badly, you could always reinstall them...
#
test -x /sbin/removepkg &&
/sbin/removepkg egcs egcs_g77 egcsobjc \
gcc gcc-g++ gcc-g77 gcc-gfortran gcc-gnat gcc-go gcc-java gcc-objc \
gcc_g77 gcc_objc

# Parts of the 'make install' process will require libgcc_s.so to be there,
# so put that back to prevent 'make install' #2 from failing
test $(uname -m) = 'x86)_64' &&
cp gcc/libgcc_s.so.1 gcc/libgcc_s.so /usr/lib64/
test $(uname -m) != 'x86)_64' &&
cp gcc/libgcc_s.so.1 gcc/libgcc_s.so /usr/lib/

# If you removed Slackware GCC packages, open up gcc/collect/ld and
# change the path in these lines to their real path (/usr/bin/whatever):
# ORIGINAL_LD_FOR_TARGET
# ORIGINAL_LD_BFD_FOR_TARGET
# ORIGINAL_LD_GOLD_FOR_TARGET
# ORIGINAL_PLUGIN_LD_FOR_TARGET

# Install it again to make sure nothing is missing
# Use 'install-strip' instead to strip binaries and libraries
make install
ldconfig

## If ldconfig gives you a warning like this:
# ldconfig: /usr/lib64/libstdc++.so.6.0.24-gdb.py is not an ELF file - it
# has the wrong magic bytes at the start.
## ...that's fine, but if you want, you can move it where Slackware would
## move it to, and then you will not get the notice any more.
LIBDIR=/usr/lib
test $(uname -m) = 'x86_64' && LIBDIR=/usr/lib64
mv /usr/lib64/libstdc++.so.6.0.24-gdb.py /usr/share/gdb/auto-load/${LIBDIR}/
unset LIBDIR

# Create some common symlinks
# [ Your target may not be x86_64-pc-linux-gnu, adjust as necessary ]
ln -sf /usr/bin/cpp /lib/cpp
( cd /usr/bin
  rm -f cc f77 f95 g95 gcc7.3.0
  ln -sf gcc cc
  ln -sf gfortran f77
  ln -sf gfortran f95
  ln -sf gfortran g95
  ln -sf x86_64-pc-linux-gnu-gcc-7.3.0 gcc7.3.0 )

# If you don't need the build directory any more
cd ..
test -d ./objdir-gcc-7.3.0 && rm -r ./objdir-gcc-7.3.0

# Make sure your non-root user can remove the source later
cd ../gcc-7.3.0
chown -R $(logname) .
chmod -R u+w .

# Become yourself again
exit

# Save the source for later
cd
mkdir -p -m 0700 installed
rm -f installed/gcc-*.tar.*
mv gcc-7.3.0.tar.xz installed/

List of HOWTOs

Web page itself last updated: 2023-12-20 8:06pm (EDT -0400)
HOWTO last updated: 2018-07-26 10:43pm
Copyright © 2001-2024 Jason Englander. All Rights reserved.
[HTML5]