public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Rodolfo Giometti <giometti@linux.it>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] [PATCH] Mips AS call fixed.
Date: Tue, 11 Apr 2006 11:55:10 +0200	[thread overview]
Message-ID: <20060411095510.GD21613@enneenne.com> (raw)
In-Reply-To: <1144739832.7197.10.camel@localhost.localdomain>

On Tue, Apr 11, 2006 at 09:17:12AM +0200, Matej Kupljen wrote:
> 
> I posted a new version of config.mk on August 24. 
> Please see this post:
> http://sourceforge.net/mailarchive/message.php?msg_id=12736269
> 
> This config.mk tries to solve the big/little endian
> toolchain problems. It works for me, but Wolfgang did
> not include it in the official tree.
> Maybe you can test it, if it works for you.

Yes it works... even if I made some little modifications. Here my
proposal:

v=$(shell \
$(AS) --version|grep "GNU assembler"|awk '{print $$3}'|awk -F . '{print $$2}')
MIPSCFLAGS=$(shell \
if [ "$v" -lt "14" ]; then \
        echo "-mcpu=4kc"; \
else \
        echo "-march=4kc -mtune=4kc"; \
fi)

MIPSCFLAGS += -mabicalls

# Check the default ENDIANNESS of the cross compiler
e=$(shell \
TMPDIR=`mktemp -d`; \
trap 'rm -fr ${TMPDIR}' 0 1 2 3 15; \
>$${TMPDIR}/foo.c; \
${CROSS_COMPILE}gcc -c $${TMPDIR}/foo.c -o $${TMPDIR}/foo.o; \
readelf -h $${TMPDIR}/foo.o | \
sed -n 's/.*Data:.* \([^ ][^ ]*\) endian/\1/p'; \
)

ifneq ($e,"little")
MIPSLDFLAGS += -EL
else
MIPSLDFLAGS += -EB
endif

PLATFORM_CPPFLAGS += $(MIPSCFLAGS)
PLATFORM_LDFLAGS += $(MIPSLDFLAGS)

As you can see I call AS with "$(AS)" and not with
"$(CROSS_COMPILE)as" since variable "AS" is already defined and I
added "MIPSCFLAGS" and "MIPSLDFLAGS" where I specify "-EL" or "-EB".

Please, note also that "-Wa,-allow_branch_to_undefined" is no more
necessary due my patch
"http://sourceforge.net/mailarchive/message.php?msg_id=13328221".

Also I suggest this patch for the examples directory:

diff --git a/examples/Makefile b/examples/Makefile
index 62c4e6d..30ce77d 100644
--- a/examples/Makefile
+++ b/examples/Makefile
@@ -100,10 +100,6 @@ SREC   += eepro100_eeprom.srec
 BIN    += eepro100_eeprom.bin eepro100_eeprom
 endif
 
-ifeq ($(BIG_ENDIAN),y)
-EX_LDFLAGS += -EB
-endif
-
 OBJS   = $(SREC:.srec=.o)
 
 LIB    = libstubs.a
@@ -129,7 +125,7 @@ $(LIB): .depend $(LIBOBJS)
        $(AR) crv $@ $(LIBOBJS)
 
 %:     %.o $(LIB)
-       $(LD) -g $(EX_LDFLAGS) -Ttext $(LOAD_ADDR) \
+       $(LD) -g $(PLATFORM_LDFLAGS) -Ttext $(LOAD_ADDR) \
                -o $@ -e $(<:.o=) $< $(LIB) \
                -L$(gcclibdir) -lgcc
 %.srec:        %

since endianess should be defined each time by "PLATFORM_LDFLAGS"
instead of "EX_LDFLAGS".

Ciao,

Rodolfo

-- 

GNU/Linux Solutions                  e-mail:    giometti at enneenne.com
Linux Device Driver                             giometti at gnudd.com
Embedded Systems                     		giometti@linux.it
UNIX programming                     phone:     +39 349 2432127
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.denx.de/pipermail/u-boot/attachments/20060411/eb00b730/attachment.pgp 

      reply	other threads:[~2006-04-11  9:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-10 22:28 [U-Boot-Users] [PATCH] Mips AS call fixed Rodolfo Giometti
2006-04-11  7:17 ` Matej Kupljen
2006-04-11  9:55   ` Rodolfo Giometti [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060411095510.GD21613@enneenne.com \
    --to=giometti@linux.it \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox