crosstool on sgi-irix with target ia64

Ingo Bremer
Thu Dec 15 18:37:00 GMT 2005


this is my long irix-story:

After fighting for many days to try ...

this sounds similar as in
4.html :-)

first step (like in case of solaris): getting some missing stuff from
this was simple. (ok some trial an error to find out the complete set)

i had to install

the stuff in /usr/freeware/bin should be placed in PATH before standard tools
of same name (make, patch ...) as usual. 

2.: egrep on irix has no -q switch, i changed the one appearance  of "egrep -q"
	in to "egrep -s" (line 170)
after these prerequisites i made a gcc-3.2.3-glibc-2.3.2.dat similar to the 
existing examples
and using the with 

eval `cat ia64.dat gcc-3.2.3-glibc-2.3.2.dat` sh --notest

for the first call. (my target platform is a readhat based sgi-prism with gcc 
3.2.3 and glibc 2.3.2)

the works without problems but the build-process stops several 
and has to be reinvoked after some fixes.

to avoid rebuilding the whole stuff after crashes i have changed the call of
for later calls to

eval `cat ia64.dat gcc-3.2.3-glibc-2.3.2.dat` sh --notest --nounpack

plus commenting out some rm -r statements in

the next problem comes from some incompatibility in the 
which is also use by gcc from the freeware distribution.

one has to define __SGI_NOUCONTEXT_COMPAT at some central place to avoid
problems with register-names.
i made this by putting a #define in several auto-generated gcc/auto-host.h 
after the corresponding error-message.
may be one can handle this by defining CC as "gcc -D..." or using some 
additional flags
to the configure-step for gcc.

a similar problem appears with glibc 
in this case i'm putting the #define to

the sed version on irix has only one namespace .-(. 
sed fails on glibc-2.../intl/po2test.sed because of multiple defined labels.
this is a good target for a patch.

the argument line in the kernel-configuration was to short (0x5000) in the 
case where a lot of .os-es are cat'ed as input to ar.
i'm changing this via systune  to 0x8000

compilation of glibc.../nsswitch.c failed because of undefined LIBNSS_FILES_SO.
the whole build-glibc/gnu/lib-names.h was empty.
the reason was a none working Makeconfig which only works with bash as /bin/sh
one can not aspect that on other systems as linux /bin/sh is bash.
the error causing expression is

if eval test -z "\$${versioned_$${lib}}"; then \

where the argument of test is "evaled" to empty string and this is not 
accepted by /sbin/test.
my quick and dirty changes has the following form
$(common-objpfx)soversions.i: $(common-objpfx)shlib-versions.v
        default_setname='$(filter-out %_default,$(oldest-abi:%=GLIBC_%))'; \
        while read conf version setname; do \
          test -n "$$version" && \
          test `expr '$(config-machine)-$(config-vendor)-$(config-os)' \
                     : "$$conf"` != 0 || continue; \
          if test "x$$version" = xDEFAULT; then \
             default_setname="$$setname"; \
          else \
            $(abi-default_setname) \
            lib=`echo $$version | sed 's/=.*$$//'`; \
            vlib=`eval echo "\$$\{versioned_$${lib}\}"`; \
            vlib=`eval echo $${vlib}`; \
            if test -z "$$vlib" ; then \
                eval versioned_$${lib}=yes; \
                number=`echo $$version | sed "s/^.*=//"`; \
                echo $$lib $$number $${setname:-$${default_setname}};\
            fi; \
          fi; \
        done < $< > $@T; exit 0
        mv -f $@T $@
##        test -n "$$version" && \
##        test `expr '$(config-machine)-$(config-vendor)-$(config-os)' \
##                   : "$$conf"` != 0 || continue; \
##        if test "x$$version" = xDEFAULT; then \
##          default_setname="$$setname"; \
##        else \
##          $(abi-default_setname) \
##          lib=`echo $$version | sed 's/=.*$$//'`; \
##          if eval test -z "\$${versioned_$${lib}}"; then \
##            eval versioned_$${lib}=yes; \
##            number=`echo $$version | sed "s/^.*=//"`; \
##            echo $$lib $$number $${setname:-$${default_setname}}; \
##          fi; \
##        fi; \
##      done < $< > $@T; exit 0
##      mv -f $@T $@

(i'm not a friend of this kind of shell-cryptomania so i dont know, what i'm 
doing here ...)

8. last but not least there was a wrong generated assembler code from 
comparing with the gcc-build on ia64 shows that a macro has the argument 0 
instead of 2 for
the number of arguments.
PSEUDO (__libc_nanosleep, nanosleep, 0)
PSEUDO (__libc_nanosleep, nanosleep, 2)
again sysd-syscalls is generated, so i dont know how to patch it before 
invoking crosstool.
from this experience I'm afraid that there are several other hidden 
but finally crosstool finished its task with a working cross-compiled hello 

has anybody some idea' how to write patches for this configuration?



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

More information about the crossgcc mailing list