* [U-Boot] [RFC] ARM: Toolchain configuration for Cortex A8 based OMAP3?
@ 2008-08-23 6:39 Dirk Behme
2008-08-23 14:16 ` Woodruff, Richard
` (2 more replies)
0 siblings, 3 replies; 10+ messages in thread
From: Dirk Behme @ 2008-08-23 6:39 UTC (permalink / raw)
To: u-boot
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
--- uboot_clean/Makefile 2008-08-22 19:57:05.000000000 +0200
+++ uboot_beagle/Makefile 2008-08-22 19:53:52.000000000 +0200
@@ -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
--- uboot_clean/cpu/omap3/config.mk 1970-01-01 01:00:00.000000000 +0100
+++ uboot_beagle/cpu/omap3/config.mk 2008-08-22 19:52:20.000000000 +0200
@@ -0,0 +1,34 @@
+#
+# (C) Copyright 2002
+# Gary Jennejohn, DENX Software Engineering, <gj@denx.de>
+#
<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,))
^ permalink raw reply [flat|nested] 10+ messages in thread* [U-Boot] [RFC] ARM: Toolchain configuration for Cortex A8 based OMAP3?
2008-08-23 6:39 [U-Boot] [RFC] ARM: Toolchain configuration for Cortex A8 based OMAP3? Dirk Behme
@ 2008-08-23 14:16 ` Woodruff, Richard
2008-08-23 18:31 ` Dirk Behme
2008-08-27 16:38 ` Dirk Behme
2008-08-27 22:38 ` Jean-Christophe PLAGNIOL-VILLARD
2 siblings, 1 reply; 10+ messages in thread
From: Woodruff, Richard @ 2008-08-23 14:16 UTC (permalink / raw)
To: u-boot
Hi Dirk,
> 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
> --- uboot_clean/Makefile 2008-08-22 19:57:05.000000000 +0200
> +++ uboot_beagle/Makefile 2008-08-22 19:53:52.000000000 +0200
> @@ -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.
> 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.
> +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,))
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.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [U-Boot] [RFC] ARM: Toolchain configuration for Cortex A8 based OMAP3?
2008-08-23 14:16 ` Woodruff, Richard
@ 2008-08-23 18:31 ` Dirk Behme
2008-08-23 19:42 ` ksi at koi8.net
2008-08-26 15:54 ` Scott Wood
0 siblings, 2 replies; 10+ messages in thread
From: Dirk Behme @ 2008-08-23 18:31 UTC (permalink / raw)
To: u-boot
Woodruff, Richard wrote:
> Hi Dirk,
>
>>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
>>--- uboot_clean/Makefile 2008-08-22 19:57:05.000000000 +0200
>>+++ uboot_beagle/Makefile 2008-08-22 19:53:52.000000000 +0200
>>@@ -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.
>
>> 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.
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?
>>+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,))
>
> 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.
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'
> 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
^ permalink raw reply [flat|nested] 10+ messages in thread
* [U-Boot] [RFC] ARM: Toolchain configuration for Cortex A8 based OMAP3?
2008-08-23 18:31 ` Dirk Behme
@ 2008-08-23 19:42 ` ksi at koi8.net
2008-08-26 15:54 ` Scott Wood
1 sibling, 0 replies; 10+ messages in thread
From: ksi at koi8.net @ 2008-08-23 19:42 UTC (permalink / raw)
To: u-boot
On Sat, 23 Aug 2008, Dirk Behme wrote:
> Woodruff, Richard wrote:
>> Hi Dirk,
>>
>>> 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
>>> --- uboot_clean/Makefile 2008-08-22 19:57:05.000000000 +0200
>>> +++ uboot_beagle/Makefile 2008-08-22 19:53:52.000000000 +0200
>>> @@ -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.
>>
>>> 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.
>
> 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. *
******************************************************************
^ permalink raw reply [flat|nested] 10+ messages in thread
* [U-Boot] [RFC] ARM: Toolchain configuration for Cortex A8 based OMAP3?
2008-08-23 18:31 ` Dirk Behme
2008-08-23 19:42 ` ksi at koi8.net
@ 2008-08-26 15:54 ` Scott Wood
1 sibling, 0 replies; 10+ messages in thread
From: Scott Wood @ 2008-08-26 15:54 UTC (permalink / raw)
To: u-boot
On Sat, Aug 23, 2008 at 08:31:40PM +0200, Dirk Behme wrote:
> 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
^ permalink raw reply [flat|nested] 10+ messages in thread
* [U-Boot] [RFC] ARM: Toolchain configuration for Cortex A8 based OMAP3?
2008-08-23 6:39 [U-Boot] [RFC] ARM: Toolchain configuration for Cortex A8 based OMAP3? Dirk Behme
2008-08-23 14:16 ` Woodruff, Richard
@ 2008-08-27 16:38 ` Dirk Behme
2008-08-27 19:56 ` Wolfgang Denk
2008-08-27 22:38 ` Jean-Christophe PLAGNIOL-VILLARD
2 siblings, 1 reply; 10+ messages in thread
From: Dirk Behme @ 2008-08-27 16:38 UTC (permalink / raw)
To: u-boot
Dirk Behme wrote:
>
> 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
> --- uboot_clean/Makefile 2008-08-22 19:57:05.000000000 +0200
> +++ uboot_beagle/Makefile 2008-08-22 19:53:52.000000000 +0200
> @@ -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
Thanks to the proposals here we fixed this. Just removing -lgcc_eh is
the solution :)
> #########################################################################
> +## 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
> --- uboot_clean/cpu/omap3/config.mk 1970-01-01 01:00:00.000000000 +0100
> +++ uboot_beagle/cpu/omap3/config.mk 2008-08-22 19:52:20.000000000 +0200
> @@ -0,0 +1,34 @@
> +#
> +# (C) Copyright 2002
> +# Gary Jennejohn, DENX Software Engineering, <gj@denx.de>
> +#
> <cut GPL>
> +#
> +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
^ permalink raw reply [flat|nested] 10+ messages in thread* [U-Boot] [RFC] ARM: Toolchain configuration for Cortex A8 based OMAP3?
2008-08-27 16:38 ` Dirk Behme
@ 2008-08-27 19:56 ` Wolfgang Denk
2008-08-27 20:13 ` ksi at koi8.net
0 siblings, 1 reply; 10+ messages in thread
From: Wolfgang Denk @ 2008-08-27 19:56 UTC (permalink / raw)
To: u-boot
Dear Dirk,
In message <48B5831E.3070002@googlemail.com> you wrote:
...
> 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'
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?
> 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.
> 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.
> 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
--
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
^ permalink raw reply [flat|nested] 10+ messages in thread
* [U-Boot] [RFC] ARM: Toolchain configuration for Cortex A8 based OMAP3?
2008-08-27 19:56 ` Wolfgang Denk
@ 2008-08-27 20:13 ` ksi at koi8.net
0 siblings, 0 replies; 10+ messages in thread
From: ksi at koi8.net @ 2008-08-27 20:13 UTC (permalink / raw)
To: u-boot
On Wed, 27 Aug 2008, Wolfgang Denk wrote:
> Dear Dirk,
>
> In message <48B5831E.3070002@googlemail.com> you wrote:
> ...
>> 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'
>
> 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. *
******************************************************************
^ permalink raw reply [flat|nested] 10+ messages in thread
* [U-Boot] [RFC] ARM: Toolchain configuration for Cortex A8 based OMAP3?
2008-08-23 6:39 [U-Boot] [RFC] ARM: Toolchain configuration for Cortex A8 based OMAP3? Dirk Behme
2008-08-23 14:16 ` Woodruff, Richard
2008-08-27 16:38 ` Dirk Behme
@ 2008-08-27 22:38 ` Jean-Christophe PLAGNIOL-VILLARD
2008-08-28 14:00 ` Dirk Behme
2 siblings, 1 reply; 10+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2008-08-27 22:38 UTC (permalink / raw)
To: u-boot
On 08:39 Sat 23 Aug , Dirk Behme wrote:
>
> 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
> --- uboot_clean/Makefile 2008-08-22 19:57:05.000000000 +0200
> +++ uboot_beagle/Makefile 2008-08-22 19:53:52.000000000 +0200
> @@ -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?
> 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
> # 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)
> +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
> --- uboot_clean/cpu/omap3/config.mk 1970-01-01 01:00:00.000000000 +0100
> +++ uboot_beagle/cpu/omap3/config.mk 2008-08-22 19:52:20.000000000 +0200
> @@ -0,0 +1,34 @@
> +#
> +# (C) Copyright 2002
> +# Gary Jennejohn, DENX Software Engineering, <gj@denx.de>
> +#
> <cut GPL>
> +#
> +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.
^ permalink raw reply [flat|nested] 10+ messages in thread* [U-Boot] [RFC] ARM: Toolchain configuration for Cortex A8 based OMAP3?
2008-08-27 22:38 ` Jean-Christophe PLAGNIOL-VILLARD
@ 2008-08-28 14:00 ` Dirk Behme
0 siblings, 0 replies; 10+ messages in thread
From: Dirk Behme @ 2008-08-28 14:00 UTC (permalink / raw)
To: u-boot
Jean-Christophe PLAGNIOL-VILLARD wrote:
> On 08:39 Sat 23 Aug , Dirk Behme wrote:
>
>>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
>>--- uboot_clean/Makefile 2008-08-22 19:57:05.000000000 +0200
>>+++ uboot_beagle/Makefile 2008-08-22 19:53:52.000000000 +0200
>>@@ -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
Yes, as recommended by Wolfgang and ksi, too, we will do this. Thanks
to all proposing this!
> 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.
>> 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
Yes, we already fixed this in the OMAP3 preparation git.
>> # 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)
Yes, okay.
>>+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
>>--- uboot_clean/cpu/omap3/config.mk 1970-01-01 01:00:00.000000000 +0100
>>+++ uboot_beagle/cpu/omap3/config.mk 2008-08-22 19:52:20.000000000 +0200
>>@@ -0,0 +1,34 @@
>>+#
>>+# (C) Copyright 2002
>>+# Gary Jennejohn, DENX Software Engineering, <gj@denx.de>
>>+#
>><cut GPL>
>>+#
>>+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.
> 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
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2008-08-28 14:00 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-23 6:39 [U-Boot] [RFC] ARM: Toolchain configuration for Cortex A8 based OMAP3? Dirk Behme
2008-08-23 14:16 ` Woodruff, Richard
2008-08-23 18:31 ` Dirk Behme
2008-08-23 19:42 ` ksi at koi8.net
2008-08-26 15:54 ` Scott Wood
2008-08-27 16:38 ` Dirk Behme
2008-08-27 19:56 ` Wolfgang Denk
2008-08-27 20:13 ` ksi at koi8.net
2008-08-27 22:38 ` Jean-Christophe PLAGNIOL-VILLARD
2008-08-28 14:00 ` Dirk Behme
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox