Recent

Author Topic: [CLOSED] IDE shows wrong Error Message "Cross compiler not supported" (fpcupdelu  (Read 5329 times)

TRon

  • Hero Member
  • *****
  • Posts: 2432
Was that what you meant?
Yes.

If you do a fresh start of Lazarus, then create  a new project, go to project settings/config and target, are the fields: "Target OS", "Target CPU family" and "Target Processor" empty for you ? if not showing (default) for all 3 then you would need to change those that do not display (default).

My guess is/was that some default configuration value gets not reset properly in the IDE but Martin_Fr's seem to hint that that is probably not the issue. I'm trying but seem unable to come up with a plausible explanation or hint where to look elsewhere. I do know that if you do not match platform and processor to a valid pair (for example choose win32 on a 64 bit processor) then I get the exact same error message that you get (shell script fpc does not support target).

edit: could you post the FPC shell script that your (Lazarus) installation uses ? It might be possible there are some overrides in there (guessing it does not but unless seen we can not make sure).
« Last Edit: June 10, 2023, 01:06:28 pm by TRon »

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9791
  • Debugger - SynEdit - and more
    • wiki
Well, now that we know calling fpc from command line with -Parch64 works...

Next question is, does the IDE deal fine with the other targets? That is Hartmut said he had other cross compilers installed too?

If it does, then maybe there is a bug in the IDE.

Have you checked (from project options dialog) what params the IDE sends to FPC: "Show options" button?

Hartmut

  • Hero Member
  • *****
  • Posts: 742
Thank you both to Martin_fr and TRon for your help.

If you do a fresh start of Lazarus, then create  a new project, go to project settings/config and target, are the fields: "Target OS", "Target CPU family" and "Target Processor" empty for you ? if not showing (default) for all 3 then you would need to change those that do not display (default).
When I create a new project, then all 3 above Options show "(Default)", see screenshot "new_project.png".

Quote
could you post the FPC shell script that your (Lazarus) installation uses ? It might be possible there are some overrides in there (guessing it does not but unless seen we can not make sure).
File /opt/lazarus_224/fpc/bin/x86_64-linux/fpc.sh contains:
Code: Bash  [Select][+][-]
  1. #!/bin/sh
  2. # This script starts the fpc compiler installed by fpcup
  3. # and ignores any system-wide fpc.cfg files
  4. # Note: maintained by fpcup; do not edit directly, your edits will be lost.
  5. /opt/lazarus_224/fpc/bin/x86_64-linux/fpc -n @/opt/lazarus_224/fpc/bin/x86_64-linux/fpc.cfg "$@"

Next question is, does the IDE deal fine with the other targets? That is Hartmut said he had other cross compilers installed too?
Yes. The 3 other cross-compilers don't show this Error message in the IDE.

Quote
Have you checked (from project options dialog) what params the IDE sends to FPC: "Show options" button?
Yes, please see screenshot "aarch64_project.png". BTW: when I press the "Show options" button, then the Error message is displayed again.

TRon

  • Hero Member
  • *****
  • Posts: 2432
Thank you for the answers Hartmut.

The shell script is basically doing exactly what my script does (calling the fpc executable with a specific fpc.cfg)

Does the situation improve when you specifically select "Linux" for the "Target OS" in the project options ? (don't forget to save your project before building/closing/restarting/reloading Lazarus and your project). fwiw it should not matter whether you do or not except when the IDE somehow expects that to be selected specifically. So the suggestion is just another test to try and locate where the error originates from.
« Last Edit: June 10, 2023, 02:59:51 pm by TRon »

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9791
  • Debugger - SynEdit - and more
    • wiki
So we need to find out what command the IDE issues to find out the supported targets (and then why it does not recognise the one).

If no one on the forum knows, then maybe ask on the mail list.

Hartmut

  • Hero Member
  • *****
  • Posts: 742
Does the situation improve when you specifically select "Linux" for the "Target OS" in the project options ? (don't forget to save your project before building/closing/restarting/reloading Lazarus and your project).
Unfortunately not. Then I get the same Error messages as before.

TRon

  • Hero Member
  • *****
  • Posts: 2432
So we need to find out what command the IDE issues to find out the supported targets (and then why it does not recognise the one).

If no one on the forum knows, then maybe ask on the mail list.
I can't think of something better right now as well.

In case this will still not end up in a satisfactory answer then I will try and make a similar setup and try locate what might be the issue. Unfortunately I lack the time atm so at the soonest it would be something like next week before I am able to have a closer look at it.

Hartmut

  • Hero Member
  • *****
  • Posts: 742
So we need to find out what command the IDE issues to find out the supported targets (and then why it does not recognise the one).
If no one on the forum knows, then maybe ask on the mail list.
I can't think of something better right now as well.

Ok, If no one on the forum knows within some days, what command the IDE issues to find out the supported cross-compiler targets, then I will try to ask the Lazarus mailing list in https://lists.lazarus-ide.org/listinfo/lazarus

Quote
In case this will still not end up in a satisfactory answer then I will try and make a similar setup and try locate what might be the issue. Unfortunately I lack the time atm so at the soonest it would be something like next week before I am able to have a closer look at it.
Thank you very much TRon for that offer.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9791
  • Debugger - SynEdit - and more
    • wiki
So I did just change the target on my IDE (even though I do not have the cross compiler).

Running the IDE from a console, it outputs what it does....

It runs:
Code: Bash  [Select][+][-]
  1.  ./fpc.exe -iWTOTP -Paarch64
Which expectingly for me fails
Code: Text  [Select][+][-]
  1. Error: ppca64.exe can't be executed, error message: Failed to execute ""ppca64.exe"  -iWTOTP", error code: 2

What does this give for you, if you run the above command by hand on your fpc.sh ?

Btw, if I do it for my installed CPU:
Code: Text  [Select][+][-]
  1. $ ./fpc.exe -iWTOTP -Px86_64
  2. 3.3.1 win64 x86_64
  3.  

That is in the response.
- fpc version
- target OS
- target CPU


Btw the error I get in the IDE is "lisCompilerDoesNotSupportTarget"
Code: Text  [Select][+][-]
  1. Compiler "%s" does not support target %s-%s

In case the relevant IDE code needs to be located.


Hartmut

  • Hero Member
  • *****
  • Posts: 742
So I did just change the target on my IDE (even though I do not have the cross compiler).
Running the IDE from a console, it outputs what it does....

Hmm, on my system, when the current project has "Target CPU family" = "aarch64", I get only this output after starting the IDE and then the Error message occurs:
Code: Text  [Select][+][-]
  1. hg6@i3300:/opt/lazarus_224/lazarus$ ./lazarus --verbose
  2. using config file /opt/lazarus_224/lazarus/lazarus.cfg
  3. SetPrimaryConfigPath NewValue="/opt/lazarus_224/config_lazarus" -> "/opt/lazarus_224/config_lazarus"
  4. Debug: (lazarus) 4257 TIDEInstances.StartUserBuiltIDE
  5. Debug: (lazarus) 4257 TIDEInstances.StartUserBuiltIDE StartPath=/opt/lazarus_224/lazarus/lazarus
  6. Debug: (lazarus) 4257 TIDEInstances.StartUserBuiltIDE DefaultDir=/opt/lazarus_224/lazarus/ CustomDir=/opt/lazarus_224/config_lazarus/bin/
  7. Debug: (lazarus) 4257 TIDEInstances.StartUserBuiltIDE CustomExe=/opt/lazarus_224/config_lazarus/bin/lazarus Exits=False
  8. Hint: (lazarus) [TMainIDE.ParseCmdLineOptions] PrimaryConfigPath="/opt/lazarus_224/config_lazarus"
  9. Hint: (lazarus) [TMainIDE.ParseCmdLineOptions] SecondaryConfigPath="/etc/lazarus"
  10. TMainIDE.DoOpenProjectFile A "/media/D/FPC/work/archiv/wettcsv_Lx.lpi"
  11. Hint: (lazarus) [TBuildManager.SetBuildTarget] Old=x86_64-linux-gtk2 New=aarch64-linux-gtk2 Changed: OS/CPU=True LCL=False
  12. Error: (lazarus) [PPUFilesAndCompilerMatch] Compiler=/opt/lazarus_224/fpc/bin/x86_64-linux/fpc.sh RealComp= InPath=
so I don't see how the compiler is called.

Quote
It runs:
Code: Bash  [Select][+][-]
  1.  ./fpc.exe -iWTOTP -Paarch64
Which expectingly for me fails
What does this give for you, if you run the above command by hand on your fpc.sh ?

Code: Text  [Select][+][-]
  1. hg6@i3300:/opt/lazarus_224/fpc/bin/x86_64-linux$ ./fpc.sh -iWTOTP -Paarch64
  2. 3.2.2-rrelease_3_2_2-0-g0d122c4953 linux aarch64
so this works on my installation.

Quote
Btw the error I get in the IDE is "lisCompilerDoesNotSupportTarget"
Code: Text  [Select][+][-]
  1. Compiler "%s" does not support target %s-%s
I searched the complete sources for this const and I found only 1 reference in <installpath>/lazarus/ide/buildmanager.pas in function 'PPUFilesAndCompilerMatch', but I failed to understand it's code (I'm not experienced enough with classes).

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9791
  • Debugger - SynEdit - and more
    • wiki
I am not familiar with that code either.
I just had a few spare minutes...

Quote
Error: (lazarus) [PPUFilesAndCompilerMatch] Compiler=/opt/lazarus_224/fpc/bin/x86_64-linux/fpc.sh RealComp= InPath=
That can be located too.
"RealComp" should be the ppc....

There are a couple of debugln defines in that code... If they work, they sometime fall out of maintenance.

Compile the IDE with
-dVerboseFPCSrcScan -dVerboseDefaultCompilerTarget

Maybe it brings up some useful info.

Hartmut

  • Hero Member
  • *****
  • Posts: 742
Quote
Error: (lazarus) [PPUFilesAndCompilerMatch] Compiler=/opt/lazarus_224/fpc/bin/x86_64-linux/fpc.sh RealComp= InPath=
That can be located too.

Yes, it resides also in above file <installpath>/lazarus/ide/buildmanager.pas in function 'PPUFilesAndCompilerMatch'.

Quote
Compile the IDE with
-dVerboseFPCSrcScan -dVerboseDefaultCompilerTarget

Uups, I recompiled the IDE only once and that is long ago and was only via Menu "Tools / Build Lazarus with Profile: Normal IDE". I'm afraid to damage something... Please check the attached screenshot carefully, if I filled everything correctly. Especially the 2 defines, including the "-d" at the beginning? The Help-Page does not answer this.
Is everything filled correctly? Thanks a lot for your help.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9791
  • Debugger - SynEdit - and more
    • wiki
FIRST:
BACKUP the existing "lazarus" executable file. So long as you got that, you are ok.

2nd)
the "-d" part was for the "custom options"  field. If you put them directly in the defines, then ok but without the leading -d

Hartmut

  • Hero Member
  • *****
  • Posts: 742
I can't compile the IDE. I get always this Errors:

Code: Text  [Select][+][-]
  1. Compile package richmemopackage 1.0: Exit code 1, Errors: 4
  2. gtk2richmemo.pas(792,3) Error: Wrong number of parameters specified for call to "GetWidgetInfo"
  3. gtk2proc.inc(4157,10) Error: Found declaration: GetWidgetInfo(const Pointer):^TWidgetInfo;
  4. gtk2richmemo.pas(877,28) Error: Wrong number of parameters specified for call to "GetWidgetInfo"
  5. gtk2proc.inc(4157,10) Error: Found declaration: GetWidgetInfo(const Pointer):^TWidgetInfo;
(see attached screenshot for more).

I did *not* install any packages. This package must be part of Lazarus. I'm completely stuck. What shall I do?

TRon

  • Hero Member
  • *****
  • Posts: 2432
I did have a couple of minutes to spend and build the (cross)binutils and cross-compiler for aarch64.

Just my luck as I seem unable to reproduce the issue with FPC 3.2.2 (not fixes) and Lazarus 2.2.4 (not fixes). Ofc I am unable to actually create an executable because I do not have the aarch64 GUI libraries but without those dependencies FPC compiles just fine and selecting the aarch64 cpu target with Lazarus does not seem to give me an error.

 

TinyPortal © 2005-2018