I had an earlier discussion with Geoff Levand, he suggested me to post it
here.
While compiling a 64-bit kernel for the playstation 3 I noticed that
arch/powerpc/boot/prpmc2800.c doesn't compile. The assembler complains
about a constant that is too big.
When I compile prpmc2800.c this is what 'make V=1' shows:
gcc -m32 -Wp,-MD,arch/powerpc/boot/.prpmc2800.o.d -Wall
-Wstrict-prototypes -O2 -fomit-frame-pointer -fno-builtin -nostdinc
-isystem /usr/lib/gcc/powerpc64-unknown-linux-gnu/4.1.2/include -fPIC
-fno-stack-protector -Iarch/powerpc/boot
-I/usr/src/ps3-linux/arch/powerpc/boot -c -o arch/powerpc/boot/prpmc2800.o
arch/powerpc/boot/prpmc2800.c
And then this error follows:
/tmp/ccYHAOD7.s: Assembler messages:
/tmp/ccYHAOD7.s:9: Error: operand out of range (0xffffffffffff7fff is not
between 0x0000000000000000 and 0x00000000ffffffff)
I managed to fix this issue as follows: At the end of
arch/powerpc/boot/prpmc2800.c, there is an assembly instruction
rlwinm 10,10,0,~(1<<15)
I replaced this by
rlwinm 10,10,0,~(1<<15) & ((1<<32)-1)
I am running 64-bit gentoo linux with binutils 2.17.50.0.16. It has been
compiled on my ps3 using gentoo ebuild scripts.
After downgrading to binutils 2.17 the problem is gone..
In the binutils bugzilla I couldn't find anything when I searched for
'operand out of range'. It seems like an assembler bug: A 64-bit value is
assumed in a 32 bit instruction, even though the assembler runs in 32 bit
mode because of the -m32. As the value is used in an 'and', the high bits
can safely be ignored.
Could you please either fix binutils or apply the above patch?
Maik
While compiling a 64-bit kernel for the playstation 3 I noticed that
arch/powerpc/boot/prpmc2800.c doesn't compile. The assembler complains
about a constant that is too big.
And then this error follows:
/tmp/ccYHAOD7.s: Assembler messages:
/tmp/ccYHAOD7.s:9: Error: operand out of range (0xffffffffffff7fff is not
between 0x0000000000000000 and 0x00000000ffffffff)
I managed to fix this issue as follows: At the end of
arch/powerpc/boot/prpmc2800.c, there is an assembly instruction
rlwinm 10,10,0,~(1<<15)
I replaced this by
rlwinm 10,10,0,~(1<<15) & ((1<<32)-1)
I am running 64-bit gentoo linux with binutils 2.17.50.0.16. It has been
compiled on my ps3 using gentoo ebuild scripts.
Could you please either fix binutils or apply the above patch?
The trouble is that I have no way to test that change. I don't have the
hardware. Since that file is not for PS3, the best thing to do
is to not build that file when not building for prpmc2800. I will
post a patch that does that.
-Geoff
From: Paul Mackerras <hidden> Date: 2007-06-03 01:51:56
Maik Nijhuis writes:
I managed to fix this issue as follows: At the end of
arch/powerpc/boot/prpmc2800.c, there is an assembly instruction
rlwinm 10,10,0,~(1<<15)
I replaced this by
rlwinm 10,10,0,~(1<<15) & ((1<<32)-1)
It is a binutils bug, and Alan Modra has a patch for it. In the
meantime the best thing would be to change that to
rlwinm 10,10,0,17,15
which is equivalent.
Paul.
From: Mark A. Greer <hidden> Date: 2007-06-03 23:24:47
On Sun, Jun 03, 2007 at 11:51:56AM +1000, Paul Mackerras wrote:
Maik Nijhuis writes:
quoted
I managed to fix this issue as follows: At the end of
arch/powerpc/boot/prpmc2800.c, there is an assembly instruction
rlwinm 10,10,0,~(1<<15)
I replaced this by
rlwinm 10,10,0,~(1<<15) & ((1<<32)-1)
It is a binutils bug, and Alan Modra has a patch for it. In the
meantime the best thing would be to change that to
rlwinm 10,10,0,17,15
which is equivalent.
Oops, I totally missed this thread. I'll whip up a patch for this on Monday.
Mark
It is a binutils bug, and Alan Modra has a patch for it. In the
meantime the best thing would be to change that to
rlwinm 10,10,0,17,15
which is equivalent.
Oops, I totally missed this thread. I'll whip up a patch for this on
Monday.
Unless I'm mistaken, this bug doesn't exist in any released
version of binutils, so no kernel patch should be necessary
(people using a development version of binutils should just
upgrade to the latest, which has this fixed already).
Segher