FPC ARMEL and ARMHF under the same tree

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

FPC ARMEL and ARMHF under the same tree

leledumbo
Administrator
I currently have my [cross-]compilers under the same tree, to ease management and the ability to use single fpc.cfg. AFAIU FPC ARMEL and ARMHF are two distinct targets, thus two distinct compiler binary. However, the compiler binary has the same name. So, how can I have both under the same tree? I need to target both arm-android (my phone) and arm-linux (Raspberry Pi).
Reply | Threaded
Open this post in threaded view
|

Warning: Type size mismatch, possible loss of data / range check error

Peter
Hi Everybody,

I tried compiling with all warnings for a final polish/check on a
project, and seem to be getting a raft of false positives.
The following example stub gives two warnings;

Program test;

Const TAB = Char(Chr(9));

Var A : DWord;

Begin
A := 0;
End.


Also I get the same warning on every 'SetLength' with a constant param,
and on every 'New' statement. Zillions of them in total, which makes it
very hard to see any genuine issues. (I did have a few, mixing
signed/unsigned).

The problem occurs with BOTH switches -Cr & -CO
Any one of these, and the compiler is silent,
Is this a bug? Surely, the above A:=0; is valid Pascal isn’t it?

Regards,
Peter
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Warning: Type size mismatch, possible loss of data / range check error

Jonas Maebe-2
On 18/06/15 17:37, Peter wrote:

> The problem occurs with BOTH switches -Cr & -CO
> Any one of these, and the compiler is silent,

-CO is a switch that is barely used and that is tested even less,
unfortunately (no extensive tests were added along with it). I would not
recommend to use it in its current state, since it will indeed cause
many more false positives than generate useful information.

> Is this a bug?

You can file a bug report at http://bugs.freepascal.org


Jonas

PS: please don't reply to existing messages when starting a new thread,
as it breaks automatic threading in mail clients.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: FPC ARMEL and ARMHF under the same tree

Jonas Maebe-2
In reply to this post by leledumbo
On 17/06/15 20:18, leledumbo wrote:
> I currently have my [cross-]compilers under the same tree, to ease management
> and the ability to use single fpc.cfg. AFAIU FPC ARMEL and ARMHF are two
> distinct targets, thus two distinct compiler binary. However, the compiler
> binary has the same name. So, how can I have both under the same tree? I
> need to target both arm-android (my phone) and arm-linux (Raspberry Pi).

You can rename the compiler binaries to anything you want. A bigger
problem is that all units will also be stored in the same directories.
Florian recently started a branch to add support for sub-architectures
in the unit directory structure
(http://svn.freepascal.org/svn/fpc/branches/target-subdir/ ), but it
still requires changes to fpmkunit/fpmake.


Jonas
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Warning: Type size mismatch, possible loss of data / range check error

Peter
In reply to this post by Jonas Maebe-2
On 18/06/15 16:53, Jonas Maebe wrote:

> On 18/06/15 17:37, Peter wrote:
>
>> The problem occurs with BOTH switches -Cr & -CO
>> Any one of these, and the compiler is silent,
> -CO is a switch that is barely used and that is tested even less,
> unfortunately (no extensive tests were added along with it). I would not
> recommend to use it in its current state, since it will indeed cause
> many more false positives than generate useful information.
>
>> Is this a bug?
> You can file a bug report at http://bugs.freepascal.org
>
>
> Jonas
>
> PS: please don't reply to existing messages when starting a new thread,
> as it breaks automatic threading in mail clients.
> _______________________________________________
> fpc-pascal maillist  -  [hidden email]
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
>

Hi Jonas,
Thanks for the clarification. I'll keep well away from -CO in future!

http://bugs.freepascal.org/view.php?id=28323

Best wishes,
Peter
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: FPC ARMEL and ARMHF under the same tree

Florian Klämpfl
In reply to this post by Jonas Maebe-2
Am 18.06.2015 um 17:55 schrieb Jonas Maebe:

> On 17/06/15 20:18, leledumbo wrote:
>> I currently have my [cross-]compilers under the same tree, to ease management
>> and the ability to use single fpc.cfg. AFAIU FPC ARMEL and ARMHF are two
>> distinct targets, thus two distinct compiler binary. However, the compiler
>> binary has the same name. So, how can I have both under the same tree? I
>> need to target both arm-android (my phone) and arm-linux (Raspberry Pi).
>
> You can rename the compiler binaries to anything you want. A bigger
> problem is that all units will also be stored in the same directories.
> Florian recently started a branch to add support for sub-architectures
> in the unit directory structure
> (http://svn.freepascal.org/svn/fpc/branches/target-subdir/ ), but it
> still requires changes to fpmkunit/fpmake.

I didn't continue yet because I'am not sure if subarch-abi are sufficient or if another directory
level with e.g. fpu type, custom options (debugging info, optimization level etc.) might be useful.
Or if it would be only over engineering ...

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: FPC ARMEL and ARMHF under the same tree

leledumbo
Administrator
In reply to this post by Jonas Maebe-2
> You can rename the compiler binaries to anything you want.

Then how would fpc be able to call the renamed binaries? I rely on fpc -P for calling the cross compiler.

> A bigger problem is that all units will also be stored in the same directories.

If there's anyway to retrieve either the armel/armhf or whatever string that identifies the target, I can make a good use of it to store the units to different directories.
Reply | Threaded
Open this post in threaded view
|

Re: FPC ARMEL and ARMHF under the same tree

leledumbo
Administrator
In reply to this post by Florian Klämpfl
> I didn't continue yet because I'am not sure if subarch-abi are sufficient or if another directory
> level with e.g. fpu type, custom options (debugging info, optimization level etc.) might be useful.
> Or if it would be only over engineering ...

fpcmkcfg already generates $fpcsubarch-$fpcmemorymodel for 8086 target (although the make script uses 'msdos' only as directory name), so I guess at least $fpcsubarch is enough for arm. I don't think custom options are necessary to support, but providing config macros for them could be useful.

bad suggestion: consider it different target processor, so we have ppcrossarmel & ppcrossarmhf