archeology : Compiling gcc-3.4.6 on sparc sun4m Solaris 2.5.1

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




I simply had to give this a try and maybe even be able to bootstrap gcc
on this old old hardware. Just for fun and because I saw someone else
trying gcc 3.4.6 on a Solaris 9 server.

So firstly, yes, this is very real hardware but of course the old
battery in the SPARCStation 20 prom gave up long ago. So I made the
machine reasonably sane as 08:00:20:c0:ff:ee :)


ganymede# uname -a
SunOS ganymede 5.5.1 Generic_103640-12 sun4m sparc SUNW,SPARCstation-20

ganymede# cat /etc/release
                  Solaris 2.5.1 Hardware 11/97 s596hw3_11 SPARC
           Copyright 1997 Sun Microsystems, Inc.  All Rights Reserved.
                    Manufactured in the USA 04 November 1997
                       Solaris 2.5.1 Maintenance Update 5

ganymede# fpversion
 A SPARC-based CPU is available.
 CPU's clock rate appears to be approximately 198.4 MHz.
 Kernel says CPU's clock rate is 200.0 MHz.
 Kernel says main memory's clock rate is 50.0 MHz.

 Sun-4 floating-point controller version 0 found.
 A Fujitsu/Ross RT620 hyperSPARC chip is available.
 FPU's frequency appears to be approximately 236.4 MHz.

 Use "-xtarget=ss20/hs11 -xcache=512/32/1" code-generation option.

 Hostid = 0x7200BEEF.
ganymede#

I had backup tapes from the dark ages and was able to restore the
Sun WorkShop Compilers :

ganymede$ cc -V
cc: WorkShop Compilers 5.0 98/12/15 C 5.0
usage: cc [ options] files.  Use 'cc -flags' for details
ganymede$

I did try to build a few things and it was all very hit or miss in terms
of what would compile and test clean. For just about anything after
1999 it was the flip of a coin. I don't have stdbool.h or stdint.h and
a lot of stuff wants to be C99 at least. I have yet to try OpenSSL 1.x
which is very C89 but that is another discussion. I am so very happy to
see that ftp into ftp.gnu.org works neatly but I have no gzip. I was also happy to see gzip-1.2.4a works well.

My environment is pretty darn simple and the configure looks promising :

AR=/usr/ccs/bin/ar

AS=/usr/ccs/bin/as

CC=/opt/SUNWspro/bin/cc

EDITOR=/usr/xpg4/bin/vi

LD=/usr/ccs/bin/ld

LD_OPTIONS=-R/usr/local/lib -R/opt/imed/gcc/gcc346/lib -L/usr/local/lib -L/opt/imed/gcc/gcc346/lib

LD_RUN_PATH=/usr/local/lib:/opt/imed/gcc/gcc346/lib

M4=/usr/local/bin/m4

NM=/usr/xpg4/bin/nm -p

PATH=/usr/local/bin:/usr/xpg4/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/ccs/bin:/opt/SUNWspro/bin:/usr/openwin/bin:/usr/dt/bin:/opt/SUNWsunpc/bin:/opt/schily/bin

PERL=/usr/local/bin/perl

POSIXLY_CORRECT=1

SHELL=/bin/ksh

TMPDIR=/var/tmp/dclarke

VISUAL=/usr/xpg4/bin/vi

Yes I was able to build a decent flavour of perl. No problem there.

ganymede$ perl -V | head
Summary of my perl5 (revision 5 version 8 subversion 9) configuration:
  Platform:
    osname=solaris, osvers=2.5.1, archname=sun4-solaris-64int-ld
uname='sunos ganymede 5.5.1 generic_103640-12 sun4m sparc sunw,sparcstation-20 ' config_args='-Dprefix=/usr/local -Dmksymlinks -Accflags=-Xa -g -xO0 -xcode=pic32 -xregs=no%appl -L/usr/local/lib -I/usr/local/include'
    hint=recommended, useposix=true, d_sigaction=define
usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
    useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=define use64bitall=undef uselongdouble=define
    usemymalloc=n, bincompat5005=undef
ganymede$

The configure looks good as it often does :

ganymede$ pwd
/usr/local/build/gcc/gcc-3.4.6_SunOS_5.5.1_sun4m.001
ganymede$ date -u
Sun Jul 17 02:10:45 GMT 2022
ganymede$ ../gcc-3.4.6/configure --prefix=/opt/imed/gcc/gcc346 \
> --build=sparc-sun-solaris2.5.1 --target=sparc-sun-solaris2.5.1 \
> --host=sparc-sun-solaris2.5.1 --without-gnu-as --without-gnu-ld \
> --with-as=/usr/ccs/bin/as --with-ld=/usr/ccs/bin/ld \
> --disable-nls --enable-threads=posix --enable-shared \
> --with-cpu=v8 --enable-bootstrap \
> --enable-stage1-languages=c,c++ \
> --enable-languages=c,c++,fortran
creating cache ./config.cache
checking host system type... sparc-sun-solaris2.5.1
checking target system type... sparc-sun-solaris2.5.1
checking build system type... sparc-sun-solaris2.5.1
checking for a BSD compatible install... ../gcc-3.4.6/install-sh -c
*** This configuration is not supported in the following subdirectories:
target-libf2c target-libffi target-boehm-gc target-zlib target-libjava zlib fastjar target-libobjc
    (Any other directories should still work fine.)
checking for sparc-sun-solaris2.5.1-ar... /usr/ccs/bin/ar
checking for sparc-sun-solaris2.5.1-as... /usr/ccs/bin/as
checking for sparc-sun-solaris2.5.1-dlltool... no
checking for dlltool... dlltool
checking for sparc-sun-solaris2.5.1-ld... /usr/ccs/bin/ld
checking for sparc-sun-solaris2.5.1-nm... /usr/xpg4/bin/nm -p
checking for sparc-sun-solaris2.5.1-ranlib... no
checking for ranlib... ranlib
checking for sparc-sun-solaris2.5.1-windres... no
checking for windres... windres
checking for sparc-sun-solaris2.5.1-objcopy... no
checking for objcopy... objcopy
checking for sparc-sun-solaris2.5.1-objdump... no
checking for objdump... objdump
checking for sparc-sun-solaris2.5.1-ar... no
checking for ar... ar
checking for sparc-sun-solaris2.5.1-as... no
checking for as... as
checking for sparc-sun-solaris2.5.1-dlltool... no
checking for dlltool... dlltool
checking for sparc-sun-solaris2.5.1-ld... no
checking for ld... ld
checking for sparc-sun-solaris2.5.1-nm... no
checking for nm... nm
checking for sparc-sun-solaris2.5.1-ranlib... no
checking for ranlib... ranlib
checking for sparc-sun-solaris2.5.1-windres... no
checking for windres... windres
checking whether to enable maintainer-specific portions of Makefiles... no
updating cache ./config.cache
creating ./config.status
creating Makefile
ganymede$



The compile didn't late long and I may as well post it :

ganymede$ /usr/bin/time -p /usr/xpg4/bin/nice -n +19 make
Configuring in intl
creating cache ./config.cache
checking for non-GNU ld... /usr/ccs/bin/ld
checking if the linker (/usr/ccs/bin/ld) is GNU ld... no
checking how to run the C preprocessor... /opt/SUNWspro/bin/cc -E
checking for inttypes.h... no
checking for stdint.h... no
checking for unsigned long long... yes
checking for shared library run path origin... done
checking whether make sets ${MAKE}... yes
checking for a BSD compatible install... ../../gcc-3.4.6/intl/../install-sh -c
checking whether NLS is requested... no
checking for gcc... /opt/SUNWspro/bin/cc
checking whether the C compiler (/opt/SUNWspro/bin/cc -g ) works... yes
checking whether the C compiler (/opt/SUNWspro/bin/cc -g ) is a cross-compiler... no
checking whether we are using GNU C... no
checking whether /opt/SUNWspro/bin/cc accepts -g... yes
checking host system type... sparc-sun-solaris2.5.1
checking for ranlib... ranlib
checking for strerror in -lcposix... no
checking for ANSI C header files... yes
checking for working const... yes
checking for inline... no
checking for off_t... yes
checking for size_t... yes
checking for working alloca.h... yes
checking for alloca... yes
checking for unistd.h... yes
checking for getpagesize... yes
checking for working mmap... yes
checking whether we are using the GNU C Library 2.1 or newer... no
checking whether integer division by zero raises SIGFPE... yes
checking for inttypes.h... no
checking for msgfmt... no
checking for gmsgfmt... :
checking for xgettext... no
checking for msgmerge... no
checking for argz.h... no
checking for limits.h... yes
checking for locale.h... yes
checking for nl_types.h... yes
checking for malloc.h... yes
checking for stddef.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for unistd.h... (cached) yes
checking for sys/param.h... yes
checking for feof_unlocked... yes
checking for fgets_unlocked... no
checking for getc_unlocked... yes
checking for getcwd... yes
checking for getegid... yes
checking for geteuid... yes
checking for getgid... yes
checking for getuid... yes
checking for mempcpy... no
checking for munmap... yes
checking for putenv... yes
checking for setenv... no
checking for setlocale... yes
checking for stpcpy... no
checking for strcasecmp... yes
checking for strdup... yes
checking for strtoul... yes
checking for tsearch... yes
checking for __argz_count... no
checking for __argz_stringify... no
checking for __argz_next... no
checking for __fsetlocking... no
checking for iconv... yes
checking for iconv declaration...
extern size_t iconv (iconv_t cd, const char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
checking for nl_langinfo and CODESET... yes
checking for LC_MESSAGES... yes
checking for bison... no
checking whether NLS is requested... no
checking whether to use NLS... no
updating cache ./config.cache
creating ./config.status
creating Makefile
creating config.intl
creating config.h
Configuring in gcc
configure: creating cache ./config.cache
checking build system type... sparc-sun-solaris2.5.1
checking host system type... sparc-sun-solaris2.5.1
checking target system type... sparc-sun-solaris2.5.1
checking LIBRARY_PATH variable... ok
checking GCC_EXEC_PREFIX variable... ok
checking whether to place generated files in the source directory... no
checking whether a default linker was specified... yes (/usr/ccs/bin/ld)
checking whether a default assembler was specified... yes (/usr/ccs/bin/as)
checking for sparc-sun-solaris2.5.1-gcc... /opt/SUNWspro/bin/cc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... no
checking whether /opt/SUNWspro/bin/cc accepts -g... yes
checking for /opt/SUNWspro/bin/cc option to accept ANSI C... none needed
checking whether /opt/SUNWspro/bin/cc and cc understand -c and -o together... yes
checking whether /opt/SUNWspro/bin/cc accepts -Wno-long-long... no
checking how to run the C preprocessor... /opt/SUNWspro/bin/cc -E
checking for inline... no
checking for long long int... yes
checking for __int64... no
checking for built-in _Bool... no
checking size of void *... 4
checking size of short... 2
checking size of int... 4
checking size of long... 4
checking size of long long... 8
checking for sparc-sun-solaris2.5.1-gnatbind... no
checking for gnatbind... no
checking whether compiler driver understands Ada... no
checking for egrep... grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... no
checking for stdint.h... no
checking for unistd.h... yes
checking valgrind.h usability... no
checking valgrind.h presence... no
checking for valgrind.h... no
checking whether make sets $(MAKE)... yes
checking for gawk... gawk
checking whether ln works... yes
checking whether ln -s works... yes
checking for sparc-sun-solaris2.5.1-ranlib... ranlib
checking for a BSD compatible install... ../../gcc-3.4.6/gcc/../install-sh -c
checking for cmp's capabilities... fastcompare
checking for mktemp... no
checking for makeinfo... no
configure: WARNING:
*** Makeinfo is missing or too old.
*** Info documentation will not be built.
checking for recent Pod::Man... yes
checking for flex... /bin/sh ../../gcc-3.4.6/gcc/../missing flex
checking for bison... /bin/sh ../../gcc-3.4.6/gcc/../missing bison
checking for GNU C library... no
checking for ANSI C header files... (cached) yes
checking whether time.h and sys/time.h may both be included... yes
checking for working stdbool.h... no
checking whether string.h and strings.h may both be included... yes
checking for sys/wait.h that is POSIX.1 compatible... yes
checking for limits.h... yes
checking for stddef.h... yes
checking for string.h... (cached) yes
checking for strings.h... (cached) yes
checking for stdlib.h... (cached) yes
checking for time.h... yes
checking for fcntl.h... yes
checking for unistd.h... (cached) yes
checking for sys/file.h... yes
checking for sys/time.h... yes
checking for sys/mman.h... yes
checking for sys/resource.h... yes
checking for sys/param.h... yes
checking for sys/times.h... yes
checking for sys/stat.h... (cached) yes
checking for direct.h... no
checking for malloc.h... yes
checking for langinfo.h... yes
checking for ldfcn.h... no
checking for locale.h... yes
checking for wchar.h... yes
checking for thread.h... yes
checking for pthread.h... yes
checking for CHAR_BIT... yes
checking whether byte ordering is bigendian... yes
checking for collect2 libraries... none required
checking for library containing exc_resume... no
checking for library containing ldexp... none required
checking for inttypes.h... no
checking for times... yes
checking for clock... yes
checking for dup2... yes
checking for kill... yes
checking for getrlimit... yes
checking for setrlimit... yes
checking for atoll... yes
checking for atoq... no
checking for sysconf... yes
checking for strsignal... yes
checking for putc_unlocked... yes
checking for fputc_unlocked... no
checking for fputs_unlocked... no
checking for fwrite_unlocked... no
checking for fprintf_unlocked... no
checking for getrusage... yes
checking for nl_langinfo... yes
checking for scandir... no
checking for alphasort... no
checking for gettimeofday... yes
checking for mbstowcs... yes
checking for wcswidth... no
checking for mmap... yes
checking for mincore... yes
checking for setlocale... yes
checking whether mbstowcs works... yes
checking for ssize_t... yes
checking for uid_t in sys/types.h... yes
checking type of array argument to getgroups... gid_t
checking whether the printf functions support %p... yes
checking whether read-only mmap of a plain file works... yes
checking whether mmap from /dev/zero works... yes
checking for MAP_ANON(YMOUS)... no
checking for pid_t... yes
checking for unistd.h... (cached) yes
checking for vfork.h... no
checking for fork... yes
checking for vfork... yes
checking for working fork... yes
checking for working vfork... (cached) yes
checking for iconv.h... yes
checking for iconv... yes
checking for iconv declaration...
extern size_t iconv (iconv_t cd, const char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
checking for LC_MESSAGES... yes
checking whether getenv is declared... yes
checking whether atol is declared... yes
checking whether sbrk is declared... yes
checking whether abort is declared... yes
checking whether atof is declared... yes
checking whether getcwd is declared... yes
checking whether getwd is declared... no
checking whether strsignal is declared... yes
checking whether putc_unlocked is declared... no
checking whether fputs_unlocked is declared... no
checking whether fwrite_unlocked is declared... no
checking whether fprintf_unlocked is declared... no
checking whether strstr is declared... yes
checking whether errno is declared... yes
checking whether snprintf is declared... no
checking whether vasprintf is declared... no
checking whether malloc is declared... yes
checking whether realloc is declared... yes
checking whether calloc is declared... yes
checking whether free is declared... yes
checking whether basename is declared... no
checking whether getopt is declared... yes
checking whether clock is declared... yes
checking whether getrlimit is declared... yes
checking whether setrlimit is declared... yes
checking whether getrusage is declared... no
checking whether ldgetname is declared... no
checking whether times is declared... yes
checking for struct tms... yes
checking for clock_t... yes
checking for uchar...
checking for .preinit_array/.init_array/.fini_array support... no
checking if mkdir takes one argument... no
Using `../../gcc-3.4.6/gcc/config/sparc/sparc.c' for machine-specific logic.
Using `../../gcc-3.4.6/gcc/config/sparc/sparc.md' as machine description file.
Using the following target machine macro files:
        ../../gcc-3.4.6/gcc/config/sparc/sparc.h
        ../../gcc-3.4.6/gcc/config/dbxelf.h
        ../../gcc-3.4.6/gcc/config/elfos.h
        ../../gcc-3.4.6/gcc/config/svr4.h
        ../../gcc-3.4.6/gcc/config/sparc/sysv4.h
        ../../gcc-3.4.6/gcc/config/sol2.h
        ../../gcc-3.4.6/gcc/config/sparc/sol2.h
        ../../gcc-3.4.6/gcc/config/sparc/sol26-sld.h
Using host-solaris.o for host machine hooks.
checking whether NLS is requested... no
checking what assembler to use... /usr/ccs/bin/as
checking what linker to use... /usr/ccs/bin/ld
checking what nm to use... nm
checking what objdump to use... objdump
checking assembler for .balign and .p2align... no
checking assembler for .p2align with maximum skip... no
checking assembler for working .subsection -1... no
checking assembler for .weak... yes
checking assembler for .nsubspa comdat... no
checking assembler for .hidden... no
checking linker for .hidden support... no
checking assembler for .sleb128 and .uleb128... no
checking assembler for eh_frame optimization... no
checking assembler for section merging support... no
checking assembler for thread-local storage support... no
checking assembler for .register... no
checking assembler for -relax option... no
checking assembler for unaligned pcrel relocs... no
checking assembler for offsetable %lo()... no
checking assembler for dwarf2 debug_line support... no
checking assembler for buggy dwarf2 .file directive... no
checking assembler for --gdwarf2 option... no
checking assembler for --gstabs option... no
checking linker read-only and read-write section mixing... unknown
checking linker PT_GNU_EH_FRAME support... no
checking linker position independent executable support... no
checking linker -Bstatic/-Bdynamic option... no
configure: error:
The following requested languages were not found: fortran
The following languages were available: c ada c++ f77 java objc treelang
*** Error code 1
make: Fatal error: Command failed for target `configure-gcc'

ganymede$


So that looks like fun.  Also I do not have flex nor bison as getting
any version to compile has been a real mess. I may need to dig even
further down the layers of strata to find something that can be bison or
flex.

Any thoughts would be wonderful to hear!

--
Dennis Clarke
RISC-V/SPARC/PPC/ARM/CISC
UNIX and Linux spoken
GreyBeard and suspenders optional



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux