Re: [fpc-pascal] Converting Delphi7 code to FreePascal with interfacing to protection key?

2023-03-30 Thread Mattias Gaertner via fpc-pascal
On Thu, 30 Mar 2023 13:03:52 +0200
Tomas Hajny via fpc-pascal  wrote:

>[...]
> I don't know where it is configured in Lazarus, but you need to use
> the -Xe parameter when using command-line compilation.

Project / Project Options / Compiler Options / All Options

Mattias
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Converting Delphi7 code to FreePascal with interfacing to protection key?

2023-03-30 Thread Tomas Hajny via fpc-pascal

On 2023-03-30 10:08, Bo Berglund via fpc-pascal wrote:
On Thu, 30 Mar 2023 10:02:49 +0200, Tomas Hajny via fpc-pascal 
 wrote:


 .
 .
I'd suggest trying to switch to external linking (for both versions) - 
that might help...




Could you be more specific?

I have never heard of such, I am just a long time user of Lazarus/Fpc 
but not in

the deep understanding of how it all works. I have always focused on my
applications and not how they were screwed together behind the scenes 
by Fpc...


Is there a setting to use something other than Fpc to link after 
compiling?

How is that done?


I don't know where it is configured in Lazarus, but you need to use the 
-Xe parameter when using command-line compilation.


Tomas
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Converting Delphi7 code to FreePascal with interfacing to protection key?

2023-03-30 Thread Bo Berglund via fpc-pascal
On Thu, 30 Mar 2023 10:02:49 +0200, Tomas Hajny via fpc-pascal
 wrote:

>On 30 March 2023 9:36:35 +0200, Marco van de Voort via fpc-pascal 
> wrote:
>>On 30-3-2023 07:38, Bo Berglund via fpc-pascal wrote:
>>> The problem seems to be that neither is a valid COFF file according to my 
>>> Fpc
>>> (or Lazarus) in any case. Both generate the COFF error when reaching the 
>>> linker
>>> step.
>>
>>32-bit objs for delphi are typically OMF, 64-bit are typically coff (for 
>>AMD64).
>
>I'd suggest trying to switch to external linking (for both versions) - that 
>might help...
>

Could you be more specific?

I have never heard of such, I am just a long time user of Lazarus/Fpc but not in
the deep understanding of how it all works. I have always focused on my
applications and not how they were screwed together behind the scenes by Fpc...

Is there a setting to use something other than Fpc to link after compiling?
How is that done?


-- 
Bo Berglund
Developer in Sweden

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Converting Delphi7 code to FreePascal with interfacing to protection key?

2023-03-30 Thread Tomas Hajny via fpc-pascal
On 30 March 2023 9:36:35 +0200, Marco van de Voort via fpc-pascal 
 wrote:
>On 30-3-2023 07:38, Bo Berglund via fpc-pascal wrote:
>> The problem seems to be that neither is a valid COFF file according to my Fpc
>> (or Lazarus) in any case. Both generate the COFF error when reaching the 
>> linker
>> step.
>
>32-bit objs for delphi are typically OMF, 64-bit are typically coff (for 
>AMD64).

I'd suggest trying to switch to external linking (for both versions) - that 
might help...

Tomas

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Converting Delphi7 code to FreePascal with interfacing to protection key?

2023-03-30 Thread Marco van de Voort via fpc-pascal



On 30-3-2023 07:38, Bo Berglund via fpc-pascal wrote:

The problem seems to be that neither is a valid COFF file according to my Fpc
(or Lazarus) in any case. Both generate the COFF error when reaching the linker
step.


32-bit objs for delphi are typically OMF, 64-bit are typically coff (for 
AMD64).



___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Cache-line alignment for records

2023-03-30 Thread Matias Ezequiel Vara Larsen via fpc-pascal
On Wed, Mar 29, 2023 at 11:07:18PM +0200, Jonas Maebe via fpc-pascal wrote:
> On 29/03/2023 16:00, Matias Ezequiel Vara Larsen via fpc-pascal wrote:
> > So if I have a type like:
> > 
> > test = record
> >r: DWord;
> >s: Word;
> > end;
> > 
> > Then, I define the variable `nada` as an array of `test` type:
> > 
> > var
> >nada: array[0..2] of test;
> > 
> > Is the `@nada[1].r` element aligned to 4-bytes?
> 
> Records always get padded to a multiple of their internal alignment
> requirement. Unless you're on a system where the default packrecords value
> is 2 (msdos-i8086 has that probably), the above record's internal field
> alignment is 4 and hence its size will also be padded to a multiple of 4.
> 
Thanks for the clarification, 

Matias
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal