Upgrading to egcs-1.0.3/gcc-5.4.44

Upgrading to egcs-1.0.3/gcc-5.4.44

Post by Jon Barne » Tue, 09 Jun 1998 04:00:00

A Mini-guide to Upgrading Linux
By Jon Barnett

These notes detail my attempt to upgrade a Linux system and the major
applications on it.  I hope that they will help others who are contemplating
the same thing.  My primary goal was to upgrade my adapted Fall 1995 Yggdrasil
gcc/Linux-i486 build to an egcs/Linux-i586 build.  It seemed an innocuous goal
at the start - it has almost been an obsession for the last four weeks.

It is not the intention of this posting to supersede or replace the
installation notes that come with packages.  It is certainly not the
definitive guide to solving all problems you may have.  Nevertheless, I hope
someone will find this useful - more than anything, this should point out the
likely problems.

Remember to back everything up.  Also, it is handy to have an Yggdrasil
Plug-And-Play cd, as if things break badly, you can always boot the Yggdrasil
cd, mount your drive(s) and make things 'right'.  After each install, where
shared libraries are added, remember to ldconfig (See Linux ELF HOWTO).  
Wherever possible, after dejagnu is installed, test each package before you
install it.

The first step I took was to compile and install egcs-1.0.2. I had tried
compiling the gcc 2.8.1 but found too many problems with getting some c++
programs compiled.  It was relatively painless to do the egcs compile with my
gcc-  I configured egcs with '--enable-shared' and '--prefix=/usr',
accepting the defaults for everything else.  As per the instructions, create
your objdir directory and 'make bootstrap'.  Ensure that there is no '.', or
trailing/empty ':' in your path.  I didn't 'make check' as I hadn't got the
latest dejagnu installed.  'make install' and 'ldconfig -v' to ensure
everything is properly set.

Next, I built a libc-5.4.44 with the installed egcs (I wasn't brave enough to
do a libc-2 build).  Again, as for a standard Linux install, I set the path
'--prefix=/usr'.  I used the 'old gcc' setting as egcs seems to not have crt*
support in its libraries (I tried configuring libc with the 'new gcc' setting
and once I installed the libraries, everything broke on the Linux box as the
crt* calls could not be resolved).  Build, install and ldconfig.

I rebuilt my Linux-2.0.30 from the source and re-installed.  There were no
dramas here either.

Built and install dejagnu-971222 (from Cygnus) - remember to create a site.exp
in the dejagnu install directory (usually /usr/share/dejagnu) otherwise you
get warnings about the global config file (or the fact it is missing).

Patch gdbm-1.7.3 with the gdbm.patch for elf - I had to hand patch this due to
rejections.  Build as per instructions.

Build and install db-1.85.4 (this doesn't require any patches).  Once
installed, you will need to make a soft link for libdb.so.2 (libdb-1.85.4 is
actually a later release).

Build and install ncurses-4.2 (and ldconfig).

Build and install binutils-  Remember after this to remove encaps
(should be /usr/bin/encaps) as it is no longer needed (and causes grief when
trying to build any more software).

Built/installed gawk-3.0.3.
Built/installed flex-2.5.4.
Built/installed bison-1.25.
Built/installed autoconf-2.12.

Built and installed tcl8.0p2.

Built and installed tk8.02p2 - running the test for this caused some failures
with fonts among other things but nothing serious.

Built and installed perl-5.004.04.  Remember to clean-out the previous
/usr/local/lib/perl5/i486-linux directory (assuming you installed your
previous i486 compiled perl5 in /usr/local/lib).

Built and installed automake-1.3.

I had originally installed inetutils-1.3b but I had failures with the package
logging anything to syslog so I abandoned this.  Instead, I installed the
netkit-0.10 package and the sysklogd-1.3.25 package - if you miss your old
kernel logs, remember to include klogd that comes with package in your boot

Built and installed tar-1.12.
Built and installed procps-1.2.7.
Built and installed yacc-1.9.1 (although this can be omitted - we already have
Built and installed grep-2.2.
Built and installed groff-1.11a.
Built and installed make-3.76.1
Built and installed lilo-20.

Built bind-4.9.6.  To get linking to work you either need to replace -ll with
-lfl or link libl to libfl.  I also had to manually copy named-xfer and ndc.

Built and installed 2.2.0g.

Built and installed XFree86-3.3.2 - modified Xserver/PEX5/dipex/swap/check.c
where the 'lastfp' declaration lines should be replaced by
        'extern INT16 lastfp[MAXCLIENTS]'

Built and installed the socks5_v1_r5 server (only needed if you want a socks

Built and installed sendmail-8.8.5.

Built SSLeay-0.8.1 with the PKCS12 patch 0.2.  The shared library build script
doesn't work with the patch (the PKCS12 part isn't built).  If you are lazy
and don't want to modify the shared library script you can do the following:
1) Modify the Makefile so that you build each object file with the -fPIC
2) ar -x each static library into a separate directory (libssl.a, libcrypto.a)
3) Create the shared libraries from the unpacked object files (e.g. gcc
-shared -W1,-soname,libssl.so.0.8.1 -o libssl.so.0.8.1 *.o)
4) Build ssleay using the shared libraries (should be around 200k in size).
5) Test it; the SSLeay tests should work without any failures
Note: Step 1 isn't strictly necessary.

Built and installed apache-1.2.6 with SSL patch 16.  Linked against the shared
libssl.  I had to modify the link line in the Makefile to link with -ldb
(otherwise if you include the database authentication modules, you may get an
error when trying to link).  Apache SSL works fine with Netscape browsers but
still has problems with MSIE (even with the changes to the program and the
inclusion of the server certificate with the CA certificate) - usually the
html loads ok but the gifs break (or fail to complete downloading); this is
more a protocol thing I think, as I had the same problem with the old Linux
setup - one day I'll get to seriously look at this.

Sudo 1.2 will not compile with bison.  Get cu-sudo-1.5.4, build and install
this - note this is more complex to set up for compiling than Sudo 1.2 -
however, you can have fun with the additional insults.

Built and installed less-3.3.2, compiling against ncurses so there is no
dependency on /etc/termcap.

Built and installed sed-2.05.
Built and installed rcs-5.7.
Built and installed m4-1.4.
Built and installed gzip-1.2.4.
Built and installed diffutils-2.7.
Built and installed patch-2.5.
Built and installed sysvinit-2.74 (sysvinit-2.64 does not compile).
Installed recode-3.4.

Removed /etc/termcap.  You will need to recompile top from procps-1.2.7 and
replace the call to tgetent(NULL,termtype) with setupterm(termtype,1,&err) -
refer to the manpage for more information on setupterm.  Link using -lncurses
instead of -ltermcap.

I had tried shadow-in-a-box but it doesn't want to compile nicely anymore.

Built and installed shadow-971215.  I had to manually copy the libraries to
the lib directory, and login.defs, login.access to /etc.  Remember to set up
login.defs and login.access as required.  I'm used to a secure environment, so
I made sure that you can't login as root from a terminal; only the console
should allow this.  Also remember to restrict access to these configuration

Built qpopper-2.4.  Popauth wouldn't work as there was a problem with gdbm.  I
had to manually insert a -DAUTH in the Makefile, as well as -lmisc and
-lshadow to get a succesful shadow build.

I couldn't compile e2fsck-1.10.  There is a problem with the off_t definition
in fcntl.h.  Instead I installed the prebuilt elf binaries.  No problems yet.

Built and installed ld.so-1.9.8.  I had to modify config.mk to point to the
correct gcc path.  Compiling produced lots of warnings (egcs is more strict
about type checking).  Installation required using the --devfiles --force
arguments for libc5 support.

mount-0.99.6 no longer compiles on the system.  MS_SYNC is no longer declared
(look at linux/fs.h to see the new definitions).  swapon call has too few
arguments - unistd.h declares two arguments for swapon now.

Somewhere along the way I discovered that the files in
/usr/X11R6/lib/X11/config all referred to /lib/cpp.  I made a soft link from
/usr/lib/gcc-lib/i586-pc-linux-gnulibc1/egcs-2.90.29/cpp as this was expedient
(and I'm lazy).

Built and installed mkisofs-1.11.2.
Built and installed elvis-2.0.  Love the smart bolding of keywords in this. :)
Built and installed textutils-1.22.  Has the stuff like cat, tail, split, etc.
Built and installed cron3.0pl1 (vixie cron).  I modified the configuration for
my directory preferences (I'm kind of used to my Solaris system setups, and
making the changes causes me less confusion when trying to locate things).
Built and installed deliver (local mail delivery agent).  Remember to modify
the directory definitions for your system if you use this agent.

Built and installed sh-utils-1.16.  Be careful with the install; there is a su
build contained within.  I discarded this in favour of the su from shadow.  
The target location for the install may not be to your liking either.  I just
moved things as it suited.

Built and installed net-tools-1.33.  The disk 'footprints' are smaller for
utilities which are common to the sh-utils; I'd recommend using the ones from
the net-tools set.  arp.c had an 'uncommented' comment - so just comment it
out.  Install broke for the man page install.

Built and installed postgreSQL-6.3.2 using --with-tcl --with-perl (as we
installed these packages earlier).  As pre-work, you will need to create a
unix account for poastgres.  Remember to set --prefix= to your liking.

Built and installed util-linux-2.7.1.  I did the following after editing the
mconfig file as I didn't want to inadvertently  install the non-shadow stuff:
        cd disk-utils; make install
        cd login-utils; make install-getty
        cd misc-utils; make install
        cd mount; make install
        cd sys-utils; make install
        cd text-utils;make install

itcl2.2p2 requires tk4.2 and tcl7.6 so I didn't install this.

Built and installed cvs-1.9.
Built and installed setserial-2.12_CTI.  I moved setserial from /sbin to /bin.
and had to copy the manpage.

If you have rebooted by now, then you may have discovered that ifconfig from
the net-tools install has caused a modules warning (net-pf-4 and net-pf-5 not
found or something to that effect).  You need to add into your
/etc/modules.conf (or /etc/conf.modules) the following:
        alias net-pf-4 off
        alias net-pf-5 off

The wu-ftpd source won't compile with the new setup.  I haven't had time to go
back and investigate this yet.

Built and installed gdb-4.17.  Note that this builds and installs libiberty.a,
libopcodes.a, libreadline.a and libbfd.a (they replace your existing libraries
from the egcs build).

Built and installed readline-2.2.  I hacked the makefile for the definitions
of SHLIB_OPTS and LD for linux elf.  I also had to hack the shared-library
link lines for the sonames.

Built and installed bash-2.02.

If you are having the console terminal flash whenever you edit something in vi
and hit the end of file or start of file, it will probably be because your
terminal is set to 'linux' (i.e. TERM=linux).  This may be a fault with only
the yggdrasil setup.  Anyway, try setting TERM to vt100 and things should work

Built and installed agrep-2.04.

Built and installed modules-2.0.0.  I did not build this with the new kerneld

I tidied up inittab and rc.halt.  The sysvinit-2.74 example is a good starting
point for modification - I worked from my yggdrasil inittab and copied in
lines as required.  The rc.halt script (the shutdown script) from yggdrasil
refers to shutdown.halt and shutdown.reboot.  With the install of
sysvinit-2.74, you can just change to the halt and reboot programs in the
script.  Remember to remove the shutdown.halt and shutdown.reboot programs
once you have removed reference to these in rc.halt.

I built and installed SSL-MZtelnet-0.11  (SSLtelnet-0.11 also compiles).  The
only problem so far is that:
1) SSLtelnet -z secure daedalus 90 (which connects to the SSL telnet daemon),
doesn't create the connection (which is correct and expected) but after the
error messages, causes the xterm console to print graphics characters instead
of standard ascii (this happens for both variants of SSL telnet) -the vt100
terminal is fine.
2) SSLtelnet -z ssl daedalus 90 causes a segmentation error

I haven't delved into this further, but it will be one of those things I will
get to eventually.

Build and install proftpd-1.0.3pl1.  Compiles with no problems and works well.
You can now get rid of the ftpaccess, ftpconversions and ftpusers files (they
came with the wu-ftpd install) and replace them with your proftpd.conf file.  
I manually copied proftpd to the directory of my choice and renamed it.

I recommend not using fetchmail-4.4.7 if you intend using command line
arguments as this doesn't really work properly.  Try fetchmail-4.4.9.  I've
been running it on the linux box and it quite happily collects things from my
real mailboxes and delivers them locally.  Be careful about using auto
protocol detection.  I have a case where the protocol automatically chosen is
IMAP.  The mail successfully downloads but it leaves a strange tag mail on the
service provider's mail system.  If you ever log into that mailbox yourself,
you will find messages notifying you that the mail was part of the directory
structure and should not be removed.  Just get around this be specifying the

I noticed that the 2.0.30 linux build has some problems with the hard drive
geometry/dma and resets after an irq timeout (the drive works fine after Linux
makes the change).  The Yggdrasil 2.0.20 build had no such problem with the
drive.  Also, manually setting the drive geometry seems to upset Linux-2.0.30
no end - this is one of those times that the bootdisk/Yggdrasil plug-and-play
come in handy ....

A final observation:  egcs produces more correct code, which makes it fussier
too - I had a postgreSQL program I wrote crash where it had previously worked
when compiled with gcc-  The fault was mine - I was referencing an
area of memory that I had previously cleared; but gcc- code was not
affected by this - in fact the program worked as I had wished (but not how I
had written it).  On the other hand, egcs generated code is larger than its
gcc- counterpart.

That finishes my current experience with the upgrades.


1. Kernel and egcs-1.0.3?

        Is it [reasonably] safe to compile Linux-2.0.33 kernel
        with egcs-1.0.3 [and expect it to work]?

        Thanks!  [Please copy me via e-mail.]

2. problems w/win98 & linux

3. Pine 4.44 Privacy Patch

4. Syquest EZ on Solaris ?

5. problem with egcs-1.1.2 / gcc 2.91.66 on Linux (Suse 6.1/6.2)

6. PostScript Printers

7. libc 4.44

8. Help (Kernel Panic)

9. glibc-2.0.3 - Strange problem with gcc

10. Problems with gcc > egcs-1.1.2, dynamic linker segfaults

11. gcc-3.0.3 ready for use?

12. New Solaris Packages: xplanet & pine 4.44

13. System-fault with lib5.4.44