This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
A recipe to build gcc-2.95.2 on Sequent Dynix-4.4.2
- To: gcc-help at gcc dot gnu dot org
- Subject: A recipe to build gcc-2.95.2 on Sequent Dynix-4.4.2
- From: Andrew Gaylard <andrew dot gaylard at za dot didata dot com>
- Date: Tue, 20 Jun 2000 11:09:28 +0200
Hi all,
Having spent several days getting gcc-2.95.2 to build on
Dynix-4.4.2, I thought I'd share how I got it to work.
This isn't a simple procedure. There's probably a simpler way,
but I can say for sure that this worked for me.
--
Andrew Gaylard
andrew.gaylard @ za . didata . com
-----------------------------------------------------------------
Getting gcc-2.95.2 to build on Sequent Dynix 4.4.2
[ 'root' access is only needed to do the 'make install' parts of
this process. If you want to run this whole procedure as a
non-root user, add "--prefix=/your/home/dir/gnu" (or some
directory to which you have write access) to each ./configure ]
0/
Build and install GNU make:
gzip -dc make-3.78.1.tar.gz | tar xvf -
cd make-3.78.1
./configure ; make ; make install
cd ..
1/
Build and install GNU sed:
gzip -dc sed-3.02.tar.gz | tar xvf -
cd sed-3.02
./configure ; make ; make install
cd ..
2/
Build and install GNU bison:
gzip -dc bison-1.27.tar.gz | tar xvf -
cd bison-1.27
./configure ; make ; make install
cd ..
3/
Build and install GNU flex:
gzip -dc flex-2.5.4a.tar.gz | tar xvf -
cd flex-2.5.4
./configure ; make ; make install
cd ..
4/
Build and install GNU binutils:
gzip -dc binutils-2.9.1.tar.gz
cd binutils-2.9.1
./configure ; make ; make install
cd ..
Rename GNU 'as' since gcc is expecting Sequent's 'as':
mv /usr/local/bin/as /usr/local/bin/gas
mv /usr/local/i386-sequent-sysv4/bin/as \
/usr/local/i386-sequent-sysv4/bin/gas
I tried using Dynix's /bin/ld, but it had problems with "duplicate
symbols" in code generated by g++. GNU ld didn't have this
problem.
5/
Build and install gcc-2.8.1 (I didn't trust Dynix's /bin/cc to
build gcc-2.95.2, but it might be OK):
gzip -dc gcc-2.8.1.tar.gz | tar xvf -
cd gcc-2.8.1
./configure --prefix=/opt/gcc-2.8.1
make bootstrap
make install
cd ..
It is necessary to use a different prefix from /usr/local to be
sure that *this* gcc is used to build gcc-2.95.2.
6/
Extract gcc-2.95.2:
gzip -dc gcc-2.95.2.tar.gz | tar xvf -
7/
Apply this patch for the bug in Dynix-4.4.2's bcopy function; it
can't handle overlapping memory areas. (My thanks to
rfg@monkeys.com for this.)
cat >bcopy-fix.patch <<EOF
diff -c gcc-2.95.2/gcc/cp/class.c gcc-2.95.2/gcc/cp/class.c.orig
*** gcc-2.95.2/gcc/cp/class.c Mon Jun 19 14:37:20 2000
--- gcc-2.95.2/gcc/cp/class.c.orig Sat Aug 7 03:31:51 1999
***************
*** 1226,1233 ****
/* We know the last slot in the vector is empty
because we know that at this point there's room
for a new function. */
! memmove ((PTR) &TREE_VEC_ELT (method_vec, slot + 1),
! (PTR) &TREE_VEC_ELT (method_vec, slot),
(len - slot - 1) * sizeof (tree));
TREE_VEC_ELT (method_vec, slot) = NULL_TREE;
}
--- 1226,1233 ----
/* We know the last slot in the vector is empty
because we know that at this point there's room
for a new function. */
! bcopy ((PTR) &TREE_VEC_ELT (method_vec, slot),
! (PTR) &TREE_VEC_ELT (method_vec, slot + 1),
(len - slot - 1) * sizeof (tree));
TREE_VEC_ELT (method_vec, slot) = NULL_TREE;
}
EOF
Apply this patch to get around the sys_siglist issue. Note that
this ugly hack is my own tweak. A better solution than this has
been introduced into the gcc sources since January 2000, but these
later snapshots refused to build (I tested 20000612 and 20000131);
they both died building with the stage1 compiler with a signal 11.
cat >sys_siglist-fix.patch <<EOF
diff -c gcc-2.95.2/gcc/collect2.c gcc-2.95.2/gcc/collect2.c.orig
*** gcc-2.95.2/gcc/collect2.c Mon Jun 19 14:35:48 2000
--- gcc-2.95.2/gcc/collect2.c.orig Tue Oct 12 23:16:52 1999
***************
*** 355,368 ****
#else
if (s >= 0 && s < NSIG)
{
! /* # ifdef NO_SYS_SIGLIST */
static char buffer[30];
sprintf (buffer, "Unknown signal %d", s);
return buffer;
! /* # else
return sys_siglist[s];
! # endif */
}
else
return NULL;
--- 355,368 ----
#else
if (s >= 0 && s < NSIG)
{
! # ifdef NO_SYS_SIGLIST
static char buffer[30];
sprintf (buffer, "Unknown signal %d", s);
return buffer;
! # else
return sys_siglist[s];
! # endif
}
else
return NULL;
EOF
patch -p0 <bcopy-fix.patch
patch -p0 <sys_siglist-fix.patch
8/
Build and install gcc-2.95.2. First, ensure that the gcc-2.8.1
and ld-2.9.1 are first in your PATH:
PATH=/opt/gcc-2.8.1/bin:/usr/local/bin:$PATH
export PATH
# gcc --version
2.8.1
# ld --version
GNU ld 2.9.1
Copyright 1997 Free Software Foundation, Inc.
This program is free software; you may redistribute it under
the terms of
the GNU General Public License. This program has absolutely no
warranty.
Supported emulations:
elf_i386
Finally, configure, build and install:
cd gcc-2.95.2
mkdir obj-sequent
cd obj-sequent
../configure --with-gnu-ld --enable-languages=c,c++
make bootstrap
make install
cd ..
That's it -- I don't think I've forgotten anything. I hope not.