Pārlūkot izejas kodu

* some fixes to the WASI library compilation (not ready, yet)

Nikolay Nikolov 3 gadi atpakaļ
vecāks
revīzija
d2a2240a2c
1 mainītis faili ar 10 papildinājumiem un 4 dzēšanām
  1. 10 4
      compiler/systems/t_wasi.pas

+ 10 - 4
compiler/systems/t_wasi.pas

@@ -184,8 +184,14 @@ var
   tmp : TCmdStrListItem;
   tmp : TCmdStrListItem;
   tempFileName : ansistring;
   tempFileName : ansistring;
 begin
 begin
-  //Result := true;
-  //Result:=inherited MakeSharedLibrary;
+  Result:=false;
+  if not(cs_link_nolink in current_settings.globalswitches) then
+    Message1(exec_i_linking,current_module.sharedlibfilename);
+
+  { Create some replacements }
+  mapstr:='';
+  if (cs_link_map in current_settings.globalswitches) then
+    mapstr:='-Map '+maybequoted(ChangeFileExt(current_module.sharedlibfilename,'.map'));
   if (cs_link_smart in current_settings.globalswitches) and
   if (cs_link_smart in current_settings.globalswitches) and
      create_smartlink_sections then
      create_smartlink_sections then
    GCSectionsStr:='--gc-sections'
    GCSectionsStr:='--gc-sections'
@@ -194,7 +200,7 @@ begin
 
 
   SoNameStr:='';
   SoNameStr:='';
   SplitBinCmd(Info.DllCmd[1],binstr,cmdstr);
   SplitBinCmd(Info.DllCmd[1],binstr,cmdstr);
-  Replace(cmdstr,'$EXE',maybequoted(current_module.exefilename));
+  Replace(cmdstr,'$EXE',maybequoted(current_module.sharedlibfilename));
 
 
   tmp := TCmdStrListItem(ObjectFiles.First);
   tmp := TCmdStrListItem(ObjectFiles.First);
   while Assigned(tmp) do begin
   while Assigned(tmp) do begin
@@ -218,7 +224,7 @@ begin
   //Replace(cmdstr,'$INIT',InitStr);
   //Replace(cmdstr,'$INIT',InitStr);
   //Replace(cmdstr,'$FINI',FiniStr);
   //Replace(cmdstr,'$FINI',FiniStr);
   Replace(cmdstr,'$SONAME',SoNameStr);
   Replace(cmdstr,'$SONAME',SoNameStr);
-  //Replace(cmdstr,'$MAP',mapstr);
+  Replace(cmdstr,'$MAP',mapstr);
   //Replace(cmdstr,'$LTO',ltostr);
   //Replace(cmdstr,'$LTO',ltostr);
   Replace(cmdstr,'$GCSECTIONS',GCSectionsStr);
   Replace(cmdstr,'$GCSECTIONS',GCSectionsStr);
   writeln(utilsprefix+binstr,' ',cmdstr);
   writeln(utilsprefix+binstr,' ',cmdstr);