Selaa lähdekoodia

Merged revisions 2058 via svnmerge from
svn+ssh://[email protected]/FPC/svn/fpc/trunk

r2058 (jonas)
* final fixes for Mac OS X shared library creation: procedures declared
as forward are no longer treated as external symbols
* changed alloc_proc_symbol() to directly call newasmsymbol as opposed
to creating a dummy tai_symbol()

git-svn-id: branches/fixes_2_0@2059 -

Jonas Maebe 20 vuotta sitten
vanhempi
commit
663d227178
2 muutettua tiedostoa jossa 9 lisäystä ja 4 poistoa
  1. 2 4
      compiler/ncgutil.pas
  2. 7 0
      compiler/psub.pas

+ 2 - 4
compiler/ncgutil.pas

@@ -1655,7 +1655,6 @@ implementation
 
     procedure alloc_proc_symbol(pd: tprocdef);
      var
-        sym: tai_symbol;
         item: tstringlistitem;
       begin
         item := tstringlistitem(pd.aliasnames.first);
@@ -1663,10 +1662,9 @@ implementation
           begin
             if (cs_profile in aktmoduleswitches) or
                (po_global in current_procinfo.procdef.procoptions) then
-              sym := Tai_symbol.createname_global(item.str,AT_FUNCTION,0)
+               objectlibrary.newasmsymbol(item.str,AB_GLOBAL,AT_FUNCTION)
             else
-              sym := Tai_symbol.createname(item.str,AT_FUNCTION,0);
-            sym.free;
+               objectlibrary.newasmsymbol(item.str,AB_GLOBAL,AT_FUNCTION);
             item := tstringlistitem(item.next);
           end;
        end;

+ 7 - 0
compiler/psub.pas

@@ -1337,6 +1337,13 @@ implementation
          { Restore old state }
          constsymtable:=oldconstsymtable;
 
+         { make sure that references to forward-declared functions are not }
+         { treated as references to external symbols, needed for darwin    }
+         if (po_global in pd.procoptions) then
+           objectlibrary.newasmsymbol(pd.mangledname,AB_GLOBAL,AT_FUNCTION)
+         else
+           objectlibrary.newasmsymbol(pd.mangledname,AB_LOCAL,AT_FUNCTION);
+
          current_procinfo:=old_current_procinfo;
       end;