Skip to contentSkip to conversation

440 ebony patch seems to have broken 85xx build on powerpc.git

DISCUSSION Dave Jiang 8 participants 19 messages May 24, 2007 – May 25, 2007

lore
Share & tools
lore

Dave Jiang

author
#0 lore raw

Has anyone been able to build mpc85xx_* from the latest powerpc.git? I have tried mpc85xx_cds and mpc8560_ads. I pulled a new git tree and attempted to build and hit the error message below.

Also, if I comment out the two lines in arch/powerpc/boot/Makefile that was introduced by the 440 Ebony support patch everything is fine.

$(obj)/44x.o: BOOTCFLAGS += -Wa,-mbooke
$(obj)/ebony.o: BOOTCFLAGS += -Wa,-mbooke

make -f
/home/djiang/community/git-repos/tmp/ppc-master/scripts/Makefile.modpost vmlinux
scripts/mod/modpost -o
/home/djiang/community/git-repos/tmp/ppc-master/Module.symvers arch/powerpc/kernel/head_fsl_booke.o init/built-in.o usr/built-in.o arch/powerpc/kernel/built-in.o arch/powerpc/mm/built-in.o arch/powerpc/lib/built-in.o arch/powerpc/sysdev/built-in.o arch/powerpc/platforms/built-in.o arch/powerpc/math-emu/built-in.o kernel/built-in.o mm/built-in.o fs/built-in.o ipc/built-in.o security/built-in.o crypto/built-in.o block/built-in.o lib/lib.a lib/built-in.o drivers/built-in.o sound/built-in.o net/built-in.o
WARNING: arch/powerpc/mm/built-in.o(.text+0x10bc): Section mismatch: reference to .init.text:early_get_page (between 'pte_alloc_one_kernel' and 'steal_context') rm -f .old_version
make ARCH=ppc64 -f scripts/Makefile.build obj=arch/powerpc/boot arch/powerpc/boot/uImage
/opt/montavista/cge/devkit/ppc/85xx/bin/ppc_85xx-gcc -m32
-Wp,-MD,arch/powerpc/boot/.ebony.o.d -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -fno-builtin -nostdinc -isystem /opt/montavista/cge/devkit/ppc/85xx/bin/../lib/gcc/powerpc-montavista-linux-gnuspe/4.2.0/include -fPIC -fno-stack-protector -Iarch/powerpc/boot -I/home/djiang/community/git-repos/tmp/ppc-master/arch/powerpc/boot -Wa,-mbooke -c -o arch/powerpc/boot/ebony.o arch/powerpc/boot/ebony.c /home/djiang/tmp/cc2UVyci.s: Assembler messages:
/home/djiang/tmp/cc2UVyci.s:142: Error: Unrecognized opcode: `isel'
make[1]: *** [arch/powerpc/boot/ebony.o] Error 1

Signature · 6 lines
------------------------------------------------------
Dave Jiang
Software Engineer
MontaVista Software, Inc.
http://www.mvista.com
------------------------------------------------------
#1 lore raw
Quoted 9 lines · Dave Jiang

Has anyone been able to build mpc85xx_* from the latest powerpc.git? I have tried mpc85xx_cds and mpc8560_ads. I pulled a new git tree and attempted to build and hit the error message below.

Also, if I comment out the two lines in arch/powerpc/boot/Makefile that was introduced by the 440 Ebony support patch everything is fine.

$(obj)/44x.o: BOOTCFLAGS += -Wa,-mbooke
$(obj)/ebony.o: BOOTCFLAGS += -Wa,-mbooke

Without those, other toolchains will break on those files because they don't understand mtdcr/mfdcr by default.

Quoted 23 lines

make -f /home/djiang/community/git-repos/tmp/ppc-master/scripts/Makefile.modpost vmlinux
scripts/mod/modpost -o
/home/djiang/community/git-repos/tmp/ppc-master/Module.symvers arch/powerpc/kernel/head_fsl_booke.o init/built-in.o usr/built-in.o arch/powerpc/kernel/built-in.o arch/powerpc/mm/built-in.o arch/powerpc/lib/built-in.o arch/powerpc/sysdev/built-in.o arch/powerpc/platforms/built-in.o arch/powerpc/math-emu/built-in.o kernel/built-in.o mm/built-in.o fs/built-in.o ipc/built-in.o security/built-in.o crypto/built-in.o block/built-in.o lib/lib.a lib/built-in.o drivers/built-in.o sound/built-in.o net/built-in.o
WARNING: arch/powerpc/mm/built-in.o(.text+0x10bc): Section mismatch: reference to .init.text:early_get_page (between 'pte_alloc_one_kernel' and 'steal_context') rm -f .old_version
make ARCH=ppc64 -f scripts/Makefile.build obj=arch/powerpc/boot arch/powerpc/boot/uImage
/opt/montavista/cge/devkit/ppc/85xx/bin/ppc_85xx-gcc -m32

(quoted diff) +0 -2
-Wp,-MD,arch/powerpc/boot/.ebony.o.d -Wall -Wstrict-prototypes -O2
-fomit-frame-pointer -fno-builtin -nostdinc -isystem

/opt/montavista/cge/devkit/ppc/85xx/bin/../lib/gcc/powerpc-montavista-linux-gnuspe/4.2.0/include

(quoted diff) +0 -3
-fPIC -fno-stack-protector -Iarch/powerpc/boot
-I/home/djiang/community/git-repos/tmp/ppc-master/arch/powerpc/boot -Wa,-mbooke
-c -o arch/powerpc/boot/ebony.o arch/powerpc/boot/ebony.c
Quoted 2 lines

/home/djiang/tmp/cc2UVyci.s: Assembler messages:
/home/djiang/tmp/cc2UVyci.s:142: Error: Unrecognized opcode: `isel'

What versions of binutils, and gcc are you using?

It seems we're going to have to start doing conditional per-file CFLAGS or something else if we continue to compile all the platform files in the bootwrapper. I'm not too thrilled with that.

josh

author
#2 lore raw
Quoted 10 lines · Josh Boyer
Quoted 6 lines · Dave Jiang

/opt/montavista/cge/devkit/ppc/85xx/bin/../lib/gcc/powerpc-montavista-linux-gnuspe/4.2.0/include

(quoted diff) +0 -3
-fPIC -fno-stack-protector -Iarch/powerpc/boot
-I/home/djiang/community/git-repos/tmp/ppc-master/arch/powerpc/boot -Wa,-mbooke
-c -o arch/powerpc/boot/ebony.o arch/powerpc/boot/ebony.c

/home/djiang/tmp/cc2UVyci.s: Assembler messages:
/home/djiang/tmp/cc2UVyci.s:142: Error: Unrecognized opcode: `isel'

What versions of binutils, and gcc are you using?

Quoted 5 lines

It seems we're going to have to start doing conditional per-file CFLAGS or something else if we continue to compile all the platform files in the bootwrapper. I'm not too thrilled with that.

josh

gcc 4.2.0
binutils 2.17.50

Signature · 6 lines
------------------------------------------------------
Dave Jiang
Software Engineer
MontaVista Software, Inc.
http://www.mvista.com
------------------------------------------------------
#3 lore raw
In reply to Dave Jiang
Quoted 33 lines · Dave Jiang

Has anyone been able to build mpc85xx_* from the latest powerpc.git? I have tried mpc85xx_cds and mpc8560_ads. I pulled a new git tree and attempted to build and hit the error message below.

Also, if I comment out the two lines in arch/powerpc/boot/Makefile that was introduced by the 440 Ebony support patch everything is fine.

$(obj)/44x.o: BOOTCFLAGS += -Wa,-mbooke
$(obj)/ebony.o: BOOTCFLAGS += -Wa,-mbooke

make -f /home/djiang/community/git-repos/tmp/ppc-master/scripts/Makefile.modpost vmlinux
scripts/mod/modpost -o
/home/djiang/community/git-repos/tmp/ppc-master/Module.symvers arch/powerpc/kernel/head_fsl_booke.o init/built-in.o usr/built-in.o arch/powerpc/kernel/built-in.o arch/powerpc/mm/built-in.o arch/powerpc/lib/built-in.o arch/powerpc/sysdev/built-in.o arch/powerpc/platforms/built-in.o arch/powerpc/math-emu/built-in.o kernel/built-in.o mm/built-in.o fs/built-in.o ipc/built-in.o security/built-in.o crypto/built-in.o block/built-in.o lib/lib.a lib/built-in.o drivers/built-in.o sound/built-in.o net/built-in.o
WARNING: arch/powerpc/mm/built-in.o(.text+0x10bc): Section mismatch: reference to .init.text:early_get_page (between 'pte_alloc_one_kernel' and 'steal_context') rm -f .old_version
make ARCH=ppc64 -f scripts/Makefile.build obj=arch/powerpc/boot arch/powerpc/boot/uImage
/opt/montavista/cge/devkit/ppc/85xx/bin/ppc_85xx-gcc -m32

(quoted diff) +0 -2
-Wp,-MD,arch/powerpc/boot/.ebony.o.d -Wall -Wstrict-prototypes -O2
-fomit-frame-pointer -fno-builtin -nostdinc -isystem

/opt/montavista/cge/devkit/ppc/85xx/bin/../lib/gcc/powerpc-montavista-linux-gnuspe/4.2.0/include

(quoted diff) +0 -3
-fPIC -fno-stack-protector -Iarch/powerpc/boot
-I/home/djiang/community/git-repos/tmp/ppc-master/arch/powerpc/boot -Wa,-mbooke
-c -o arch/powerpc/boot/ebony.o arch/powerpc/boot/ebony.c
Quoted 3 lines

/home/djiang/tmp/cc2UVyci.s: Assembler messages:
/home/djiang/tmp/cc2UVyci.s:142: Error: Unrecognized opcode: `isel' make[1]: *** [arch/powerpc/boot/ebony.o] Error 1

I wonder WTF ebony.c gets built for MPC85xx targets? :-O

WBR, Sergei

#4 lore raw
Quoted 32 lines · Sergei Shtylyov
Quoted 30 lines · Dave Jiang

Has anyone been able to build mpc85xx_* from the latest powerpc.git? I have tried mpc85xx_cds and mpc8560_ads. I pulled a new git tree and attempted to build and hit the error message below.

Also, if I comment out the two lines in arch/powerpc/boot/Makefile that was introduced by the 440 Ebony support patch everything is fine.

$(obj)/44x.o: BOOTCFLAGS += -Wa,-mbooke
$(obj)/ebony.o: BOOTCFLAGS += -Wa,-mbooke

make -f /home/djiang/community/git-repos/tmp/ppc-master/scripts/Makefile.modpost vmlinux
scripts/mod/modpost -o
/home/djiang/community/git-repos/tmp/ppc-master/Module.symvers arch/powerpc/kernel/head_fsl_booke.o init/built-in.o usr/built-in.o arch/powerpc/kernel/built-in.o arch/powerpc/mm/built-in.o arch/powerpc/lib/built-in.o arch/powerpc/sysdev/built-in.o arch/powerpc/platforms/built-in.o arch/powerpc/math-emu/built-in.o kernel/built-in.o mm/built-in.o fs/built-in.o ipc/built-in.o security/built-in.o crypto/built-in.o block/built-in.o lib/lib.a lib/built-in.o drivers/built-in.o sound/built-in.o net/built-in.o
WARNING: arch/powerpc/mm/built-in.o(.text+0x10bc): Section mismatch: reference to .init.text:early_get_page (between 'pte_alloc_one_kernel' and 'steal_context') rm -f .old_version
make ARCH=ppc64 -f scripts/Makefile.build obj=arch/powerpc/boot arch/powerpc/boot/uImage
/opt/montavista/cge/devkit/ppc/85xx/bin/ppc_85xx-gcc -m32

(quoted diff) +0 -2
-Wp,-MD,arch/powerpc/boot/.ebony.o.d -Wall -Wstrict-prototypes -O2
-fomit-frame-pointer -fno-builtin -nostdinc -isystem

/opt/montavista/cge/devkit/ppc/85xx/bin/../lib/gcc/powerpc-montavista-linux-gnuspe/4.2.0/include

Quoted 8 lines
Quoted 6 lines
(quoted diff) +0 -3
-fPIC -fno-stack-protector -Iarch/powerpc/boot
-I/home/djiang/community/git-repos/tmp/ppc-master/arch/powerpc/boot -Wa,-mbooke
-c -o arch/powerpc/boot/ebony.o arch/powerpc/boot/ebony.c

/home/djiang/tmp/cc2UVyci.s: Assembler messages:
/home/djiang/tmp/cc2UVyci.s:142: Error: Unrecognized opcode: `isel' make[1]: *** [arch/powerpc/boot/ebony.o] Error 1

I wonder WTF ebony.c gets built for MPC85xx targets? :-O

Because it's part of the bootwrapper and all platform files get built no matter what the actual target is at the moment.

We might want to take a look at why we're doing that again.

josh

#5 lore raw
Quoted 42 lines · Josh Boyer
Quoted 32 lines · Sergei Shtylyov
Quoted 30 lines · Dave Jiang

Has anyone been able to build mpc85xx_* from the latest powerpc.git? I have tried mpc85xx_cds and mpc8560_ads. I pulled a new git tree and attempted to build and hit the error message below.

Also, if I comment out the two lines in arch/powerpc/boot/Makefile that was introduced by the 440 Ebony support patch everything is fine.

$(obj)/44x.o: BOOTCFLAGS += -Wa,-mbooke
$(obj)/ebony.o: BOOTCFLAGS += -Wa,-mbooke

make -f /home/djiang/community/git-repos/tmp/ppc-master/scripts/Makefile.modpost vmlinux
scripts/mod/modpost -o
/home/djiang/community/git-repos/tmp/ppc-master/Module.symvers arch/powerpc/kernel/head_fsl_booke.o init/built-in.o usr/built-in.o arch/powerpc/kernel/built-in.o arch/powerpc/mm/built-in.o arch/powerpc/lib/built-in.o arch/powerpc/sysdev/built-in.o arch/powerpc/platforms/built-in.o arch/powerpc/math-emu/built-in.o kernel/built-in.o mm/built-in.o fs/built-in.o ipc/built-in.o security/built-in.o crypto/built-in.o block/built-in.o lib/lib.a lib/built-in.o drivers/built-in.o sound/built-in.o net/built-in.o
WARNING: arch/powerpc/mm/built-in.o(.text+0x10bc): Section mismatch: reference to .init.text:early_get_page (between 'pte_alloc_one_kernel' and 'steal_context') rm -f .old_version
make ARCH=ppc64 -f scripts/Makefile.build obj=arch/powerpc/boot arch/powerpc/boot/uImage
/opt/montavista/cge/devkit/ppc/85xx/bin/ppc_85xx-gcc -m32

(quoted diff) +0 -2
-Wp,-MD,arch/powerpc/boot/.ebony.o.d -Wall -Wstrict-prototypes -O2
-fomit-frame-pointer -fno-builtin -nostdinc -isystem

/opt/montavista/cge/devkit/ppc/85xx/bin/../lib/gcc/powerpc-montavista-linux-gnuspe/4.2.0/include

Quoted 8 lines
Quoted 6 lines
(quoted diff) +0 -3
-fPIC -fno-stack-protector -Iarch/powerpc/boot
-I/home/djiang/community/git-repos/tmp/ppc-master/arch/powerpc/boot -Wa,-mbooke
-c -o arch/powerpc/boot/ebony.o arch/powerpc/boot/ebony.c

/home/djiang/tmp/cc2UVyci.s: Assembler messages:
/home/djiang/tmp/cc2UVyci.s:142: Error: Unrecognized opcode: `isel' make[1]: *** [arch/powerpc/boot/ebony.o] Error 1

I wonder WTF ebony.c gets built for MPC85xx targets? :-O

Quoted 4 lines

Because it's part of the bootwrapper and all platform files get built no matter what the actual target is at the moment.

We might want to take a look at why we're doing that again.

So that we have a better chance of catching platform specific build
bugs: which we just did.

Signature · 4 lines
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson
#6 lore raw
In reply to Dave Jiang
Quoted 2 lines

$(obj)/44x.o: BOOTCFLAGS += -Wa,-mbooke
$(obj)/ebony.o: BOOTCFLAGS += -Wa,-mbooke

Probably -Wa,-m440 works better. However...

Review

Quoted 8 lines

/opt/montavista/cge/devkit/ppc/85xx/bin/ppc_85xx-gcc -m32

(quoted diff) +0 -2
-Wp,-MD,arch/powerpc/boot/.ebony.o.d -Wall -Wstrict-prototypes -O2
-fomit-frame-pointer -fno-builtin -nostdinc -isystem

/opt/montavista/cge/devkit/ppc/85xx/bin/../lib/gcc/powerpc-montavista-linux-gnuspe/4.2.0/include

(quoted diff) +0 -4
-fPIC -fno-stack-protector -Iarch/powerpc/boot
-I/home/djiang/community/git-repos/tmp/ppc-master/arch/powerpc/boot  
-Wa,-mbooke
-c -o arch/powerpc/boot/ebony.o arch/powerpc/boot/ebony.c

Nothing is telling GCC what CPU to compile for, so it will just use the compiler's default, which very likely is not what you want. For files that will only ever be used on 440, the correct flags are -mcpu=440 -Wa,-m440 .

Segher

#7 lore raw
Quoted 5 lines · Segher Boessenkool
Quoted 2 lines

$(obj)/44x.o: BOOTCFLAGS += -Wa,-mbooke
$(obj)/ebony.o: BOOTCFLAGS += -Wa,-mbooke

Probably -Wa,-m440 works better. However...

Quoted 14 lines

Review

Quoted 9 lines

/opt/montavista/cge/devkit/ppc/85xx/bin/ppc_85xx-gcc -m32

(quoted diff) +0 -2
-Wp,-MD,arch/powerpc/boot/.ebony.o.d -Wall -Wstrict-prototypes -O2
-fomit-frame-pointer -fno-builtin -nostdinc -isystem

/opt/montavista/cge/devkit/ppc/85xx/bin/../lib/gcc/powerpc-montavista- linux-gnuspe/4.2.0/include

(quoted diff) +0 -4
-fPIC -fno-stack-protector -Iarch/powerpc/boot
-I/home/djiang/community/git-repos/tmp/ppc-master/arch/powerpc/boot  
-Wa,-mbooke
-c -o arch/powerpc/boot/ebony.o arch/powerpc/boot/ebony.c

Nothing is telling GCC what CPU to compile for, so it will just use the compiler's default, which very likely is not what you want. For files that will only ever be used on 440, the correct flags are -mcpu=440 -Wa,-m440 .

We could add that to the per-file flags already, right?

josh

#8 lore raw
Quoted 7 lines · Josh Boyer

=20

Quoted 4 lines

Nothing is telling GCC what CPU to compile for, so it will just use the compiler's default, which very likely is not what you want. =A0For files that will only ever be used on 440, the correct flags are -mcpu=3D440 -Wa,-m440 .

=20
We could add that to the per-file flags already, right?

I think it should really use -mcpu=3Dpowerpc on all files. The problem that Dave saw was the result of using a compiler that defaults to -mcpu=3D8540, which uses instruction that don't work on 440.

The common files really need to be built with -mcpu flags that make the code work on any system if you want to be able to use just a single boot wrapper binary for all.

	Arnd <><
#9 lore raw
Quoted 7 lines · Arnd Bergmann
Quoted 6 lines · Josh Boyer
Quoted 5 lines

Nothing is telling GCC what CPU to compile for, so it will just use the compiler's default, which very likely is not what you want. For files that will only ever be used on 440, the correct flags are -mcpu=440 -Wa,-m440 .

Quoted 6 lines
Quoted 1 line

We could add that to the per-file flags already, right?

I think it should really use -mcpu=powerpc on all files. The problem that Dave saw was the result of using a compiler that defaults to -mcpu=8540, which uses instruction that don't work on 440.

You sure? It griped about isel, and isel is implemented on all 440s with the exception of 440GP. Yay for consistency.

Quoted 3 lines

The common files really need to be built with -mcpu flags that make the code work on any system if you want to be able to use just a single boot wrapper binary for all.

Yeah, it's finding those combinations that work for all the existing toolchains out there that's the issue. That, or making the wrapper not compile all the platform files... I don't know which makes more sense.

josh

#10 lore raw
Quoted 10 lines · Josh Boyer
Quoted 5 lines · Arnd Bergmann

On Thursday 24 May 2007, Josh Boyer wrote:

The common files really need to be built with -mcpu flags that make the code work on any system if you want to be able to use just a single boot wrapper binary for all.

Yeah, it's finding those combinations that work for all the existing toolchains out there that's the issue. That, or making the wrapper not compile all the platform files... I don't know which makes more sense.

The number of files in the bootwrapper is bound to grow, there are so many combinations that will never be used together, and we're bumping into lots of toolchain issues, that I'm beginning to think that paring down wrapper.a is the way to go.

Mark

#11 lore raw
In reply to Josh Boyer
Quoted 8 lines · Josh Boyer

=20

Quoted 4 lines

I think it should really use -mcpu=3Dpowerpc on all files. The problem that Dave saw was the result of using a compiler that defaults to -mcpu=3D8540, which uses instruction that don't work on 440.

=20
You sure? =A0It griped about isel, and isel is implemented on all 440s with the exception of 440GP. =A0Yay for consistency.

strange indeed. -m440 does enable PPC_OPCODE_ISEL in the current gas version, and probably all old ones as well.

Quoted 7 lines
Quoted 3 lines

The common files really need to be built with -mcpu flags that make the code work on any system if you want to be able to use just a single boot wrapper binary for all.

=20
Yeah, it's finding those combinations that work for all the existing toolchains out there that's the issue. =A0That, or making the wrapper not compile all the platform files... =A0I don't know which makes more sense.

I've looked up the gas source and found two ways that allow us to compile everywhere:

1. Pass -Wa,-many to gcc
This will really allow any possible instruction to be assembled, including the old POWER architecture, but also includes all the other strange stuff like -maltivec, -mspe, -me500, ...

2. protect the use of special instructions with .machine directives. You can write all the inline assemblies like

	.machine push
	.machine 440
	<440 specific instruction>
	.machine pop

This should work in any reasonably recent version of binutils, meaning that we don't need to pass stuff like -Wa,-m440 any more.

	Arnd <><
#12 lore raw
Quoted 4 lines

1. Pass -Wa,-many to gcc
This will really allow any possible instruction to be assembled, including the old POWER architecture, but also includes all the other strange stuff like -maltivec, -mspe, -me500, ...

And it doesn't prevent the compiler from compiling insns that can never work on the platform; for example, the compiler in the original bug report will happily put isel insns all over the place.

Quoted 10 lines

2. protect the use of special instructions with .machine directives. You can write all the inline assemblies like

	.machine push
	.machine 440
	<440 specific instruction>
	.machine pop

This should work in any reasonably recent version of binutils, meaning that we don't need to pass stuff like -Wa,-m440 any more.

[You don't need the assembler flag at all, just the compiler flag -mcpu=440].

This of course works, but is ultra-silly to do in a file that will never run on anything other than 440 systems.

Segher

#13 lore raw
In reply to Josh Boyer
Quoted 2 lines

Yeah, it's finding those combinations that work for all the existing toolchains out there that's the issue.

No, it was a simple bug -- we shouldn't pass an assembler flag for 440.o and ebony.o, but a compiler flag.

Segher

#14 lore raw
In reply to Arnd Bergmann
Quoted 11 lines
Quoted 6 lines
Quoted 4 lines

Nothing is telling GCC what CPU to compile for, so it will just use the compiler's default, which very likely is not what you want. =A0For files that will only ever be used on 440, the correct flags are -mcpu=3D440 -Wa,-m440 .

We could add that to the per-file flags already, right?

I think it should really use -mcpu=3Dpowerpc on all files. The problem that Dave saw was the result of using a compiler that defaults to -mcpu=3D8540, which uses instruction that don't work on 440.

No, those options _do_ work on 440, but the -mbooke assembler flag disallows isel (since it is an optional insn).

Quoted 3 lines

The common files really need to be built with -mcpu flags that make the code work on any system if you want to be able to use just a single boot wrapper binary for all.

On any system where they can run at all, yes. It should be fine to compile a 440-only file with 440-specific flags.

Segher

#15 lore raw
Quoted 7 lines · Segher Boessenkool
Quoted 7 lines
Quoted 6 lines
Quoted 4 lines

Nothing is telling GCC what CPU to compile for, so it will just use the compiler's default, which very likely is not what you want.  For files that will only ever be used on 440, the correct flags are -mcpu=440 -Wa,-m440 .

We could add that to the per-file flags already, right?

Quoted 8 lines
Quoted 4 lines

I think it should really use -mcpu=powerpc on all files. The problem that Dave saw was the result of using a compiler that defaults to -mcpu=8540, which uses instruction that don't work on 440.

No, those options _do_ work on 440, but the -mbooke assembler flag disallows isel (since it is an optional insn).

But not on 440GP, which is what Ebony is.

Quoted 6 lines
Quoted 3 lines

The common files really need to be built with -mcpu flags that make the code work on any system if you want to be able to use just a single boot wrapper binary for all.

On any system where they can run at all, yes. It should be fine to compile a 440-only file with 440-specific flags.

Signature · 4 lines
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson
#16 lore raw
Quoted 5 lines
Quoted 3 lines

No, those options _do_ work on 440, but the -mbooke assembler flag disallows isel (since it is an optional insn).

But not on 440GP, which is what Ebony is.

I meant it is an optional insn in the arch.

-mcpu=440 doesn't enable isel, anyway; only -mcpu=e500 does in any FSF GCC release as far as I can see.

Segher

#17 lore raw
In reply to Josh Boyer
Quoted 6 lines
Quoted 4 lines

Nothing is telling GCC what CPU to compile for, so it will just use the compiler's default, which very likely is not what you want. For files that will only ever be used on 440, the correct flags are -mcpu=440 -Wa,-m440 .

We could add that to the per-file flags already, right?

Yes, exactly.

Segher