Przeglądaj źródła

* fixed interface wrappers for darwin in case they end up in
a shared library

git-svn-id: trunk@3980 -

Jonas Maebe 19 lat temu
rodzic
commit
a3a74c3fbe
2 zmienionych plików z 9 dodań i 3 usunięć
  1. 7 2
      compiler/i386/cgcpu.pas
  2. 2 1
      compiler/x86/cgx86.pas

+ 7 - 2
compiler/i386/cgcpu.pas

@@ -641,8 +641,13 @@ unit cgcpu;
         { case 0 }
         else
           begin
-            lab:=current_asmdata.RefAsmSymbol(procdef.mangledname);
-            list.concat(taicpu.op_sym(A_JMP,S_NO,lab));
+            if (target_info.system <> system_i386_darwin) then
+              begin
+                lab:=current_asmdata.RefAsmSymbol(procdef.mangledname);
+                list.concat(taicpu.op_sym(A_JMP,S_NO,lab))
+              end
+            else
+              list.concat(taicpu.op_sym(A_JMP,S_NO,get_darwin_call_stub(procdef.mangledname)))
           end;
 
         List.concat(Tai_symbol_end.Createname(labelname));

+ 2 - 1
compiler/x86/cgx86.pas

@@ -115,6 +115,8 @@ unit cgx86;
         procedure check_register_size(size:tcgsize;reg:tregister);
 
         procedure opmm_loc_reg(list: TAsmList; Op: TOpCG; size : tcgsize;loc : tlocation;dst: tregister; shuffle : pmmshuffle);
+
+        function get_darwin_call_stub(const s: string): tasmsymbol;
       private
         procedure sizes2load(s1,s2 : tcgsize;var op: tasmop; var s3: topsize);
 
@@ -123,7 +125,6 @@ unit cgx86;
         procedure floatloadops(t : tcgsize;var op : tasmop;var s : topsize);
         procedure floatstoreops(t : tcgsize;var op : tasmop;var s : topsize);
 
-        function get_darwin_call_stub(const s: string): tasmsymbol;
       end;
 
    const