This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
problem building glibc-2.3.2 for sparc32
- From: Dan Kegel <dank at kegel dot com>
- To: GNU C Library <libc-alpha at sources dot redhat dot com>
- Date: Sun, 09 May 2004 23:58:31 -0700
- Subject: problem building glibc-2.3.2 for sparc32
Using binutils-2.15.90.0.3, gcc-3.4.0, and glibc-2.3.2,
I have trouble building glibc for sparc32-linux when it
tries to assemble memcpy.S. Anyone run into this before?
Here's a partial log:
sparc-unknown-linux-gnu-gcc ../sysdeps/sparc/sparc32/memcpy.S -c ... -DASSEMBLER -D__ASSEMBLY__ -o .../build-glibc/string/memcpy.o
../sysdeps/sparc/sparc32/memcpy.S: Assembler messages:
../sysdeps/sparc/sparc32/memcpy.S:761: Error: bad expression
../sysdeps/sparc/sparc32/memcpy.S:761: Error: Illegal operands
../sysdeps/sparc/sparc32/memcpy.S:762: Error: bad expression
../sysdeps/sparc/sparc32/memcpy.S:762: Error: Illegal operands
../sysdeps/sparc/sparc32/memcpy.S:763: Error: bad expression
../sysdeps/sparc/sparc32/memcpy.S:763: Error: Illegal operands
../sysdeps/sparc/sparc32/memcpy.S:764: Error: bad expression
../sysdeps/sparc/sparc32/memcpy.S:764: Error: Illegal operands
../sysdeps/sparc/sparc32/memcpy.S:773: Error: bad expression
../sysdeps/sparc/sparc32/memcpy.S:773: Error: Illegal operands
...
../sysdeps/sparc/sparc32/memcpy.S:845: Error: bad expression
../sysdeps/sparc/sparc32/memcpy.S:845: Error: Illegal operands
make[2]: *** [.../crosstool-0.28-rc13/build/sparc-unknown-linux-gnu/gcc-3.4.0-glibc-2.3.2/build-glibc/string/memcpy.o] Error 1
Here are lines 760-765 of glibc-2.3.2/sysdeps/sparc/sparc32/memcpy.S
760 ld [%o0 - 7], %o4
761 4: SMOVE_CHUNK(o1, o0, 0x00, g2, g3, g4, g5, o4, o5, g6, g1, 8, 24, -3)
762 SMOVE_CHUNK(o1, o0, 0x10, g2, g3, g4, g5, o4, o5, g6, g1, 8, 24, -3)
763 SMOVE_CHUNK(o1, o0, 0x20, g2, g3, g4, g5, o4, o5, g6, g1, 8, 24, -3)
764 SMOVE_CHUNK(o1, o0, 0x30, g2, g3, g4, g5, o4, o5, g6, g1, 8, 24, -3)
765 subcc %o3, 64, %o3
where SMOVE_CHUNK was defined above as
#define SMOVE_CHUNK(src, dst, offset, t0, t1, t2, t3, t4, t5, t6, prev, shil, shir, offset2) \
ldd [%src + offset + 0x00], %t0; \
ldd [%src + offset + 0x08], %t2; \
srl %t0, shir, %t5; \
srl %t1, shir, %t6; \
sll %t0, shil, %t0; \
or %t5, %prev, %t5; \
sll %t1, shil, %prev; \
or %t6, %t0, %t0; \
srl %t2, shir, %t1; \
srl %t3, shir, %t6; \
sll %t2, shil, %t2; \
or %t1, %prev, %t1; \
std %t4, [%dst + offset + offset2 - 0x04]; \
std %t0, [%dst + offset + offset2 + 0x04]; \
sll %t3, shil, %prev; \
or %t6, %t2, %t4;
I don't know sparc assembly, so I'm not sure what gas is complaining about.
In case anyone wants to reproduce it, here's how:
wget http://kegel.com/crosstool/crosstool-0.28-rc13.tar.gz
tar -xzvf crosstool-0.28-rc13.tar.gz
cd crosstool-0.28-rc13
sudo mkdir -p /opt/crosstool
sudo chown $USER /opt/crosstool
sh demo-sparc.sh
The patches applied to e.g. glibc-2.3.2 by the above are
documented in crosstool-0.28-rc13/patches/glibc-2.3.2,
and are the minimum needed to build a gcc/glibc toolchain
across all the platforms I'm trying; most are backports
from CVS, or workarounds for gcc issues.
- Dan
--
My technical stuff: http://kegel.com
My politics: see http://www.misleader.org for examples of why I'm for regime change