Sign in Join

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

Mailing lists / fpc-pascal / 2011-01

Internal error 2006012201 while cross compiling

15 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

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

Julien Devillers

Hello

I'm building an app from win64 to linux64.

The compilation fires an Internal error 2006012201.

Any idea ?

Regards

Julien

Julien Devillers
to Jeppe Johansen

no here's the end of the -va log :

[0.609] procedure/function Unassigned:UnicodeString;

[0.609] ENDIF FPCOLEVARIANT found

[0.625] Internal error 2006012201

[0.625] Searching file .\src\MyKit.lib\u_MyKit.pas... found

[0.641] Compilation aborted

Error: d:\pp\bin\x86_64-win64\ppcx64.exe returned an error exitcode (normal if you did not specify a source file to be compiled)

De : De la part de Jeppe Johansen
Envoyé : jeudi 27 janvier 2011 16:31
À : FPC-Pascal users discussions
Objet : Re: [fpc-pascal] Internal error 2006012201 while cross compiling

Didn't it give a filename and a line number?

Den 27-01-2011 15:34, Julien Devillers skrev:

Hello

I'm building an app from win64 to linux64.

The compilation fires an Internal error 2006012201.

Any idea ?

Regards

Julien

Jonas Maebe
to Julien Devillers
Julien Devillers wrote 7 lines
no here's the end of the -va log : [0.609] procedure/function Unassigned:UnicodeString; [0.609] ENDIF FPCOLEVARIANT found [0.625] Internal error 2006012201

The problem with -va is that the time stamps (the numbers between the square brackets) replace the line numbers. Try compiling without -va.

Jonas

Julien Devillers
to Jonas Maebe

-----Message d'origine-----
De : De la part de Jonas Maebe
Envoyé : vendredi 28 janvier 2011 14:39
À : FPC-Pascal users discussions
Objet : Re: [fpc-pascal] Internal error 2006012201 while cross compiling

Julien Devillers wrote 7 lines
no here's the end of the -va log : [0.609] procedure/function Unassigned:UnicodeString; [0.609] ENDIF FPCOLEVARIANT found [0.625] Internal error 2006012201

The problem with -va is that the time stamps (the numbers between the square brackets) replace the line numbers. Try compiling without -va.

Jonas

-------------------

OK, I replaced the -va by -vewunchilbdrqpv (everything except timestamps). With that, the error message reports the last line of the unit.

I removed a lot of code to find out that issue happens here

function RoundTo(const AValue: Double; const ADigit: TRoundToRange): Double;
var
  c: extended;
begin
  c := power(10,ADigit);
  Result := c * round(AValue/c);
end;
If I remove   " c := power(10,ADigit);" , no more error.

Julien

Julien Devillers
to Julien Devillers

-------------------

OK, I replaced the -va by -vewunchilbdrqpv (everything except timestamps).
With that, the error message reports the last line of the unit.

I removed a lot of code to find out that issue happens here

function RoundTo(const AValue: Double; const ADigit: TRoundToRange):
Double; var
  c: extended;
begin
  c := power(10,ADigit);
  Result := c * round(AValue/c);
end;
If I remove   " c := power(10,ADigit);" , no more error.

Julien

-------

I tried :

function RoundTo(const AValue: Double): Double;
var
  c: extended;
begin
  c := power(10,1);
  Result := c * round(AValue/c);
end;

same error.

Jeppe Johansen
to Julien Devillers
Julien Devillers wrote 22 lines
------------------- OK, I replaced the -va by -vewunchilbdrqpv (everything except timestamps). With that, the error message reports the last line of the unit. I removed a lot of code to find out that issue happens here function RoundTo(const AValue: Double; const ADigit: TRoundToRange): Double; var c: extended; begin c := power(10,ADigit); Result := c * round(AValue/c); end; If I remove " c := power(10,ADigit);" , no more error. Julien

My guess is that it's related to 80bit constants. Win64 doesn't support 80bit extended(according to some of the code, yet other places it defined pbestrealtype to s80bit). A crosscompiler should defined FPC_HAS_TYPE_EXTENDED for x86_64-linux, so I don't know whether this is actually the problem

Try changing c to double, and see whether the problem persists

Unknown author
to Julien Devillers: ------------------- OK, I replaced the -va by -vewunchilbdrqpv (everything except…

Can you try changing

  C : extended;

to

  c : Double;

and see whether that helps ?

Michael.

Julien Devillers wrote 42 lines
------------------- OK, I replaced the -va by -vewunchilbdrqpv (everything except timestamps). With that, the error message reports the last line of the unit. I removed a lot of code to find out that issue happens here function RoundTo(const AValue: Double; const ADigit: TRoundToRange): Double; var c: extended; begin c := power(10,ADigit); Result := c * round(AValue/c); end; If I remove " c := power(10,ADigit);" , no more error. Julien ------- I tried : function RoundTo(const AValue: Double): Double; var c: extended; begin c := power(10,1); Result := c * round(AValue/c); end; same error. _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Julien Devillers
to Jeppe Johansen: My guess is that it's related to 80bit constants. Win64 doesn't support 80bit…

My guess is that it's related to 80bit constants. Win64 doesn't support 80bit extended(according to some of the code, yet other places it defined pbestrealtype to s80bit). A crosscompiler should defined FPC_HAS_TYPE_EXTENDED for x86_64-linux, so I don't know whether this is actually the problem

Try changing c to double, and see whether the problem persists _______________________________________________

______________

I tried with c: double, it's the same error.
This code compiles correctly in 2.1.5.

May be, I did wrong when compiling the compiler ?
Does the 64bit compiler should be compiled with a64 bits compiler ? Which is the fpc minimum version for compiling the 2.4.2 fpc ?

Julien

Jonas Maebe
to Julien Devillers
Julien Devillers wrote
May be, I did wrong when compiling the compiler ? Does the 64bit compiler should be compiled with a64 bits compiler ?

It doesn't matter.

Which is the fpc minimum version for compiling the 2.4.2 fpc ?

FPC 2.4.0. Note that simply compiling the compiler is never enough, you have to perform a full build ("make all" in the top level fpc directory).

However, the internalerror you are getting is inside the external assembler writer. Since you are compiling for Linux/x86-64, the compiler should default to using the internal assembler. Are you using a variant of the -a or -Aas command line options?

Jonas

Julien Devillers
to Jonas Maebe

FPC 2.4.0. Note that simply compiling the compiler is never enough, you have to perform a full build ("make all" in the top level fpc directory)

-> Yes, That's what I did .
->make OS_TARGET=linux CPU_TARGET=x86_64 clean all ->make OS_TARGET=linux CPU_TARGET=x86_64 install

However, the internalerror you are getting is inside the external

assembler writer. Since you are compiling for Linux/x86-64, the compiler should default to using the internal assembler. Are you using a variant of the -a or -Aas command line options?

Yes I do -Aas.

In fact, I'm working on this project which was "forgotten", and there's no documentation on which params is used and why... Today I'm upgrading from 2.1.5 to 2.4.2 because some bugs no more exists with this new version (built on linux for linux)

Appreciate your Help
Julien

Julien Devillers
to Jonas Maebe: It doesn't matter. FPC 2.4.0. Note that simply compiling the compiler is never enough,…
However, the internalerror you are getting is inside the external

assembler writer. Since you are compiling for Linux/x86-64, the compiler should default to using the internal assembler. Are you using a variant of the -a or -Aas command line options?

Without the -Aas, the unit compiles correctly. I still have other compilation error but I must investigate more on
them.

Thanks
Julien

Julien Devillers
to Julien Devillers
>However, the internalerror you are getting is inside the external

assembler writer. Since you are compiling for Linux/x86-64, the compiler should default to using the internal assembler. Are you using a variant of the -a or -Aas command line options?

Without the -Aas, the unit compiles correctly. I still have other

compilation error but I must investigate more on them.

Ok, so now it compiles but, I still an an error while linking :

ld.exe: cannot find -lpthread

My ld.exe is x86_64-linux-ld.exe renamed in ld.exe

Julien

Jeppe Johansen
to Julien Devillers
Julien Devillers wrote
Ok, so now it compiles but, I still an an error while linking : ld.exe: cannot find -lpthread

This is basic crosslinking stuff. You must transfer all the required libraries from the target system, to be able to crosscompile it to there(In this case libpthread.so)

Julien Devillers
to Jeppe Johansen
> Ok, so now it compiles but, I still an an error while linking : > ld.exe: cannot find -lpthread This is basic crosslinking stuff. You must transfer all the required

libraries from the target system, to be able to crosscompile it to there(In this case libpthread.so)
_______________________________________________

Ok, I tried with lipthread alone first:
I copied it from the /lib64 dir on a linux64 machine to a lib directory, on my windows machine, that I included in the library path (-Fld:\pp\lib\ x86_64-linux)

Here's the result :
Linking d:\dev\T01\fpc\x86_64-Linux\bin\DUnit\Tester c:\fpcutils\ld.exe: cannot find /lib64/libpthread.so.0 Tester.dpr(59,1) Error: Error while linking

I added libpthread.so.0 in the same dir than libpthread.so. That did not work.
Created a directory called /lib64 and I moved libpthread.so.0 in.

Linking went a bit further :

c:\fpcutils\ld.exe: cannot find /usr/lib64/libpthread_nonshared.a

Ok, I can create on my win machine a linux like directory architecture : /usr/lib64/....
but that's not very easy to configure a win64 dev plateform for cross compiling using this method.
Is there a way to specify where to look for lib files ? or maybe I did something wrong...

regards
Julien