Browse Source

* 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: trunk@2058 -

Jonas Maebe 19 years ago
parent
commit
de8dbbd2c4
2 changed files with 9 additions and 4 deletions
  1. 2 4
      compiler/ncgutil.pas
  2. 7 0
      compiler/psub.pas

+ 2 - 4
compiler/ncgutil.pas

@@ -1650,7 +1650,6 @@ implementation
 
     procedure alloc_proc_symbol(pd: tprocdef);
      var
-        sym: tai_symbol;
         item: tstringlistitem;
       begin
         item := tstringlistitem(pd.aliasnames.first);
@@ -1658,10 +1657,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

@@ -1416,6 +1416,13 @@ implementation
                end;
            end;
 
+         { 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;