U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [RFC] fix break caused by new binutils
@ 2011-01-24 18:36 Víctor Manuel Jáquez Leal
  2011-01-24 18:56 ` Steve Sakoman
  0 siblings, 1 reply; 3+ messages in thread
From: Víctor Manuel Jáquez Leal @ 2011-01-24 18:36 UTC (permalink / raw)
  To: u-boot

According with this discussion [1] the new assemblers need
-march=armv7-a+sec on command line or .arch_extension sec inline to
enable use of the smc instruction.

In the sakoman's u-boot repository there is branch for the omap4 [2]
which uses the smc instruction with the -march=armv7-a, and it will
not compile with the latest binutils (2.21)

This patch fix that problem adding conditionally the armv7-a+sec the
march. In order to do this the patch adds as-instr which checks the
latter to enable the correct -march in AFLAGS for files that use smc.

This patch must be applied on top of
git://www.sakoman.com/git/u-boot.git;branch=omap4-exp

1. https://bugs.launchpad.net/ubuntu/+source/gcc-4.5/+bug/669912
2. http://www.sakoman.com/cgi-bin/gitweb.cgi?p=u-boot.git;a=shortlog;h=refs/heads/omap4-exp

Signed-off-by: V?ctor Manuel J?quez Leal <vjaquez@igalia.com>
---
 arch/arm/cpu/armv7/omap4/Makefile |    2 ++
 config.mk                         |    9 +++++++++
 2 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/arch/arm/cpu/armv7/omap4/Makefile b/arch/arm/cpu/armv7/omap4/Makefile
index 987dc9d..9dc2b64 100644
--- a/arch/arm/cpu/armv7/omap4/Makefile
+++ b/arch/arm/cpu/armv7/omap4/Makefile
@@ -26,6 +26,8 @@ include $(TOPDIR)/config.mk
 LIB	=  $(obj)lib$(SOC).o
 
 SOBJS	+= lowlevel_init.o
+plus_sec := $(call as-instr,.arch_extension sec,+sec)
+lowlevel_init.o: AFLAGS += -Wa,-march=armv7-a$(plus_sec)
 
 COBJS	+= board.o
 COBJS	+= mem.o
diff --git a/config.mk b/config.mk
index c6d6f7b..8d86860 100644
--- a/config.mk
+++ b/config.mk
@@ -266,3 +266,12 @@ cmd_link_o_target = $(if $(strip $1),\
 		      rm -f $@; $(AR) rcs $@ )
 
 #########################################################################
+
+# Tries to compile an assembly instruction
+as-instr = $(shell if echo -e "$(1)" | \
+            $(CC) $(AFLAGS) -c -xassembler - \
+             -o $(TMPOUT)astest$$$$.out > /dev/null 2>&1; \
+         then rm $(TMPOUT)astest$$$$.out; echo "$(2)"; \
+         else echo "$(3)"; fi)
+
+#########################################################################
-- 
1.7.0.2

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [U-Boot] [RFC] fix break caused by new binutils
  2011-01-24 18:36 [U-Boot] [RFC] fix break caused by new binutils Víctor Manuel Jáquez Leal
@ 2011-01-24 18:56 ` Steve Sakoman
  2011-01-24 19:14   ` Wolfgang Denk
  0 siblings, 1 reply; 3+ messages in thread
From: Steve Sakoman @ 2011-01-24 18:56 UTC (permalink / raw)
  To: u-boot

On Mon, 2011-01-24 at 19:36 +0100, V?ctor Manuel J?quez Leal wrote:
> According with this discussion [1] the new assemblers need
> -march=armv7-a+sec on command line or .arch_extension sec inline to
> enable use of the smc instruction.
> 
> In the sakoman's u-boot repository there is branch for the omap4 [2]
> which uses the smc instruction with the -march=armv7-a, and it will
> not compile with the latest binutils (2.21)

Just to clarify -- my branch has Aneesh's "armv7: adapt omap4 to the new
cache maintenance framework" patch series in it.

So this issue will arise only when Aneesh's patch series is applied.

Perhaps this fix could be incorporated into Aneesh's next revision??

Steve

> This patch fix that problem adding conditionally the armv7-a+sec the
> march. In order to do this the patch adds as-instr which checks the
> latter to enable the correct -march in AFLAGS for files that use smc.
> 
> This patch must be applied on top of
> git://www.sakoman.com/git/u-boot.git;branch=omap4-exp
> 
> 1. https://bugs.launchpad.net/ubuntu/+source/gcc-4.5/+bug/669912
> 2. http://www.sakoman.com/cgi-bin/gitweb.cgi?p=u-boot.git;a=shortlog;h=refs/heads/omap4-exp
> 
> Signed-off-by: V?ctor Manuel J?quez Leal <vjaquez@igalia.com>
> ---
>  arch/arm/cpu/armv7/omap4/Makefile |    2 ++
>  config.mk                         |    9 +++++++++
>  2 files changed, 11 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/cpu/armv7/omap4/Makefile b/arch/arm/cpu/armv7/omap4/Makefile
> index 987dc9d..9dc2b64 100644
> --- a/arch/arm/cpu/armv7/omap4/Makefile
> +++ b/arch/arm/cpu/armv7/omap4/Makefile
> @@ -26,6 +26,8 @@ include $(TOPDIR)/config.mk
>  LIB	=  $(obj)lib$(SOC).o
>  
>  SOBJS	+= lowlevel_init.o
> +plus_sec := $(call as-instr,.arch_extension sec,+sec)
> +lowlevel_init.o: AFLAGS += -Wa,-march=armv7-a$(plus_sec)
>  
>  COBJS	+= board.o
>  COBJS	+= mem.o
> diff --git a/config.mk b/config.mk
> index c6d6f7b..8d86860 100644
> --- a/config.mk
> +++ b/config.mk
> @@ -266,3 +266,12 @@ cmd_link_o_target = $(if $(strip $1),\
>  		      rm -f $@; $(AR) rcs $@ )
>  
>  #########################################################################
> +
> +# Tries to compile an assembly instruction
> +as-instr = $(shell if echo -e "$(1)" | \
> +            $(CC) $(AFLAGS) -c -xassembler - \
> +             -o $(TMPOUT)astest$$$$.out > /dev/null 2>&1; \
> +         then rm $(TMPOUT)astest$$$$.out; echo "$(2)"; \
> +         else echo "$(3)"; fi)
> +
> +#########################################################################

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot] [RFC] fix break caused by new binutils
  2011-01-24 18:56 ` Steve Sakoman
@ 2011-01-24 19:14   ` Wolfgang Denk
  0 siblings, 0 replies; 3+ messages in thread
From: Wolfgang Denk @ 2011-01-24 19:14 UTC (permalink / raw)
  To: u-boot

Dear Steve Sakoman,

In message <1295895368.1999.14.camel@quadra> you wrote:
> On Mon, 2011-01-24 at 19:36 +0100, V?ctor Manuel J?quez Leal wrote:
> > According with this discussion [1] the new assemblers need
> > -march=armv7-a+sec on command line or .arch_extension sec inline to
> > enable use of the smc instruction.
> > 
> > In the sakoman's u-boot repository there is branch for the omap4 [2]
> > which uses the smc instruction with the -march=armv7-a, and it will
> > not compile with the latest binutils (2.21)
> 
> Just to clarify -- my branch has Aneesh's "armv7: adapt omap4 to the new
> cache maintenance framework" patch series in it.
> 
> So this issue will arise only when Aneesh's patch series is applied.

I have a bsic question: do we really need  -march=armv7-a  at all in
U-Boot?  What is it good for?

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
"It may be that our role on this planet is not to worship God but  to
create him."                                       - Arthur C. Clarke

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-01-24 19:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-24 18:36 [U-Boot] [RFC] fix break caused by new binutils Víctor Manuel Jáquez Leal
2011-01-24 18:56 ` Steve Sakoman
2011-01-24 19:14   ` Wolfgang Denk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox