Skip to contentSkip to conversation

Mips AS call fixed.

PATCH New Rodolfo Giometti 2 participants 3 messages Apr 10, 2006 – Apr 11, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Mips AS call fixed.

Hello,

here a patch who fixes mips AS call.

Ciao,

Rodolfo

Signature · 10 lines
GNU/Linux Solutions                  e-mail:    giometti at enneenne.com
Linux Device Driver                             giometti at gnudd.com
Embedded Systems                     		giometti at linux.it
UNIX programming                     phone:     +39 349 2432127
-------------- next part --------------
diff-tree 2723e70eed7268333fc38566237b7a3b27749312 (from 3a5e21881a194f4d4e053be8410d82a2458e8544)
Author: Rodolfo Giometti <[email protected]>
Date:   Tue Apr 11 00:26:24 2006 +0200

    Mips AS call fixed.
cpu/mips/config.mk +1 -1
index c357615..885dc7f 100644
@@ -21,7 +21,7 @@
 # MA 02111-1307 USA
 #
 v=$(shell \
-mips-linux-as --version|grep "GNU assembler"|awk '{print $$3}'|awk -F . '{print $$2}')
+$(AS) --version|grep "GNU assembler"|awk '{print $$3}'|awk -F . '{print $$2}')
 MIPSFLAGS=$(shell \
 if [ "$v" -lt "14" ]; then \
 	echo "-mcpu=4kc"; \
#1 lore raw

PATCH 1/1 Mips AS call fixed.

Hi

Quoted 1 line

here a patch who fixes mips AS call.

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.

BR,
Matej

#2 lore raw

PATCH 1/1 Mips AS call fixed.

Quoted 9 lines · Matej Kupljen

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; \

Quoted 1 line

$${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:

examples/Makefile +1 -5
index 62c4e6d..30ce77d 100644
@@ -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

Signature · 11 lines
GNU/Linux Solutions                  e-mail:    giometti at enneenne.com
Linux Device Driver                             giometti at gnudd.com
Embedded Systems                     		[email protected]
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