Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/Compiler/Delphi/Anonymous Methods    [ Add a report in this area ]  
Report #:  120476   Status: Closed
[iOS ARM][Android] E2581 Backend error: invalid linkage type for global declaration
Project:  Delphi Build #:  19.0.13856.4978
Version:    19.0 Submitted By:   Cristian Peta
Report Type:  Crash / Data loss / Total failure Date Reported:  11/14/2013 8:47:55 AM
Severity:    Critical / Show Stopper Last Updated: 12/10/2013 6:28:08 PM
Platform:    All platforms Internal Tracking #:   45026
Resolution: Fixed (Resolution Comments) Resolved in Build: : XE5 Update2
Duplicate of:  None
Voting and Rating
Overall Rating: No Ratings Yet
0.00 out of 5
Total Votes: 10
Description
[iOS ARM][Android] E2581 Backend error: invalid linkage type for global declaration

Add attached unit to mobile project and compile for iOS or Android device (LLVM backend).

You will see this error:
[DCC Error] DSDefs.pas(40): E2581 Backend error: invalid linkage type for global declaration
i8** @_ZN6Dsdefs1EE
Broken module found, compilation terminated.
Steps to Reproduce:
-------
unit DSDefs;

interface

uses
  System.SysUtils, System.Classes;

type
  TExecProcThread = class(TThread)
  private
    FProc: TProc;
    FExceptProc: TProc<String>;
  public
    procedure Execute; override;
  end;

implementation
{ TExecProcThread }

procedure TExecProcThread.Execute;
begin
  try
    FProc;
  except
    on E: Exception do
      Synchronize(
        procedure
        begin
          FExceptProc(E.Message)
        end);
  end;
end;

end.
-------
Workarounds
Do not use anonimous method.
Attachment
DSDefs.zip
Comments

None

Server Response from: ETNACODE01