Pierre Free Pascal wrote:
  I have a small batch that I use for cross-compilation
from i386-win32 to mips(el)-linux.

E:\pas\trunk\fpcsrc\compiler>type  mipsel-cycle.bat
set CUR_FPC_VER=2.7.1
if "%1" == "cont" goto cont
make cycle OPT="-gl -al -n -O- -Ur -vw" OS_TARGET=linux CPU_TARGET=mipsel
ALLOW_WARNINGS=1
if errorlevel 1 goto error
pscp -load gccmips .\ppcmipsel gcc42.fsffrance.org:bin
copy ppcrossmipsel.exe \pas\fpc-%CUR_FPC_VER%\bin\i386-win32
make -C ../rtl install FPC=ppcrossmipsel.exe PREFIX=/pas/fpc-%CUR_FPC_VER%
cd utils
del gppc386
make FPC=/pas/trunk/fpcsrc/compiler/ppcrossmipsel OPT=-gl clean all gppc386
pscp -load gccmips .\gppc386 gcc42.fsffrance.org:bin/gppcmipsel
cd ..
goto end
:error
echo An error occurred
:end

This uploads a native mipsel compiler that
is usable (at least as long as you don't work with too recent GNU as/ld,

Turned out I'd still got some old symlinks from when I was tinkering with David Zhang's stuff. RTL now OK, I'll try a full build in the morning.

muller@gcc42:~/pas/test$ ppcmipsel hello.pp
Assembler messages:
Error: -march=mips2 is not compatible with the selected ABI
hello.pp(14,18) Error: Error while assembling exitcode 1
hello.pp(14,18) Fatal: There were 2 errors compiling module, stopping
Fatal: Compilation aborted
muller@gcc42:~/pas/test$ as --version
GNU assembler (GNU Binutils) 2.23.51.20121004

Thanks for the warning. I'm on 2.20.1, looks like the version number window is quite tight.

 So most of the problems described in
http://wiki.lazarus.freepascal.org/Native_MIPS_Systems
should not be present anymore...

I'll update that presently. What I want to try doing first is running the compiler natively (hosted by Qemu), later I might try putting it on real hardware but I anticipate the endianness issue will take some work.

--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to