Skip to contentSkip to conversation

KB9202 CodeSourcery ARM EABI toolchain build fixes

PATCH New Johannes Stezenbach 3 participants 13 messages Oct 25, 2007 – Jan 24, 2008

lore
Share & tools
lore
#0 lore raw

cover KB9202 CodeSourcery ARM EABI toolchain build fixes

Hi,

I'm pretty new to u-boot and ARM stuff, so please
review carefully.

I wanted to build u-boot-1.3.0-rc3 for the KwikByte KB9202 board with the current ARM toolchain from CodeSourcery.
I needed the following three patches to get it to build.

The first one is probably a bugfix needed for other toolchains, too.

The other two patches are specific to the CodeSourcery toolchain (or probably to any EABI toolchain with gcc-4.2.x). I haven't checked if they break the build for other ARM toolchains, so it's probably better to not apply them unless someone else confirms they're OK.

Regards,
Johannes

#2 lore raw

PATCH 1/3 KB9202 compile fix

Quoted 4 lines · In message <[email protected]> you wrote:

KB9202 compile fix

Problem observed with CodeSourcery EABI toolchain
(arm-2007q3-51-arm-none-linux-gnueabi)

...

include/configs/kb9202.h line 61

Quoted 9 lines
include/configs/kb9202.h +1 -1
@@ -57,7 +57,7 @@
 /*
  * Size of malloc() pool
  */
-#define CFG_MALLOC_LEN	(CFG_ENV_SIZE + 128*1024)
+#define CFG_MALLOC_LEN	(128*1024)
 #define CFG_GBL_DATA_SIZE	128	/* size in bytes reserved for initial data */

This seems to be broken for me, especially for bigger environments.

NAK.

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Every solution breeds new problems.
#3 lore raw

PATCH 1/3 KB9202 compile fix

Quoted 18 lines · Wolfgang Denk
Quoted 4 lines · In message <[email protected]> you wrote:

KB9202 compile fix

Problem observed with CodeSourcery EABI toolchain
(arm-2007q3-51-arm-none-linux-gnueabi)

...

include/configs/kb9202.h line 61

Quoted 9 lines
include/configs/kb9202.h +1 -1
@@ -57,7 +57,7 @@
 /*
  * Size of malloc() pool
  */
-#define CFG_MALLOC_LEN	(CFG_ENV_SIZE + 128*1024)
+#define CFG_MALLOC_LEN	(128*1024)
 #define CFG_GBL_DATA_SIZE	128	/* size in bytes reserved for initial data */

This seems to be broken for me, especially for bigger environments.

Quoted 1 line

NAK.

I would've hoped for a better suggestion. Currently I don't know if the problem is caused by a binutils issue with the CodeSourcery toolchain, or if kb9202 is broken with any toolchain.

Anyway, what I did was to grep for CFG_MALLOC_LEN and the majority of the other configs don't add CFG_ENV_SIZE here.

Thanks,
Johannes

#5 lore raw

PATCH 2/3 KB9202 EABI build with CodeSourcery EABI toolchain

Quoted 11 lines · In message <[email protected]> you wrote:

KB9202 EABI build with CodeSourcery EABI toolchain (arm-2007q3-51-arm-none-linux-gnueabi)

diff -r 1f24112792e7 -r aeff4cd3d1be cpu/arm920t/config.mk

cpu/arm920t/config.mk +0 -0
@@ -24,11 +24,10 @@ PLATFORM_RELFLAGS += -fno-strict-aliasin
 PLATFORM_RELFLAGS += -fno-strict-aliasing  -fno-common -ffixed-r8 \
 	-msoft-float

cpu/arm920t/config.mk PLATFORM_RELFLAGS += -fno-strict-aliasin · line 33

Quoted 10 lines
cpu/arm920t/config.mk +1 -2
 
-PLATFORM_CPPFLAGS += -march=armv4
+PLATFORM_CPPFLAGS += -march=armv4t
 # =========================================================================
 #
 # Supply options according to compiler version
 #
 # =========================================================================
-PLATFORM_CPPFLAGS +=$(call cc-option,-mapcs-32,-mabi=apcs-gnu)
 PLATFORM_RELFLAGS +=$(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,))

Did you test this modification with other tool chains? Which ones? Which compiler / binutils versions?

Best regards,

Wolfgang Denk

Signature · 7 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
On my planet, to rest is to rest -- to cease using energy. To me,  it
is  quite  illogical to run up and down on green grass, using energy,
instead of saving it.
	-- Spock, "Shore Leave", stardate 3025.2
#6 lore raw

PATCH 2/3 KB9202 EABI build with CodeSourcery EABI toolchain

Quoted 13 lines · Wolfgang Denk
Quoted 12 lines · In message <[email protected]> you wrote:

KB9202 EABI build with CodeSourcery EABI toolchain (arm-2007q3-51-arm-none-linux-gnueabi)

diff -r 1f24112792e7 -r aeff4cd3d1be cpu/arm920t/config.mk

cpu/arm920t/config.mk +0 -0
@@ -24,11 +24,10 @@ PLATFORM_RELFLAGS += -fno-strict-aliasin
 PLATFORM_RELFLAGS += -fno-strict-aliasing  -fno-common -ffixed-r8 \
 	-msoft-float
 
Quoted 12 lines

cpu/arm920t/config.mk PLATFORM_RELFLAGS += -fno-strict-aliasin · line 33

Quoted 9 lines
cpu/arm920t/config.mk +1 -2
-PLATFORM_CPPFLAGS += -march=armv4
+PLATFORM_CPPFLAGS += -march=armv4t
 # =========================================================================
 #
 # Supply options according to compiler version
 #
 # =========================================================================
-PLATFORM_CPPFLAGS +=$(call cc-option,-mapcs-32,-mabi=apcs-gnu)
 PLATFORM_RELFLAGS +=$(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,))

Did you test this modification with other tool chains? Which ones? Which compiler / binutils versions?

No, I only tested with the toolchain ARM Ltd. recommends, and the patch was originally created against the U-Boot version with ARM offers for download (but tested against 1.3.0-rc3).
http://www.arm.com/products/os/linux.html
http://www.arm.com/linux/U-Boot-src.tar.gz

The arm-2007q3-51 toolchain has:
* binutils-2.18.50.20070820
* gcc-4.2.1
* glibc-2.5
* gdb-6.6.50.20070821-cvs

Maybe the ARM custodian can comment.

Thanks,
Johannes

#7 lore raw

PATCH 2/3 KB9202 EABI build withCodeSourcery EABI toolchain

Quoted 12 lines

-----Original Message-----
From: u-boot-users-bounces at lists.sourceforge.net [mailto:u-boot-users-bounces at lists.sourceforge.net] On Behalf Of Johannes Stezenbach
Sent: 03 November 2007 22:21
To: Wolfgang Denk
Cc: u-boot-users at lists.sourceforge.net
Subject: Re: [U-Boot-Users] [patch 2/3] KB9202 EABI build withCodeSourcery EABI toolchain

Quoted 2 lines

Maybe the ARM custodian can comment.

Given that U-Boot is a standalone binary, I am content that the U-Boot main tree should build with current version of the ELDK
- individual users may then port locally to their preferred toolchains as required/desired.

This avoids the combinatorial explosion of testing with multiple toolchains.

Not that this should stop users submitting their local toolchain patches to the list and/or discussing the use of other toolchains.

Quoted 4 lines

Thanks,
Johannes

#8 lore raw

PATCH 2/3 KB9202 EABI build withCodeSourcery EABI toolchain

Quoted 8 lines · Peter Pearse
Quoted 3 lines

-----Original Message-----

Maybe the ARM custodian can comment.

Given that U-Boot is a standalone binary, I am content that the U-Boot main tree should build with current version of the ELDK
- individual users may then port locally to their preferred toolchains as required/desired.

Fair enough.

Quoted 4 lines

This avoids the combinatorial explosion of testing with multiple toolchains.

Not that this should stop users submitting their local toolchain patches to the list and/or discussing the use of other toolchains.

Maintaining a second toolchain installation is more work than to create a few build fix patches. And I'm happy to share them even if they can't be merged.

Thanks,
Johannes

#9 lore raw

PATCH 2/3 KB9202 EABI build withCodeSourcery EABI toolchain

Quoted 7 lines · In message <[email protected]> you wrote:
Quoted 5 lines

Given that U-Boot is a standalone binary, I am content that the U-Boot main tree should build with current version of the ELDK
- individual users may then port locally to their preferred toolchains as required/desired.

Fair enough.

Actually I'd like to keep incompatibilities between ELDK and other toolchains as small as possible; ideally, U-Boot should build with any tool chain the end user decides to use. So the important thing is to isolate such incompatibilities, understand why they happen and then implement measures to deal with them - if they cannot be avoided one way or another.

Quoted 3 lines

Maintaining a second toolchain installation is more work than to create a few build fix patches. And I'm happy to share them even if they can't be merged.

It is essential that such changes are (1) verified to build with all board at least in this architecture, and (2) we receive confirmations from test users fromn this and from other tool chains.

If a change helps one specific toolchain without braking any already working ones it will go in easily.

Best regards,

Wolfgang Denk

Signature · 8 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The so-called "desktop metaphor" of today's workstations  is  instead
an  "airplane-seat"  metaphor.  Anyone who has shuffled a lap full of
papers while seated between two portly passengers will recognize  the
difference -- one can see only a very few things at once.
                                                   - Fred Brooks, Jr.
#11 lore raw

cover KB9202 CodeSourcery ARM EABI toolchainbuild fixes

In reply to Johannes Stezenbach
Quoted 10 lines

-----Original Message-----
From: u-boot-users-bounces at lists.sourceforge.net [mailto:u-boot-users-bounces at lists.sourceforge.net] On Behalf Of Johannes Stezenbach
Sent: 25 October 2007 17:11
To: u-boot-users at lists.sourceforge.net
Subject: [U-Boot-Users] [patch 0/3] KB9202 CodeSourcery ARM EABI toolchainbuild fixes

Quoted 4 lines

Hi,

I'm pretty new to u-boot and ARM stuff, so please review carefully.

I'll use my careful review as the reason this reply is so late ;-)

Quoted 5 lines

I wanted to build u-boot-1.3.0-rc3 for the KwikByte KB9202 board with the current ARM toolchain from CodeSourcery. I needed the following three patches to get it to build.

The first one is probably a bugfix needed for other toolchains, too.

Thanks for this - it has alerted me to the use of
sub rx, rx, #CONSTANT in several of the ARM .S assembler files. Whilst sub rx, rx, #CONSTANT saves code size it does demand that users understand their constants, what they are for and where they are used.
For ARM #CONSTANT in this context must be capable of being formed by rotating
an 8 bit constant in a 32 bit register
e.g. 0x22000 is allowed whereas 0x20200 is not.

I am going to reject your patch though. It is the code that should be changed.
I have added an action to my list of required patches
http://www.denx.de/wiki/UBoot/PatchStatus to examine the use of constants in the ARM assembler
code.

Quoted 6 lines

The other two patches are specific to the CodeSourcery toolchain (or probably to any EABI toolchain with gcc-4.2.x). I haven't checked if they break the build for other ARM toolchains, so it's probably better to not apply them unless someone else confirms they're OK.

Thanks for submitting these - they will be of use/interest to users building EABI code.

However I do not propose to submit them to the main tree since they are toolchain
specific. The standard toolchain for building U-Boot is that supplied in the ELDK
http://www.denx.de/wiki/DULG/ELDK.
Of course many users have reasons for using others, however to support all possible
toolchains would result in a support nightmare.....

Sorry for the delayed response

Regards

Peter

#12 lore raw

cover KB9202 CodeSourcery ARM EABI toolchainbuild fixes

Quoted 22 lines · Peter Pearse
Quoted 11 lines

-----Original Message-----
From: u-boot-users-bounces at lists.sourceforge.net [mailto:u-boot-users-bounces at lists.sourceforge.net] On Behalf Of Johannes Stezenbach
Sent: 25 October 2007 17:11

I wanted to build u-boot-1.3.0-rc3 for the KwikByte KB9202 board with the current ARM toolchain from CodeSourcery. I needed the following three patches to get it to build.

The first one is probably a bugfix needed for other toolchains, too.

Thanks for this - it has alerted me to the use of
sub rx, rx, #CONSTANT in several of the ARM .S assembler files. Whilst sub rx, rx, #CONSTANT saves code size it does demand that users understand their constants, what they are for and where they are used.
For ARM #CONSTANT in this context must be capable of being formed by rotating
an 8 bit constant in a 32 bit register
e.g. 0x22000 is allowed whereas 0x20200 is not.

Quoted 6 lines

I am going to reject your patch though. It is the code that should be changed.
I have added an action to my list of required patches
http://www.denx.de/wiki/UBoot/PatchStatus to examine the use of constants in the ARM assembler
code.

The simple patch below at least circumvents the problem and allows u-boot to build for the kb9202. Please consider applying this one. It is not toolchain specific.

Quoted 10 lines
Quoted 6 lines

The other two patches are specific to the CodeSourcery toolchain (or probably to any EABI toolchain with gcc-4.2.x). I haven't checked if they break the build for other ARM toolchains, so it's probably better to not apply them unless someone else confirms they're OK.

Thanks for submitting these - they will be of use/interest to users building EABI code.

Quoted 8 lines

However I do not propose to submit them to the main tree since they are toolchain
specific. The standard toolchain for building U-Boot is that supplied in the ELDK
http://www.denx.de/wiki/DULG/ELDK.
Of course many users have reasons for using others, however to support all possible
toolchains would result in a support nightmare.....

The patch propsed in

[U-Boot-Users] [patch u-boot git 2/3] better ARM9 compiler options
From: David Brownell <david-b@pa...> - 2008-01-18 20:55
http://sourceforge.net/mailarchive/forum.php?thread_name=200801181250.50303.david-b%40pacbell.net&forum_name=u-boot-users

would take care of the CodeSourcery build issues, too. It should work with any toolchain.

---
KB9202 compile fix

make -C cpu/arm920t start.o
...
start.S: Assembler messages:
start.S:205: Error: invalid constant (20200) after fixup etc.

The environment size is the same as in the kb9202
patch available from www.kwikbyte.com.

include/configs/kb9202.h +2 -2
index 75d9c3b..88e8737 100644
@@ -128,8 +128,8 @@
 #define	CFG_ENV_IS_IN_EEPROM
 
 #ifdef CONFIG_KB9202
-#define CFG_ENV_OFFSET			0x3E00
-#define CFG_ENV_SIZE			0x0200
+#define CFG_ENV_OFFSET			0x2000
+#define CFG_ENV_SIZE			0x2000
 #else
 #define CFG_ENV_OFFSET			0x1000
 #define CFG_ENV_SIZE			0x1000

Thanks,
Johannes