Skip to contentSkip to conversation

ARM: Toolchain configuration for Cortex A8 based OMAP3?

RFC In review Dirk Behme 6 participants 10 messages Aug 23, 2008 – Aug 28, 2008 Kbuild

lore
Share & tools
lore

Dirk Behme

author
#0 lore raw

RFC 1/1 ARM: Toolchain configuration for Cortex A8 based OMAP3?

While preparing U-Boot patches for ARM Cortex A8 based OMAP3 [1], we found that we use CodeSourcery ARM toolchain [2], and the way we locally modified main Makefile to use this toolchain is most probably incompatible with mainline.

Please find below some diffs what we did locally.

We now like to discuss/ask what's the best way to align this with mainline to be able to submit OMAP3 patches?

Any hints or proposals?

Many thanks,

Dirk

[1]
http://www.sakoman.net/cgi-bin/gitweb.cgi?p=u-boot-omap3.git;a=summary
('common' branch)

[2] http://www.codesourcery.com/gnu_toolchains/arm/portal/release313

Relevant parts of OMAP3 patch we talk about here (most probably reformated cause of copy & paste to mailtool, so just for discussion. Final patches will be sent by git-send-mail). Note the -lgcc_eh which seems to be CodeSourcery specific, and the -march=armv7a in config.mk.

Makefile +2 -4
diff -uprN uboot_clean/Makefile uboot_beagle/Makefile
@@ -141,7 +141,7 @@ ifeq ($(ARCH),ppc)
  CROSS_COMPILE = ppc_8xx-
  endif
  ifeq ($(ARCH),arm)
-CROSS_COMPILE = arm-linux-
+CROSS_COMPILE = arm-none-linux-gnueabi-
  endif
  ifeq ($(ARCH),i386)
  CROSS_COMPILE = i386-linux-
@@ -253,7 +253,7 @@ LIBBOARD = board/$(BOARDDIR)/lib$(BOARD)
  LIBBOARD := $(addprefix $(obj),$(LIBBOARD))
 
  # Add GCC lib
-PLATFORM_LIBS += -L $(shell dirname `$(CC) $(CFLAGS) 
-print-libgcc-file-name`) -lgcc
+PLATFORM_LIBS += -L $(shell dirname `$(CC) $(CFLAGS) 
-print-libgcc-file-name`) -lgcc -lgcc_eh
 

# The "tools" are needed early, so put this first
# Don't include stuff already done in $(LIBS)
@@ -2641,6 +2641,18 @@ SMN42_config : unconfig
@$(MKCONFIG) $(@:_config=) arm arm720t SMN42 siemens lpc2292

#########################################################################
+## ARM CORTEX Systems
+#########################################################################
+omap3_beagle_config : unconfig
+ @$(MKCONFIG) $(@:_config=) arm omap3 beagle omap3
+
+omap3_overo_config : unconfig
+ @$(MKCONFIG) $(@:_config=) arm omap3 overo omap3
+
+omap3_evm_config : unconfig
+ @$(MKCONFIG) $(@:_config=) arm omap3 evm omap3
+
+#########################################################################
## XScale Systems

#########################################################################

diff -uprN uboot_clean/cpu/omap3/config.mk
uboot_beagle/cpu/omap3/config.mk

cpu/omap3/config.mk +4 -0
@@ -0,0 +1,34 @@
+#
+# (C) Copyright 2002
+# Gary Jennejohn, DENX Software Engineering, <[email protected]>
+#

<cut GPL>
+#
+PLATFORM_RELFLAGS += -fno-strict-aliasing -fno-common -ffixed-r8 \
+ -msoft-float
+
+PLATFORM_CPPFLAGS += -march=armv7a
+#
=========================================================================
+#
+# Supply options according to compiler version
+#
+#
=========================================================================
+#PLATFORM_CPPFLAGS +=$(call cc-option,-mapcs-32,-mabi=apcs-gnu) +PLATFORM_CPPFLAGS +=$(call cc-option)
+PLATFORM_RELFLAGS +=$(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,))

#1 lore raw

Hi Dirk,

Quoted 9 lines

Relevant parts of OMAP3 patch we talk about here (most probably reformated cause of copy & paste to mailtool, so just for discussion. Final patches will be sent by git-send-mail). Note the -lgcc_eh which seems to be CodeSourcery specific, and the -march=armv7a in config.mk.

diff -uprN uboot_clean/Makefile uboot_beagle/Makefile

Makefile 2008-08-22 19:53:52.000000000 +0200 ifeq ($(ARCH),ppc) · line 144

Quoted 5 lines
Makefile 2008-08-22 19:53:52.000000000 +0200 renamed from Makefile 2008-08-22 19:57:05.000000000 +0200 +1 -1
@@ -141,7 +141,7 @@ ifeq ($(ARCH),ppc)
  CROSS_COMPILE = ppc_8xx-
  endif
  ifeq ($(ARCH),arm)
-CROSS_COMPILE = arm-linux-
+CROSS_COMPILE = arm-none-linux-gnueabi-

CROSS_COMPILE can always be set as an environment variable. It is only for convenience. CodeSourcy from my vantage point is common enough it would nice to see it the default. In the end it doesn't matter.

Makefile 2008-08-22 19:53:52.000000000 +0200 LIBBOARD = board/$(BOARDDIR)/lib$(BOARD) · line 258

Quoted 11 lines
Makefile 2008-08-22 19:53:52.000000000 +0200 renamed from Makefile 2008-08-22 19:57:05.000000000 +0200 +1 -3
  endif
  ifeq ($(ARCH),i386)
  CROSS_COMPILE = i386-linux-
@@ -253,7 +253,7 @@ LIBBOARD = board/$(BOARDDIR)/lib$(BOARD)
  LIBBOARD := $(addprefix $(obj),$(LIBBOARD))
 
  # Add GCC lib
-PLATFORM_LIBS += -L $(shell dirname `$(CC) $(CFLAGS)
-print-libgcc-file-name`) -lgcc
+PLATFORM_LIBS += -L $(shell dirname `$(CC) $(CFLAGS)
-print-libgcc-file-name`) -lgcc -lgcc_eh

What is being gained by changing platform libs part? Every now and then I update my local omap3 u-boot and I've not had to change that to get it working with codesourcy tool chains. It might be I've not hit the issue yet.

Quoted 13 lines
Makefile 2008-08-22 19:53:52.000000000 +0200 renamed from Makefile 2008-08-22 19:57:05.000000000 +0200 +2 -0
+PLATFORM_CPPFLAGS += -march=armv7a
+#

========================================================================
=

Makefile 2008-08-22 19:53:52.000000000 +0200 renamed from Makefile 2008-08-22 19:57:05.000000000 +0200 +4 -0
+#
+# Supply options according to compiler version
+#
+#

========================================================================
=

Makefile 2008-08-22 19:53:52.000000000 +0200 renamed from Makefile 2008-08-22 19:57:05.000000000 +0200 +3 -0
+#PLATFORM_CPPFLAGS +=$(call cc-option,-mapcs-32,-mabi=apcs-gnu)
+PLATFORM_CPPFLAGS +=$(call cc-option)
+PLATFORM_RELFLAGS +=$(call cc-option,-mshort-load-bytes,$(call
Quoted 1 line

cc-option,-malignment-traps,))

Only possible issue is if the make all boards breaks. I'm not sure what kind of magical tool chain Wolfgang which can 'make all' for old and new versions. When we did the initial port we grabbed the cc-option from Peter Pearse ARM patches and that helped a lot in sorting out invalid options. That has since been integrated. Many people only use older tool chains which won't support v7.

There hasn't been much advantage in using a v7 target at the u-boot level. It mainly gets your assembler to understand smi but that can easily be a dc.w. We have used it mainly as an early test of the tool chain.

Probably the only time it absolutely is needed is if you have a Thumb2 only Cortex variant.

Regards,
Richard W.

author
#2 lore raw
Quoted 25 lines · Richard

Hi Dirk,

Quoted 9 lines

Relevant parts of OMAP3 patch we talk about here (most probably reformated cause of copy & paste to mailtool, so just for discussion. Final patches will be sent by git-send-mail). Note the -lgcc_eh which seems to be CodeSourcery specific, and the -march=armv7a in config.mk.

diff -uprN uboot_clean/Makefile uboot_beagle/Makefile

Makefile 2008-08-22 19:53:52.000000000 +0200 ifeq ($(ARCH),ppc) · line 144

Quoted 5 lines
Makefile 2008-08-22 19:53:52.000000000 +0200 renamed from Makefile 2008-08-22 19:57:05.000000000 +0200 +1 -1
@@ -141,7 +141,7 @@ ifeq ($(ARCH),ppc)
 CROSS_COMPILE = ppc_8xx-
 endif
 ifeq ($(ARCH),arm)
-CROSS_COMPILE = arm-linux-
+CROSS_COMPILE = arm-none-linux-gnueabi-

CROSS_COMPILE can always be set as an environment variable. It is only for convenience. CodeSourcy from my vantage point is common enough it would nice to see it the default. In the end it doesn't matter.

Quoted 6 lines
Makefile 2008-08-22 19:53:52.000000000 +0200 renamed from Makefile 2008-08-22 19:57:05.000000000 +0200 +0 -0
 endif
 ifeq ($(ARCH),i386)
 CROSS_COMPILE = i386-linux-
@@ -253,7 +253,7 @@ LIBBOARD = board/$(BOARDDIR)/lib$(BOARD)
 LIBBOARD := $(addprefix $(obj),$(LIBBOARD))
 
Quoted 7 lines

Makefile 2008-08-22 19:53:52.000000000 +0200 LIBBOARD = board/$(BOARDDIR)/lib$(BOARD) · line 258

Quoted 5 lines
Makefile 2008-08-22 19:53:52.000000000 +0200 renamed from Makefile 2008-08-22 19:57:05.000000000 +0200 +1 -3
 # Add GCC lib
-PLATFORM_LIBS += -L $(shell dirname `$(CC) $(CFLAGS)
-print-libgcc-file-name`) -lgcc
+PLATFORM_LIBS += -L $(shell dirname `$(CC) $(CFLAGS)
-print-libgcc-file-name`) -lgcc -lgcc_eh

What is being gained by changing platform libs part? Every now and then I update my local omap3 u-boot and I've not had to change that to get it working with codesourcy tool chains. It might be I've not hit the issue yet.

Did check regarding -lgcc_eh: Used CodeSourcery tool chain and compiled (linked) with and without -lgcc_eh. The resulting binaries are identical and no link issues. Seems we can remove -lgcc_eh then. I just wonder now why it is there and what it is (was?) good for?

Quoted 17 lines
Quoted 13 lines
Makefile 2008-08-22 19:53:52.000000000 +0200 renamed from Makefile 2008-08-22 19:57:05.000000000 +0200 +2 -0
+PLATFORM_CPPFLAGS += -march=armv7a
+#

========================================================================
=

Makefile 2008-08-22 19:53:52.000000000 +0200 renamed from Makefile 2008-08-22 19:57:05.000000000 +0200 +4 -0
+#
+# Supply options according to compiler version
+#
+#

========================================================================
=

Makefile 2008-08-22 19:53:52.000000000 +0200 renamed from Makefile 2008-08-22 19:57:05.000000000 +0200 +3 -0
+#PLATFORM_CPPFLAGS +=$(call cc-option,-mapcs-32,-mabi=apcs-gnu)
+PLATFORM_CPPFLAGS +=$(call cc-option)
+PLATFORM_RELFLAGS +=$(call cc-option,-mshort-load-bytes,$(call
Quoted 1 line

cc-option,-malignment-traps,))

Only possible issue is if the make all boards breaks. I'm not sure what kind of magical tool chain Wolfgang which can 'make all' for old and new versions. When we did the initial port we grabbed the cc-option from Peter Pearse ARM patches and that helped a lot in sorting out invalid options. That has since been integrated. Many people only use older tool chains which won't support v7.

Quoted 1 line

There hasn't been much advantage in using a v7 target at the u-boot level. It mainly gets your assembler to understand smi but that can easily be a dc.w.

Using CodeSourcery toolchain and replacing armv7a with armv4 results in

- a lot of warnings "warning: target CPU does not support interworking"

- start.S compilation fails:

start.S: Assembler messages:
start.S:466: Error: selected processor does not support isb' start.S:475: Error: selected processor does not support clz r5,r4' start.S:500: Error: selected processor does not support `isb'

Quoted 3 lines

We have used it mainly as an early test of the tool chain.

Probably the only time it absolutely is needed is if you have a Thumb2 only Cortex variant.

Dirk

#3 lore raw
Quoted 35 lines · Dirk Behme
Quoted 7 lines · Richard

Hi Dirk,

Quoted 5 lines

Relevant parts of OMAP3 patch we talk about here (most probably reformated cause of copy & paste to mailtool, so just for discussion. Final patches will be sent by git-send-mail). Note the -lgcc_eh which seems to be CodeSourcery specific, and the -march=armv7a in config.mk.

Quoted 11 lines

Makefile 2008-08-22 19:53:52.000000000 +0200 ifeq ($(ARCH),ppc) · line 144

Quoted 9 lines

diff -uprN uboot_clean/Makefile uboot_beagle/Makefile

Makefile 2008-08-22 19:53:52.000000000 +0200 renamed from Makefile 2008-08-22 19:57:05.000000000 +0200 +1 -1
@@ -141,7 +141,7 @@ ifeq ($(ARCH),ppc)
 CROSS_COMPILE = ppc_8xx-
 endif
 ifeq ($(ARCH),arm)
-CROSS_COMPILE = arm-linux-
+CROSS_COMPILE = arm-none-linux-gnueabi-

CROSS_COMPILE can always be set as an environment variable. It is

only for convenience. CodeSourcy from my vantage point is common enough it would nice to see it the default. In the end it doesn't matter.

Quoted 7 lines
Quoted 7 lines
Makefile 2008-08-22 19:53:52.000000000 +0200 renamed from Makefile 2008-08-22 19:57:05.000000000 +0200 +0 -0
 endif
 ifeq ($(ARCH),i386)
 CROSS_COMPILE = i386-linux-
@@ -253,7 +253,7 @@ LIBBOARD = board/$(BOARDDIR)/lib$(BOARD)
 LIBBOARD := $(addprefix $(obj),$(LIBBOARD))
 
Quoted 7 lines

Makefile 2008-08-22 19:53:52.000000000 +0200 LIBBOARD = board/$(BOARDDIR)/lib$(BOARD) · line 258

Quoted 5 lines
Makefile 2008-08-22 19:53:52.000000000 +0200 renamed from Makefile 2008-08-22 19:57:05.000000000 +0200 +1 -3
 # Add GCC lib
-PLATFORM_LIBS += -L $(shell dirname `$(CC) $(CFLAGS)
-print-libgcc-file-name`) -lgcc
+PLATFORM_LIBS += -L $(shell dirname `$(CC) $(CFLAGS)
-print-libgcc-file-name`) -lgcc -lgcc_eh

What is being gained by changing platform libs part? Every now and

Quoted 8 lines

then I update my local omap3 u-boot and I've not had to change that to get it working with codesourcy tool chains. It might be I've not hit the issue yet.

Did check regarding -lgcc_eh: Used CodeSourcery tool chain and compiled (linked) with and without -lgcc_eh. The resulting binaries are identical and no link issues. Seems we can remove -lgcc_eh then. I just wonder now why it is there and what it is (was?) good for?

AFAIK, you can safely remove it. I don't know how CodeSourcery build their toolchains but when I do mine I remove it from glibc and then there is no libgcc_eh at all. The trick is glibc headers are required to build first stage cross-gcc and cross gcc is required to build glibc. And glibc in turn is required to build gcc :) It might be easier to do it with previous versions installed but I usually build toolchains as RPM packages assuming no previous toolchain is installed. And it is build in buildroot with all the system stuff going into sysroot.

The build process is multi-stage -- first just provisional glibc headers are built, then they are used to build limited first stage cross-gcc, then this gcc is used to build full-blown glibc that gets installed in sysroot overwriting those provisional headers, then this newly built glibc is used to build the full cross-gcc.

---
******************************************************************
* KSI at home KOI8 Net < > The impossible we do immediately. *
* Las Vegas NV, USA < > Miracles require 24-hour notice. *
******************************************************************

#4 lore raw
In reply to Dirk Behme
Quoted 4 lines · Dirk Behme

Did check regarding -lgcc_eh: Used CodeSourcery tool chain and compiled (linked) with and without -lgcc_eh. The resulting binaries are identical and no link issues. Seems we can remove -lgcc_eh then. I just wonder now why it is there and what it is (was?) good for?

It's runtime support for exception handling, which C doesn't have, and thus U-Boot clearly shouldn't need it.

-Scott

author
#5 lore raw
In reply to Dirk Behme
Quoted 41 lines · Dirk Behme

While preparing U-Boot patches for ARM Cortex A8 based OMAP3 [1], we found that we use CodeSourcery ARM toolchain [2], and the way we locally modified main Makefile to use this toolchain is most probably incompatible with mainline.

Please find below some diffs what we did locally.

We now like to discuss/ask what's the best way to align this with mainline to be able to submit OMAP3 patches?

Any hints or proposals?

Many thanks,

Dirk

[1]
http://www.sakoman.net/cgi-bin/gitweb.cgi?p=u-boot-omap3.git;a=summary
('common' branch)

[2] http://www.codesourcery.com/gnu_toolchains/arm/portal/release313

Relevant parts of OMAP3 patch we talk about here (most probably reformated cause of copy & paste to mailtool, so just for discussion. Final patches will be sent by git-send-mail). Note the -lgcc_eh which seems to be CodeSourcery specific, and the -march=armv7a in config.mk.

diff -uprN uboot_clean/Makefile uboot_beagle/Makefile

Makefile 2008-08-22 19:53:52.000000000 +0200 renamed from Makefile 2008-08-22 19:57:05.000000000 +0200 +1 -1
@@ -141,7 +141,7 @@ ifeq ($(ARCH),ppc)
 CROSS_COMPILE = ppc_8xx-
 endif
 ifeq ($(ARCH),arm)
-CROSS_COMPILE = arm-linux-
+CROSS_COMPILE = arm-none-linux-gnueabi-
 endif
 ifeq ($(ARCH),i386)
 CROSS_COMPILE = i386-linux-

Makefile 2008-08-22 19:53:52.000000000 +0200 LIBBOARD = board/$(BOARDDIR)/lib$(BOARD) · line 258

Quoted 7 lines
Makefile 2008-08-22 19:53:52.000000000 +0200 renamed from Makefile 2008-08-22 19:57:05.000000000 +0200 +1 -3
@@ -253,7 +253,7 @@ LIBBOARD = board/$(BOARDDIR)/lib$(BOARD)
 LIBBOARD := $(addprefix $(obj),$(LIBBOARD))
 
 # Add GCC lib
-PLATFORM_LIBS += -L $(shell dirname `$(CC) $(CFLAGS) 
-print-libgcc-file-name`) -lgcc
+PLATFORM_LIBS += -L $(shell dirname `$(CC) $(CFLAGS) 
-print-libgcc-file-name`) -lgcc -lgcc_eh

Thanks to the proposals here we fixed this. Just removing -lgcc_eh is the solution :)

Quoted 26 lines
Makefile 2008-08-22 19:53:52.000000000 +0200 renamed from Makefile 2008-08-22 19:57:05.000000000 +0200 +12 -0
 #########################################################################
+## ARM CORTEX Systems
+#########################################################################
+omap3_beagle_config :    unconfig
+    @$(MKCONFIG) $(@:_config=) arm omap3 beagle omap3
+
+omap3_overo_config :    unconfig
+    @$(MKCONFIG) $(@:_config=) arm omap3 overo omap3
+
+omap3_evm_config :    unconfig
+    @$(MKCONFIG) $(@:_config=) arm omap3 evm omap3
+
+#########################################################################
 ## XScale Systems

#########################################################################

diff -uprN uboot_clean/cpu/omap3/config.mk uboot_beagle/cpu/omap3/config.mk

cpu/omap3/config.mk 2008-08-22 19:52:20.000000000 +0200 renamed from cpu/omap3/config.mk 1970-01-01 01:00:00.000000000 +0100 +4 -0
@@ -0,0 +1,34 @@
+#
+# (C) Copyright 2002
+# Gary Jennejohn, DENX Software Engineering, <[email protected]>
+#

<cut GPL>

cpu/omap3/config.mk 2008-08-22 19:52:20.000000000 +0200

Quoted 5 lines
cpu/omap3/config.mk 2008-08-22 19:52:20.000000000 +0200 renamed from cpu/omap3/config.mk 1970-01-01 01:00:00.000000000 +0100 +5 -0
+#
+PLATFORM_RELFLAGS += -fno-strict-aliasing  -fno-common -ffixed-r8 \
+    -msoft-float
+
+PLATFORM_CPPFLAGS += -march=armv7a

Now, the remaining question is what to do with

+CROSS_COMPILE = arm-none-linux-gnueabi-

+PLATFORM_CPPFLAGS += -march=armv7a

we still have above.

Checking our code, it seems we need -march=armv7a. Else one file wouldn't compile any more. E.g. replacing armv7a with armv4 results in

- a lot of warnings "warning: target CPU does not support interworking"

- start.S compilation in our patch fails:

start.S: Assembler messages:
start.S:466: Error: selected processor does not support isb' start.S:475: Error: selected processor does not support clz r5,r4' start.S:500: Error: selected processor does not support `isb'

Possible solutions:

a) Post patch without modifying CROSS_COMPILE, resulting in usage of arm-linux-. With this, we would locally overwrite CROSS_COMPILE at command line with toolchain we like. I'm not sure if the standard arm-linux- toolchain used for "make all" supports -march=armv7a, though.

b) Introduce something like new

ifeq ($(ARCH),cortex-arm)
CROSS_COMPILE = arm-none-linux-gnueabi-
endif

I don't know if this would be accepted and how to do it cleanly, though.

c) More?

Any hints and proposals are welcome!

Thanks,

Dirk

#6 lore raw

Dear Dirk,

In message <[email protected]> you wrote:
...

Quoted 11 lines

Now, the remaining question is what to do with

(quoted diff) +2 -0
+CROSS_COMPILE = arm-none-linux-gnueabi-
 
+PLATFORM_CPPFLAGS += -march=armv7a

we still have above.

Checking our code, it seems we need -march=armv7a. Else one file wouldn't compile any more. E.g. replacing armv7a with armv4 results in

Quoted 8 lines

- a lot of warnings "warning: target CPU does not support interworking"

- start.S compilation in our patch fails:

start.S: Assembler messages:
start.S:466: Error: selected processor does not support isb' start.S:475: Error: selected processor does not support clz r5,r4' start.S:500: Error: selected processor does not support `isb'

Is it really necessary to use these instructions, or would it be possible to modify the code to use other (less optimal, but generally available) instructions?

Quoted 6 lines

Possible solutions:

a) Post patch without modifying CROSS_COMPILE, resulting in usage of arm-linux-. With this, we would locally overwrite CROSS_COMPILE at command line with toolchain we like. I'm not sure if the standard arm-linux- toolchain used for "make all" supports -march=armv7a, though.

Assume it doesn't. I think U-Boot code should make as little requirements on the toolchain as possible. Of course there emay be situations where it cannot be avoided - but if all we win is a certain level of better optimization in the code, I tend to decide in favour of less restrictive build environments.

Quoted 7 lines

b) Introduce something like new

ifeq ($(ARCH),cortex-arm)
CROSS_COMPILE = arm-none-linux-gnueabi-
endif

I don't know if this would be accepted and how to do it cleanly, though.

This is just another way to express the same problem.

Quoted 1 line

c) More?

Try to modify the code such that any of the many ARM tool chains floating around can build your code.

Best regards,

Wolfgang Denk

Signature · 5 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
I'm frequently appalled by the low regard you Earthmen have for life.
	-- Spock, "The Galileo Seven", stardate 2822.3
#7 lore raw
Quoted 20 lines · Wolfgang Denk

Dear Dirk,

In message <[email protected]> you wrote:
...

Quoted 6 lines

Now, the remaining question is what to do with

(quoted diff) +2 -0
+CROSS_COMPILE = arm-none-linux-gnueabi-
 
+PLATFORM_CPPFLAGS += -march=armv7a
Quoted 6 lines

we still have above.

Checking our code, it seems we need -march=armv7a. Else one file wouldn't compile any more. E.g. replacing armv7a with armv4 results in

- a lot of warnings "warning: target CPU does not support

interworking"

Quoted 3 lines

- start.S compilation in our patch fails:

Quoted 8 lines
Quoted 4 lines

start.S: Assembler messages:
start.S:466: Error: selected processor does not support isb' start.S:475: Error: selected processor does not support clz r5,r4' start.S:500: Error: selected processor does not support `isb'

Is it really necessary to use these instructions, or would it be possible to modify the code to use other (less optimal, but generally available) instructions?

I would vote for using generic ARM set. Even though isb is somehow similar to ppc isync and there is no direct equivalent in generic ARM set.

There is also no merit in optimizing U-Boot code -- gain is usually miniscule and not worth a trouble of building and using a special toolchain vs a regular one. U-Boot is not a critical piece of software performancewise -- it is only used briefly so it doesn't matter if it runs .05% slower. It won't reduce the resulting binary size noticeably either.

---
******************************************************************
* KSI at home KOI8 Net < > The impossible we do immediately. *
* Las Vegas NV, USA < > Miracles require 24-hour notice. *
******************************************************************

#8 lore raw
In reply to Dirk Behme
Quoted 32 lines · Dirk Behme

While preparing U-Boot patches for ARM Cortex A8 based OMAP3 [1], we found that we use CodeSourcery ARM toolchain [2], and the way we locally modified main Makefile to use this toolchain is most probably incompatible with mainline.

Please find below some diffs what we did locally.

We now like to discuss/ask what's the best way to align this with mainline to be able to submit OMAP3 patches?

Any hints or proposals?

Many thanks,

Dirk

[1]
http://www.sakoman.net/cgi-bin/gitweb.cgi?p=u-boot-omap3.git;a=summary
('common' branch)

[2] http://www.codesourcery.com/gnu_toolchains/arm/portal/release313

Relevant parts of OMAP3 patch we talk about here (most probably reformated cause of copy & paste to mailtool, so just for discussion. Final patches will be sent by git-send-mail). Note the -lgcc_eh which seems to be CodeSourcery specific, and the -march=armv7a in config.mk.

diff -uprN uboot_clean/Makefile uboot_beagle/Makefile

Makefile ifeq ($(ARCH),ppc) · line 144

Quoted 5 lines
Makefile +1 -1
@@ -141,7 +141,7 @@ ifeq ($(ARCH),ppc)
  CROSS_COMPILE = ppc_8xx-
  endif
  ifeq ($(ARCH),arm)
-CROSS_COMPILE = arm-linux-
+CROSS_COMPILE = arm-none-linux-gnueabi-

please do not change it

you specify it at runtime

btw: you can use arm-elf- toolchains and others to compile u-boot so why do you want to modify the default one?

Makefile LIBBOARD = board/$(BOARDDIR)/lib$(BOARD) · line 257

Quoted 12 lines
Makefile +1 -3
  endif
  ifeq ($(ARCH),i386)
  CROSS_COMPILE = i386-linux-
@@ -253,7 +253,7 @@ LIBBOARD = board/$(BOARDDIR)/lib$(BOARD)
  LIBBOARD := $(addprefix $(obj),$(LIBBOARD))
 
  # Add GCC lib
-PLATFORM_LIBS += -L $(shell dirname `$(CC) $(CFLAGS) 
-print-libgcc-file-name`) -lgcc
+PLATFORM_LIBS += -L $(shell dirname `$(CC) $(CFLAGS) 
-print-libgcc-file-name`) -lgcc -lgcc_eh
 

please do it in a fix commit

Makefile SMN42_config : unconfig · line 2649

Quoted 12 lines
Makefile +5 -0
  # The "tools" are needed early, so put this first
  # Don't include stuff already done in $(LIBS)
@@ -2641,6 +2641,18 @@ SMN42_config	:	unconfig
  	@$(MKCONFIG) $(@:_config=) arm arm720t SMN42 siemens lpc2292
 
 
 #########################################################################
+## ARM CORTEX Systems
+#########################################################################
+omap3_beagle_config :	unconfig
+	@$(MKCONFIG) $(@:_config=) arm omap3 beagle omap3
+

add it when you add each board (1 board => 1 patch)

Quoted 21 lines
Makefile +7 -0
+omap3_overo_config :	unconfig
+	@$(MKCONFIG) $(@:_config=) arm omap3 overo omap3
+
+omap3_evm_config :	unconfig
+	@$(MKCONFIG) $(@:_config=) arm omap3 evm omap3
+
+#########################################################################
  ## XScale Systems
 

#########################################################################

diff -uprN uboot_clean/cpu/omap3/config.mk
uboot_beagle/cpu/omap3/config.mk

cpu/omap3/config.mk +4 -0
@@ -0,0 +1,34 @@
+#
+# (C) Copyright 2002
+# Gary Jennejohn, DENX Software Engineering, <[email protected]>
+#

<cut GPL>

cpu/omap3/config.mk

Quoted 5 lines
cpu/omap3/config.mk +5 -0
+#
+PLATFORM_RELFLAGS += -fno-strict-aliasing  -fno-common -ffixed-r8 \
+	-msoft-float
+
+PLATFORM_CPPFLAGS += -march=armv7a

Do you really need armv7a march?

Could you explain why?

Best Regards,
J.

author
#9 lore raw
Quoted 42 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 31 lines · Dirk Behme

While preparing U-Boot patches for ARM Cortex A8 based OMAP3 [1], we found that we use CodeSourcery ARM toolchain [2], and the way we locally modified main Makefile to use this toolchain is most probably incompatible with mainline.

Please find below some diffs what we did locally.

We now like to discuss/ask what's the best way to align this with mainline to be able to submit OMAP3 patches?

Any hints or proposals?

Many thanks,

Dirk

[1]
http://www.sakoman.net/cgi-bin/gitweb.cgi?p=u-boot-omap3.git;a=summary
('common' branch)

[2] http://www.codesourcery.com/gnu_toolchains/arm/portal/release313

Relevant parts of OMAP3 patch we talk about here (most probably reformated cause of copy & paste to mailtool, so just for discussion. Final patches will be sent by git-send-mail). Note the -lgcc_eh which seems to be CodeSourcery specific, and the -march=armv7a in config.mk.

diff -uprN uboot_clean/Makefile uboot_beagle/Makefile

Makefile ifeq ($(ARCH),ppc) · line 144

Quoted 5 lines
Makefile +1 -1
@@ -141,7 +141,7 @@ ifeq ($(ARCH),ppc)
 CROSS_COMPILE = ppc_8xx-
 endif
 ifeq ($(ARCH),arm)
-CROSS_COMPILE = arm-linux-
+CROSS_COMPILE = arm-none-linux-gnueabi-

please do not change it

Quoted 1 line

you specify it at runtime

Yes, as recommended by Wolfgang and ksi, too, we will do this. Thanks to all proposing this!

Quoted 2 lines

btw: you can use arm-elf- toolchains and others to compile u-boot so why do you want to modify the default one?

The original source code from TI we used to start for OMAP3 patch just used it (most probably to have armv7a support). We will change this.

Quoted 6 lines
Quoted 6 lines
Makefile +0 -0
 endif
 ifeq ($(ARCH),i386)
 CROSS_COMPILE = i386-linux-
@@ -253,7 +253,7 @@ LIBBOARD = board/$(BOARDDIR)/lib$(BOARD)
 LIBBOARD := $(addprefix $(obj),$(LIBBOARD))
 
Quoted 8 lines

Makefile LIBBOARD = board/$(BOARDDIR)/lib$(BOARD) · line 257

Quoted 6 lines
Makefile +1 -3
 # Add GCC lib
-PLATFORM_LIBS += -L $(shell dirname `$(CC) $(CFLAGS) 
-print-libgcc-file-name`) -lgcc
+PLATFORM_LIBS += -L $(shell dirname `$(CC) $(CFLAGS) 
-print-libgcc-file-name`) -lgcc -lgcc_eh
 

please do it in a fix commit

Yes, we already fixed this in the OMAP3 preparation git.

Quoted 6 lines
Quoted 6 lines
Makefile +0 -0
 # The "tools" are needed early, so put this first
 # Don't include stuff already done in $(LIBS)
@@ -2641,6 +2641,18 @@ SMN42_config	:	unconfig
 	@$(MKCONFIG) $(@:_config=) arm arm720t SMN42 siemens lpc2292
 
 
Quoted 8 lines

Makefile SMN42_config : unconfig · line 2649

Quoted 6 lines
Makefile +5 -0
 #########################################################################
+## ARM CORTEX Systems
+#########################################################################
+omap3_beagle_config :	unconfig
+	@$(MKCONFIG) $(@:_config=) arm omap3 beagle omap3
+

add it when you add each board (1 board => 1 patch)

Yes, okay.

Quoted 21 lines
Quoted 21 lines
Makefile +7 -0
+omap3_overo_config :	unconfig
+	@$(MKCONFIG) $(@:_config=) arm omap3 overo omap3
+
+omap3_evm_config :	unconfig
+	@$(MKCONFIG) $(@:_config=) arm omap3 evm omap3
+
+#########################################################################
 ## XScale Systems
 

#########################################################################

diff -uprN uboot_clean/cpu/omap3/config.mk
uboot_beagle/cpu/omap3/config.mk

cpu/omap3/config.mk +4 -0
@@ -0,0 +1,34 @@
+#
+# (C) Copyright 2002
+# Gary Jennejohn, DENX Software Engineering, <[email protected]>
+#

<cut GPL>

Quoted 8 lines

cpu/omap3/config.mk

Quoted 5 lines
cpu/omap3/config.mk +5 -0
+#
+PLATFORM_RELFLAGS += -fno-strict-aliasing  -fno-common -ffixed-r8 \
+	-msoft-float
+
+PLATFORM_CPPFLAGS += -march=armv7a

Do you really need armv7a march?

We have to rewrite at least start,S, but yes, we will to this. So we don't really need this.

Quoted 1 line

Could you explain why?

The U-Boot code we got from TI for OMAP3 uses arm-none-linux-gnueabi-
-march=armv7a. While cleaning this code for upstream submission, we
found this and now get the answer from you, Wolfgang and ksi how to handle this properly.

Many thanks for your help

Dirk