crosstool on sgi-irix with target ia64
Ingo Bremer
bremer@wias-berlin.de
Thu Dec 15 18:37:00 GMT 2005
hi,
this is my long irix-story:
After fighting for many days to try ...
this sounds similar as in http://sources.redhat.com/ml/crossgcc/2005-12/msg0010
4.html :-)
first step (like in case of solaris): getting some missing stuff from
http://freeware.sgi.com/index-by-alpha.html
this was simple. (ok some trial an error to find out the complete set)
i had to install
fw_expat-1.95.6.tardist
fw_gawk-3.1.2.tardist
fw_gcc-3.3.tardist
fw_gettext-0.11.5-sgipl1.tardist
fw_make-3.80.tardist
fw_openssl-0.9.6j.tardist
fw_patch-2.5.4.tardist
fw_tar-1.13.25-sgipl1.tardist
fw_wget-1.8.2.tardist
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 getandpatch.sh 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 demo-ia64.sh with
eval `cat ia64.dat gcc-3.2.3-glibc-2.3.2.dat` sh all.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 getandpatch.sh works without problems but the build-process stops several
times
and has to be reinvoked after some fixes.
3.
to avoid rebuilding the whole stuff after crashes i have changed the call of
all.sh
for later calls to
eval `cat ia64.dat gcc-3.2.3-glibc-2.3.2.dat` sh all.sh --notest --nounpack
plus commenting out some rm -r statements in all.sh
4.
the next problem comes from some incompatibility in the
/usr/include/sys/ucontext.h
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
files,
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
build/ia64-unknown-linux-gnu/gcc-3.2.3-glibc-2.3.2/build-glibc/config.h
5.
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.
6.
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
7.
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
glibc-build/sysd-syscalls
comparing with the gcc-build on ia64 shows that a macro has the argument 0
instead of 2 for
the number of arguments.
wrong:
PSEUDO (__libc_nanosleep, nanosleep, 0)
correct:
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
assembler-mistakes.
but finally crosstool finished its task with a working cross-compiled hello
example.
has anybody some idea' how to write patches for this configuration?
i.b.
------
Want more information? See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com
More information about the crossgcc
mailing list