Skip to contentSkip to conversation

MPC85xx config.mk patch for -mno-string

U-Boot-Users Jon Loeliger 3 participants 4 messages Dec 14, 2004 – Dec 16, 2004

lore
Share & tools
lore
#0 lore raw

Wolfgang,

Taking Junita Ajith <[email protected]> suggestion, here is a patch to the MPC85XX ADS and CDS config.mk file to add the -mno-string option. Verifed working using gcc version 3.3.3 (Yellow Dog Linux 3.3.3-16.ydl.4).

Thanks,
jdl

* Patch by Jon Loeliger, 14-Dec-2004:
Force MPC85xx build to use -mno-string as e500 core doesn't implement string instructions.

Index: cpu/mpc85xx/config.mk
===================================================================
RCS file: /cm/vault/u-boot/u-boot/cpu/mpc85xx/config.mk,v retrieving revision 1.1.1.1

mpc85xx/config.mk +3 -1
diff -u -r1.1.1.1 config.mk
@@ -23,4 +23,6 @@
 
 PLATFORM_RELFLAGS += -fPIC -ffixed-r14 -meabi
 
-PLATFORM_CPPFLAGS += -DCONFIG_MPC85xx -DCONFIG_E500 -ffixed-r2 -ffixed-r29 -Wa,-me500 -msoft-float
+PLATFORM_CPPFLAGS += -DCONFIG_MPC85xx -DCONFIG_E500 \
+			-ffixed-r2 -ffixed-r29 -mno-string\
+			-Wa,-me500 -msoft-float
#1 lore raw
Quoted 4 lines · In message <[email protected]> you wrote:

* Patch by Jon Loeliger, 14-Dec-2004:
Force MPC85xx build to use -mno-string as e500 core doesn't implement string instructions.

Why do we need this? GCC 3.3.3 (DENX ELDK 3.1 3.3.3-8) compiles the same code without problems. Where are the string instructions coming from?

Best regards,

Wolfgang Denk

Signature · 5 lines
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Administration: An ingenious abstraction  in  politics,  designed  to
receive the kicks and cuffs due to the premier or president.
- Ambrose Bierce
#2 lore raw
Quoted 9 lines · Wolfgang Denk
Quoted 4 lines · In message <[email protected]> you wrote:

* Patch by Jon Loeliger, 14-Dec-2004:
Force MPC85xx build to use -mno-string as e500 core doesn't implement string instructions.

Why do we need this? GCC 3.3.3 (DENX ELDK 3.1 3.3.3-8) compiles the same code without problems. Where are the string instructions coming from?

Well, technically, we really shouldn't _need_ to do this. It's really being done as a safety issue. Well, that and I'm going to use the "Also, 85xx Linux does this too." defense. :-)

I don't recall if Junita Ajith indicated what compiler he(?) used, but ELDK-3.1 was mentioned with a claim that it was needed for his build.

Quoted 1 line

Wolfgang Denk

jdl

#3 lore raw
In reply to Wolfgang Denk
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

Wolfgang Denk writes:

Wolfgang> Why do we need this? GCC 3.3.3 (DENX ELDK 3.1 3.3.3-8) Wolfgang> compiles the same code without problems. Where are the Wolfgang> string instructions coming from?

GCC can be built with different defaults. The -mno-string option guarantees that string instructions will not be generated. I wrote some half-year ago that I too need this option for my GCC version. In theory, -mcpu=8540 implies -mno-string. In the real world, at least some GCC versions generate string instructions if -mno-string is not specified explicitly, and you can discover this only when the U-Boot crashes in run-time.

Signature · 4 lines
========================================================================
 Yuli Barcohen       | Phone +972-9-765-1788 |  Software Project Leader
 yuli at arabellasw.com | Fax   +972-9-765-7494 | Arabella Software, Israel
========================================================================