How can I build a cross compiler for Digital Unix?

Kai Ruottu
Wed Oct 2 03:32:00 GMT 2002

"Ioannis E. Venetis" <> wrote:

> A few days ago I sent a message to the gcc-help mailing list asking how
> to build a cross compiler for an alpha-dec-osf system, but had only one
> answer that didn't help very much. Today I found this list, so I am trying
> my luck here.

 You will need binutils and GCC, and either a prebuilt C-library
with its headers for the OSF-target or C-library sources if the
prebuilt C-library is not available, but the sources are...

I would assume only a prebuilt proprietary C-library being available 
for DEC Unix. However I saw the glibc-sources having some support for
OSF/1 but probably one must start with glibc-1.09.1...

> I am trying to use the SMTSIM simulator, which simulates the Alpha
> processor and adds some extensions to it for multi-threading.
> According to the README of the simulator, it runs on Digital Unix
> and it also accepts Alpha object code generated on such systems.
> My problem is that I have no access to a system with Digital Unix.
> Therefore, I am porting the simulator to another system (Origin
> 2000, R10000 processors, IRIX 6.5) and I am almost done with it. By
> porting I mean that it will run on an Origin 2000 system, but the
> object code it will accept is still Alpha object code. From the
> source code of the simulator I can tell that the object file must
> be in a.out format.

 For curiosity I downloaded these sources and looked at them... It
seems that the 'syscalls.c' has embedded 'asm' instructions for some
CPU, probably for Alpha... So you must have 'ported' the interface
to the syscalls as generic code which should run anywhere and use
the host systems own syscalls, or as Irix-specific code with 
equivalent 'asm' instructions.  Seems to be a big job anyhow...

 The "I have no access to a system with Digital Unix" is a serious
problem if there is no free C-library which supports this target...
Maybe you must do additional porting with glibc-1.09...

 But if SGI has put the Irix libs and headers for free download, why
then not HP-Compaq with Alpha and DEC Unix/OSF... A search with 
Google or digging info about the 'Alphaservers' on the HP/Compaq-site
could tell something...

> Any idea or help on this is greatly appreciated, but of course a
> pointer to a good resource or a step-by-step explanation of what
> I have to do would be even better :-)

 Maybe nobody has written any instructions for just this case...

> Please take into account that it is my first time that I am trying to
> build a cross-compiler and unfortunately I haven't been able to find
> anywhere a well-organized document that describes the whole procedure.

 The "Installation / Cross-Compiler" in the GCC-manual ?

 For the problem with the build crash I cannot say much, the 
'' in the binutils-sources tells:

    # ld works, but does not support shared libraries.
    # newlib is not 64 bit ready.  I'm not sure about fileutils.
    # gas doesn't generate exception information.
    noconfigdirs="$noconfigdirs gas ld fileutils target-newlib \

So it explains why the 'gas' and 'ld' are disabled. It could be
best to introduce this problem in the GNU 'binutils' maillist...

> ./xgcc -B./ -B/usr/local/apps/alpha-dec-osf4/alpha-dec-osf4/bin/
> -isystem /usr/local/apps/alpha-dec-osf4/alpha-dec-osf4/include
> -isystem /usr/local/apps/alpha-dec-osf4/alpha-dec-osf4/sys-include
> -O2  -DIN_GCC -DCROSS_COMPILE   -W -Wall -Wwrite-strings
> -Wstrict-prototypes -Wmissing-prototypes -isystem ./include
> -fPIC -g -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc -c
> -o crtfastmath.o ../../gcc-3.2/gcc/config/alpha/crtfastmath.c
> ../../gcc-3.2/gcc/config/alpha/crtfastmath.c:47: warning:
> no previous prototype for
> `_GLOBAL__I_.._.._gcc_3.2_gcc_config_alpha_crtfastmath.cAdDnfb'
> /tmp/cc5ndBJJ.s: Assembler messages: /tmp/cc5ndBJJ.s:70:
> Fatal error: unhandled relocation type (null)

 The error comes from 'as' and probably has something to do with
the shared library format (compiling with '-fPIC'...), but the
binutils-guys should know better...

 Anyhow the "How to build a cross-GCC for DEC-Alpha/OSF1" could
interest some others too, so if you find out where to find the
C-library stuff for this target without porting glibc for it,
and will get the SMTSIM working on other hosts than only on the
Alphas, please tell it here...

 BTW, as an former VAX/VMS-system manager, I saw it now being
possible to get a simulated VAX and to install NetBSD/VAX there:

-------------------- clip --------------------------------------
This guide is intended to help you install NetBSD on the SIMH VAX 

   1. Get the emulator source code from the SIMH home page.
      Currently, the emulator is in a file called
-------------------- clip --------------------------------------
The '' should tell more... If you
don't get a simulated DEC Alpha, there is always the simulated

 Building a i686-linux-gnu-x-vax-netbsd1.5 cross-GCC should succeed
more easily. The CD-image:

should contain a native GCC for the simulated VAX...

Cheers, Kai

Want more information?  See the CrossGCC FAQ,
Want to unsubscribe? Send a note to

More information about the crossgcc mailing list