Przeglądaj źródła

* Implement use of solaris linker for libraries

git-svn-id: trunk@14272 -
pierre 15 lat temu
rodzic
commit
f5938d771f
1 zmienionych plików z 24 dodań i 4 usunięć
  1. 24 4
      compiler/systems/t_sunos.pas

+ 24 - 4
compiler/systems/t_sunos.pas

@@ -216,7 +216,7 @@ const
 {$else}
 {$else}
 const
 const
   gld = 'gld ';
   gld = 'gld ';
-  solaris_ld = 'ld ';
+  solaris_ld = '/usr/bin/ld ';
 {$endif}
 {$endif}
 begin
 begin
   Glibc2:=false;
   Glibc2:=false;
@@ -228,6 +228,7 @@ begin
      ExeCmd[2]:=solaris_ld + '$OPT $DYNLINK $STATIC $STRIP -L . -o $EXE $RESDATA';
      ExeCmd[2]:=solaris_ld + '$OPT $DYNLINK $STATIC $STRIP -L . -o $EXE $RESDATA';
      DllCmd[1]:=gld + '$OPT -shared -L. -o $EXE $RES';
      DllCmd[1]:=gld + '$OPT -shared -L. -o $EXE $RES';
      DllCmd[2]:='gstrip --strip-unneeded $EXE';
      DllCmd[2]:='gstrip --strip-unneeded $EXE';
+     DllCmd[3]:=solaris_ld + '$OPT -shared -L. -o $EXE $RES';
      DynamicLinker:=''; { Gnu uses the default }
      DynamicLinker:=''; { Gnu uses the default }
      Glibc21:=false;
      Glibc21:=false;
 {$ELSE}
 {$ELSE}
@@ -573,11 +574,30 @@ begin
   WriteResponseFile(true);
   WriteResponseFile(true);
 
 
 { Call linker }
 { Call linker }
-  SplitBinCmd(Info.DllCmd[1],binstr,cmdstr);
+  if use_gnu_ld then
+    SplitBinCmd(Info.DllCmd[1],binstr,cmdstr)
+  else
+    SplitBinCmd(Info.DllCmd[3],binstr,cmdstr);
   Replace(cmdstr,'$EXE',maybequoted(current_module.sharedlibfilename^));
   Replace(cmdstr,'$EXE',maybequoted(current_module.sharedlibfilename^));
   Replace(cmdstr,'$OPT',Info.ExtraOptions);
   Replace(cmdstr,'$OPT',Info.ExtraOptions);
-  Replace(cmdstr,'$RES',maybequoted(outputexedir+Info.ResName));
-  success:=DoExec(FindUtil(utilsprefix+binstr),cmdstr,true,false);
+  if use_gnu_ld then
+    Replace(cmdstr,'$RES',maybequoted(outputexedir+Info.ResName))
+  else
+    begin
+      linkstr:='';
+      while not linkres.data.Empty do
+        begin
+          s:=linkres.data.GetFirst;
+          linkstr:=linkstr+s+' ';
+        end;
+      linkres.free;
+      Replace(cmdstr,'$RESDATA',linkstr);
+    end;
+  if use_gnu_ld then
+    success:=DoExec(FindUtil(utilsprefix+BinStr),CmdStr,true,false)
+  else { Using utilsprefix has no sense on /usr/bin/ld }
+    success:=DoExec(FindUtil(BinStr),CmdStr,true,false);
+
 
 
 { Strip the library ? }
 { Strip the library ? }
   if success and (cs_link_strip in current_settings.globalswitches) then
   if success and (cs_link_strip in current_settings.globalswitches) then