Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2013-06

why is MIPS not equivalent to MIPSEB

3 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Dennis

I was trying to build a cross compiler by following the MIPS_port doc but since I needed MIPS bid endian version instead, I changed their example of MIPSel into MIPS which seems the correct way in dowloading binutils and specifying TARGET CPU.

However, after many days of struggling, it appears that the correct spelling regarded by the crosscompiler for MIPS big endian is actually MIPSEB instead of MIPS!!!
And that probably produced a lot of my earlier problems. I had to rename all the names of ld and as files from mips to mipseb to have the compiler stop complaining.

Can someone tell me why in some areas of fpc, it is MIPS and else MIPSEB?

Dennis

Mark Morgan Lloyd
to Dennis
Dennis wrote 13 lines
I was trying to build a cross compiler by following the MIPS_port doc but since I needed MIPS bid endian version instead, I changed their example of MIPSel into MIPS which seems the correct way in dowloading binutils and specifying TARGET CPU. However, after many days of struggling, it appears that the correct spelling regarded by the crosscompiler for MIPS big endian is actually MIPSEB instead of MIPS!!! And that probably produced a lot of my earlier problems. I had to rename all the names of ld and as files from mips to mipseb to have the compiler stop complaining. Can someone tell me why in some areas of fpc, it is MIPS and else MIPSEB?

The first thing I want to point out is that you have to be very careful with the "triplet" that describes the binutils tools. There's a certain amount of guesswork involved, but once you've got a candidate there's a tool in the binutils sources to make sure that it's viable.

As far as mips vs mipseb in the FPC sources are concerned:

-----8<-----

Show quoted text 12 lines
>> One thing that makes me wonder is how mips and mipsel defines are >> related and when to use the 'mips' and when to use 'mipsel'. > mips: mipsel and mipseb Perhaps I was not clear enough, when doing defines for embedded in the code should I use: {$if defined(arm) or defined(avr) or defined(mips)} or {$if defined(arm) or defined(avr) or defined(mipsel)}

It seems that Florian was not clear enough either:
- use mipsel if it applies to MIPS Little Endian only
- use mipseb if it applies to MIPS Big Endian only
- use mips if it applies to both MIPS Little and Big endian ----->8-----

Circa 14th May, see
http://lists.freepascal.org/lists/fpc-devel/2013-May/thread.html

I'd remind you that the binaries I sent you were built with triplets etc. as given on http://wiki.lazarus.freepascal.org/Native_MIPS_Systems and that they worked here.

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]
Sven Barth
to Dennis: I was trying to build a cross compiler by following the MIPS_port doc but since I needed…
Dennis wrote 13 lines
I was trying to build a cross compiler by following the MIPS_port doc but since I needed MIPS bid endian version instead, I changed their example of MIPSel into MIPS which seems the correct way in dowloading binutils and specifying TARGET CPU. However, after many days of struggling, it appears that the correct spelling regarded by the crosscompiler for MIPS big endian is actually MIPSEB instead of MIPS!!! And that probably produced a lot of my earlier problems. I had to rename all the names of ld and as files from mips to mipseb to have the compiler stop complaining. Can someone tell me why in some areas of fpc, it is MIPS and else MIPSEB?

The compiler targets for mips are named mipsel and mipseb to avoid any confusion regarding whether the target is now the little or big endian one. Thus the compiler looks for mipsel-linux-* or mipseb-linux-* binutils. But this can easily be changed by using the "-XP" compiler argument (e.g. -XPmips-linux-) which you can also use in the fpc.cfg file.

Then there are compiler defines (those which can be checked using ifdef) and there additionally to mipsel and mipseb also the define mips exists so that one can check for both cpu ,
Sven