Fpc should be compiled with -dFPC-ARMEL in OPT, not CROSSOPT

Den 26-08-2010 07:10, Nataraj S Narayan skrev:
Hi Jonas


I tried a very elementary code on arm-linux-uclibc, compiled using "ppcrossarm -TLinux -darm ttt3.pas -CfSOFT -XParm-linux- -XR/cdrom"

program kuraj;
begin
writeln('Hooua');
end.


The asm listing using -al is here: - http://pastebin.com/CG9i0x3z

It dont work in the normal EABI kernel but works on OABI compat one.

I got ppcrossarm using  :-
gmake distclean crosszipinstall CPU_TARGET=arm OS_TARGET=linux CROSSOPT='-CfSOFT -darm -dFPC-ARMEL -gl' FPC=/usr/local/lib/fpc/2.5.1/ppc386


warm regards

Nataraj

On Fri, Aug 20, 2010 at 6:51 PM, Jonas Maebe <jonas.ma...@elis.ugent.be <mailto:jonas.ma...@elis.ugent.be>> wrote:


    On 20 Aug 2010, at 15:00, Nataraj S Narayan wrote:

        On Fri, Aug 20, 2010 at 2:38 PM, Jonas Maebe
        <jonas.ma...@elis.ugent.be
        <mailto:jonas.ma...@elis.ugent.be>>wrote:

            You probably need the "nostackframe" directive, or remove
            the "mov pc,lr"

            at the end.

            Compile the code with -al, compile equivalent Pascal code
            with -al and look
            at the differences in the generated ".s" files.


        I changed the kernel to old 2.6.30 and the code works on the
        Arm target!

        That kernel  has been compiled with CONFIG_OABI_COMPAT=y.
        Newer kernels dont
        show this option, only EABI.

        Also my ppcrossarm is :-

        Free Pascal Compiler version 2.5.1 [2010/07/28] for arm
        Copyright (c) 1993-2009 by Florian Klaempfl

        What do you make of it?


    That you did not reply to the suggestions I made in my previous
    message. Please say what you did and what happened, even if it
    didn't work. It's not nice to spend time on trying to help
    someone, if that person then simply ignores what you write and
    replies with something completely different.

    The EABI requires that the stack is always aligned to 8 bytes on
    entry/exit of subroutines, and you probably mess up the alignment
    with the manually inserted return instruction.

    Also, make sure that you compiled an EABI cross-compiler (ensure
    that -dFPC_ARMEL is part of the OPT setting of the "make"
    invocation used to compile FPC).



    Jonas
    _______________________________________________
    fpc-pascal maillist  - fpc-pascal@lists.freepascal.org
    <mailto:fpc-pascal@lists.freepascal.org>
    http://lists.freepascal.org/mailman/listinfo/fpc-pascal



_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to