t_sunos.pas 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646
  1. {
  2. Copyright (c) 1998-2008 by Peter Vreman
  3. This unit implements support import,export,link routines
  4. for the (i386) solaris target
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  16. ****************************************************************************
  17. }
  18. unit t_sunos;
  19. {$i fpcdefs.inc}
  20. interface
  21. { copy from t_linux
  22. // Up to now we use gld since the solaris ld seems not support .res-files}
  23. {-$DEFINE LinkTest} { DON't del link.res and write Info }
  24. {$DEFINE GnuLd}{The other is not implemented }
  25. implementation
  26. uses
  27. sysutils,
  28. cutils,cfileutl,cclasses,
  29. verbose,systems,globtype,globals,
  30. symconst,script,
  31. fmodule,aasmbase,aasmtai,aasmdata,aasmcpu,cpubase,symsym,symdef,
  32. cgobj,
  33. import,export,link,comprsrc,rescmn,i_sunos,ogbase;
  34. type
  35. timportlibsolaris=class(timportlib)
  36. procedure generatelib;override;
  37. end;
  38. texportlibsolaris=class(texportlib)
  39. procedure preparelib(const s : string);override;
  40. procedure exportprocedure(hp : texported_item);override;
  41. procedure exportvar(hp : texported_item);override;
  42. procedure generatelib;override;
  43. end;
  44. tlinkersolaris=class(texternallinker)
  45. private
  46. Glibc2,
  47. Glibc21 : boolean;
  48. use_gnu_ld : boolean;
  49. linkres : TLinkRes;
  50. Function WriteResponseFile(isdll:boolean) : Boolean;
  51. public
  52. constructor Create;override;
  53. procedure SetDefaultInfo;override;
  54. function MakeExecutable:boolean;override;
  55. function MakeSharedLibrary:boolean;override;
  56. end;
  57. {*****************************************************************************
  58. TIMPORTLIBsolaris
  59. *****************************************************************************}
  60. procedure timportlibsolaris.generatelib;
  61. var
  62. i : longint;
  63. ImportLibrary : TImportLibrary;
  64. begin
  65. for i:=0 to current_module.ImportLibraryList.Count-1 do
  66. begin
  67. ImportLibrary:=TImportLibrary(current_module.ImportLibraryList[i]);
  68. current_module.linkothersharedlibs.add(ImportLibrary.Name,link_always);
  69. end;
  70. end;
  71. {*****************************************************************************
  72. TEXPORTLIBsolaris
  73. *****************************************************************************}
  74. procedure texportlibsolaris.preparelib(const s:string);
  75. begin
  76. end;
  77. procedure texportlibsolaris.exportprocedure(hp : texported_item);
  78. var
  79. hp2 : texported_item;
  80. begin
  81. { first test the index value }
  82. if (hp.options and eo_index)<>0 then
  83. begin
  84. Message1(parser_e_no_export_with_index_for_target,'solaris');
  85. exit;
  86. end;
  87. { use pascal name is none specified }
  88. if (hp.options and eo_name)=0 then
  89. begin
  90. hp.name:=stringdup(hp.sym.name);
  91. hp.options:=hp.options or eo_name;
  92. end;
  93. { now place in correct order }
  94. hp2:=texported_item(current_module._exports.first);
  95. while assigned(hp2) and
  96. (hp.name^>hp2.name^) do
  97. hp2:=texported_item(hp2.next);
  98. { insert hp there !! }
  99. if assigned(hp2) and (hp2.name^=hp.name^) then
  100. begin
  101. { this is not allowed !! }
  102. Message1(parser_e_export_name_double,hp.name^);
  103. exit;
  104. end;
  105. if hp2=texported_item(current_module._exports.first) then
  106. current_module._exports.insert(hp)
  107. else if assigned(hp2) then
  108. begin
  109. hp.next:=hp2;
  110. hp.previous:=hp2.previous;
  111. if assigned(hp2.previous) then
  112. hp2.previous.next:=hp;
  113. hp2.previous:=hp;
  114. end
  115. else
  116. current_module._exports.concat(hp);
  117. end;
  118. procedure texportlibsolaris.exportvar(hp : texported_item);
  119. begin
  120. hp.is_var:=true;
  121. exportprocedure(hp);
  122. end;
  123. procedure texportlibsolaris.generatelib;
  124. var
  125. hp2 : texported_item;
  126. pd : tprocdef;
  127. begin
  128. new_section(current_asmdata.asmlists[al_procedures],sec_code,'',0);
  129. hp2:=texported_item(current_module._exports.first);
  130. while assigned(hp2) do
  131. begin
  132. if (not hp2.is_var) and
  133. (hp2.sym.typ=procsym) then
  134. begin
  135. { the manglednames can already be the same when the procedure
  136. is declared with cdecl }
  137. pd:=tprocdef(tprocsym(hp2.sym).ProcdefList[0]);
  138. if pd.mangledname<>hp2.name^ then
  139. begin
  140. { place jump in al_procedures }
  141. current_asmdata.asmlists[al_procedures].concat(tai_align.create(target_info.alignment.procalign));
  142. current_asmdata.asmlists[al_procedures].concat(Tai_symbol.Createname_global(hp2.name^,AT_FUNCTION,0));
  143. cg.a_jmp_name(current_asmdata.asmlists[al_procedures],pd.mangledname);
  144. current_asmdata.asmlists[al_procedures].concat(Tai_symbol_end.Createname(hp2.name^));
  145. end;
  146. end
  147. else
  148. Message1(parser_e_no_export_of_variables_for_target,'solaris');
  149. hp2:=texported_item(hp2.next);
  150. end;
  151. end;
  152. {*****************************************************************************
  153. TLINKERsolaris
  154. *****************************************************************************}
  155. Constructor TLinkersolaris.Create;
  156. begin
  157. Inherited Create;
  158. {$ifndef x86_64}
  159. use_gnu_ld:=true;
  160. {$endif}
  161. if cs_link_native in init_settings.globalswitches then
  162. use_gnu_ld:=false
  163. else
  164. use_gnu_ld:=true;
  165. if NOT Dontlinkstdlibpath Then
  166. {$ifdef x86_64}
  167. LibrarySearchPath.AddPath(sysrootpath,'/lib/64;/usr/lib/64;/usr/X11R6/lib/64;/opt/sfw/lib/64',true);
  168. {$else not x86_64}
  169. LibrarySearchPath.AddPath(sysrootpath,'/lib;/usr/lib;/usr/X11R6/lib;/opt/sfw/lib',true);
  170. {$endif not x86_64}
  171. {$ifdef LinkTest}
  172. if (cs_link_staticflag in current_settings.globalswitches) then WriteLN('ForceLinkStaticFlag');
  173. if (cs_link_static in current_settings.globalswitches) then WriteLN('LinkStatic-Flag');
  174. if (cs_link_shared in current_settings.globalswitches) then WriteLN('LinkSynamicFlag');
  175. {$EndIf}
  176. end;
  177. procedure TLinkersolaris.SetDefaultInfo;
  178. {
  179. This will also detect which libc version will be used
  180. }
  181. {$ifdef x86_64}
  182. const
  183. gld = 'gld -m elf_x86_64 ';
  184. solaris_ld = '/usr/bin/ld -64 ';
  185. {$else}
  186. const
  187. gld = 'gld ';
  188. solaris_ld = '/usr/bin/ld ';
  189. {$endif}
  190. begin
  191. Glibc2:=false;
  192. Glibc21:=false;
  193. with Info do
  194. begin
  195. {$IFDEF GnuLd}
  196. ExeCmd[1]:=gld + '$OPT $DYNLINK $STATIC $STRIP -L. -o $EXE $RES';
  197. ExeCmd[2]:=solaris_ld + '$OPT $DYNLINK $STATIC $STRIP -L . -o $EXE $RESDATA';
  198. DllCmd[1]:=gld + '$OPT -shared -L. -o $EXE $RES';
  199. DllCmd[2]:='gstrip --strip-unneeded $EXE';
  200. DllCmd[3]:=solaris_ld + '$OPT -shared -L. -o $EXE $RES';
  201. DynamicLinker:=''; { Gnu uses the default }
  202. Glibc21:=false;
  203. {$ELSE}
  204. Not Implememted
  205. {$ENDIF}
  206. (* Linux Stuff not needed?
  207. { first try glibc2 } // muss noch gendert werden
  208. if FileExists(DynamicLinker) then
  209. begin
  210. Glibc2:=true;
  211. { Check for 2.0 files, else use the glibc 2.1 stub }
  212. if FileExists('/lib/ld-2.0.*') then
  213. Glibc21:=false
  214. else
  215. Glibc21:=true;
  216. end
  217. else
  218. DynamicLinker:='/lib/ld-linux.so.1';
  219. *)
  220. end;
  221. end;
  222. Function TLinkersolaris.WriteResponseFile(isdll:boolean) : Boolean;
  223. Var
  224. i : longint;
  225. { cprtobj,
  226. gprtobj,
  227. prtobj : string[80];}
  228. HPath : TCmdStrListItem;
  229. s,s2 : TCmdStr;
  230. linkdynamic,
  231. linklibc : boolean;
  232. begin
  233. WriteResponseFile:=False;
  234. { set special options for some targets }
  235. linkdynamic:=not(SharedLibFiles.empty);
  236. { linkdynamic:=false; // da nicht getestet }
  237. linklibc:=(SharedLibFiles.Find('c')<>nil);
  238. { prtobj:='prt0';
  239. cprtobj:='cprt0';
  240. gprtobj:='gprt0';}
  241. if cs_profile in current_settings.moduleswitches then
  242. begin
  243. { prtobj:=gprtobj;}
  244. if not glibc2 then
  245. AddSharedLibrary('gmon');
  246. AddSharedLibrary('c');
  247. linklibc:=true;
  248. end
  249. else
  250. begin
  251. if linklibc then
  252. begin
  253. { prtobj:=cprtobj;}
  254. end
  255. else
  256. AddSharedLibrary('c'); { quick hack: this solaris implementation needs alwys libc }
  257. end;
  258. if use_gnu_ld then
  259. begin
  260. { Open link.res file }
  261. LinkRes:=TLinkRes.Create(outputexedir+Info.ResName);
  262. { Write path to search libraries }
  263. HPath:=TCmdStrListItem(current_module.locallibrarysearchpath.First);
  264. while assigned(HPath) do
  265. begin
  266. LinkRes.Add('SEARCH_DIR('+maybequoted(HPath.Str)+')');
  267. HPath:=TCmdStrListItem(HPath.Next);
  268. end;
  269. HPath:=TCmdStrListItem(LibrarySearchPath.First);
  270. while assigned(HPath) do
  271. begin
  272. LinkRes.Add('SEARCH_DIR('+maybequoted(HPath.Str)+')');
  273. HPath:=TCmdStrListItem(HPath.Next);
  274. end;
  275. LinkRes.Add('INPUT(');
  276. { add objectfiles, start with prt0 always }
  277. { solaris port contains _start inside the system unit, it
  278. needs only one entry because it is linked always against libc
  279. if prtobj<>'' then
  280. LinkRes.AddFileName(FindObjectFile(prtobj,'',false));
  281. }
  282. { try to add crti and crtbegin if linking to C }
  283. if linklibc then { Needed in solaris? }
  284. begin
  285. { if librarysearchpath.FindFile('crtbegin.o',s) then
  286. LinkRes.AddFileName(s);}
  287. if librarysearchpath.FindFile('crti.o',false,s) then
  288. LinkRes.AddFileName(s);
  289. end;
  290. { main objectfiles }
  291. while not ObjectFiles.Empty do
  292. begin
  293. s:=ObjectFiles.GetFirst;
  294. if s<>'' then
  295. LinkRes.AddFileName(maybequoted(s));
  296. end;
  297. LinkRes.Add(')');
  298. { Write staticlibraries }
  299. if not StaticLibFiles.Empty then
  300. begin
  301. LinkRes.Add('GROUP(');
  302. While not StaticLibFiles.Empty do
  303. begin
  304. S:=StaticLibFiles.GetFirst;
  305. LinkRes.AddFileName(maybequoted(s))
  306. end;
  307. LinkRes.Add(')');
  308. end;
  309. { Write sharedlibraries like -l<lib>, also add the needed dynamic linker
  310. here to be sure that it gets linked this is needed for glibc2 systems (PFV) }
  311. if not SharedLibFiles.Empty then
  312. begin
  313. LinkRes.Add('INPUT(');
  314. While not SharedLibFiles.Empty do
  315. begin
  316. S:=SharedLibFiles.GetFirst;
  317. if s<>'c' then
  318. begin
  319. i:=Pos(target_info.sharedlibext,S);
  320. if i>0 then
  321. Delete(S,i,255);
  322. LinkRes.Add('-l'+s);
  323. end
  324. else
  325. begin
  326. linklibc:=true;
  327. linkdynamic:=false; { libc will include the ld-solaris (war ld-linux) for us }
  328. end;
  329. end;
  330. { be sure that libc is the last lib }
  331. if linklibc then
  332. LinkRes.Add('-lc');
  333. { when we have -static for the linker the we also need libgcc }
  334. if (cs_link_staticflag in current_settings.globalswitches) then begin
  335. LinkRes.Add('-lgcc');
  336. end;
  337. if linkdynamic and (Info.DynamicLinker<>'') then { gld has a default, DynamicLinker is not set in solaris }
  338. LinkRes.AddFileName(Info.DynamicLinker);
  339. LinkRes.Add(')');
  340. end;
  341. { objects which must be at the end }
  342. if linklibc then {needed in solaris ? }
  343. begin
  344. if {librarysearchpath.FindFile('crtend.o',s1) or}
  345. librarysearchpath.FindFile('crtn.o',false,s2) then
  346. begin
  347. LinkRes.Add('INPUT(');
  348. { LinkRes.AddFileName(s1);}
  349. LinkRes.AddFileName(s2);
  350. LinkRes.Add(')');
  351. end;
  352. end;
  353. { Write and Close response }
  354. linkres.writetodisk;
  355. LinkRes.Free;
  356. end
  357. else { not use_gnu_ld }
  358. begin
  359. { Open link.res file }
  360. LinkRes:=TLinkRes.Create(outputexedir+Info.ResName);
  361. { Write path to search libraries }
  362. HPath:=TCmdStrListItem(current_module.locallibrarysearchpath.First);
  363. while assigned(HPath) do
  364. begin
  365. LinkRes.Add('-L '+maybequoted(HPath.Str));
  366. HPath:=TCmdStrListItem(HPath.Next);
  367. end;
  368. HPath:=TCmdStrListItem(LibrarySearchPath.First);
  369. while assigned(HPath) do
  370. begin
  371. LinkRes.Add('-L '+maybequoted(HPath.Str));
  372. HPath:=TCmdStrListItem(HPath.Next);
  373. end;
  374. { add objectfiles, start with prt0 always }
  375. { solaris port contains _start inside the system unit, it
  376. needs only one entry because it is linked always against libc
  377. if prtobj<>'' then
  378. LinkRes.AddFileName(FindObjectFile(prtobj,'',false));
  379. }
  380. { try to add crti and crtbegin if linking to C }
  381. if linklibc then { Needed in solaris? }
  382. begin
  383. { if librarysearchpath.FindFile('crtbegin.o',s) then
  384. LinkRes.AddFileName(s);}
  385. if librarysearchpath.FindFile('crti.o',false,s) then
  386. LinkRes.AddFileName(s);
  387. end;
  388. { main objectfiles }
  389. while not ObjectFiles.Empty do
  390. begin
  391. s:=ObjectFiles.GetFirst;
  392. if s<>'' then
  393. LinkRes.AddFileName(maybequoted(s));
  394. end;
  395. { Write staticlibraries }
  396. if not StaticLibFiles.Empty then
  397. begin
  398. While not StaticLibFiles.Empty do
  399. begin
  400. S:=StaticLibFiles.GetFirst;
  401. LinkRes.AddFileName(maybequoted(s))
  402. end;
  403. end;
  404. { Write sharedlibraries like -l<lib>, also add the needed dynamic linker
  405. here to be sure that it gets linked this is needed for glibc2 systems (PFV) }
  406. if not SharedLibFiles.Empty then
  407. begin
  408. While not SharedLibFiles.Empty do
  409. begin
  410. S:=SharedLibFiles.GetFirst;
  411. if s<>'c' then
  412. begin
  413. i:=Pos(target_info.sharedlibext,S);
  414. if i>0 then
  415. Delete(S,i,255);
  416. LinkRes.Add('-l'+s);
  417. end
  418. else
  419. begin
  420. linklibc:=true;
  421. linkdynamic:=false; { libc will include the ld-solaris (war ld-linux) for us }
  422. end;
  423. end;
  424. { be sure that libc is the last lib }
  425. if linklibc then
  426. LinkRes.Add('-lc');
  427. { when we have -static for the linker the we also need libgcc }
  428. if (cs_link_staticflag in current_settings.globalswitches) then begin
  429. LinkRes.Add('-lgcc');
  430. end;
  431. if linkdynamic and (Info.DynamicLinker<>'') then { gld has a default, DynamicLinker is not set in solaris }
  432. LinkRes.AddFileName(Info.DynamicLinker);
  433. end;
  434. { objects which must be at the end }
  435. if linklibc then {needed in solaris ? }
  436. begin
  437. if {librarysearchpath.FindFile('crtend.o',s1) or}
  438. librarysearchpath.FindFile('crtn.o',false,s2) then
  439. begin
  440. { LinkRes.AddFileName(s1);}
  441. LinkRes.AddFileName(s2);
  442. end;
  443. end;
  444. { Write and Close response }
  445. //linkres.writetodisk;
  446. //LinkRes.Free;
  447. end;
  448. WriteResponseFile:=True;
  449. end;
  450. function TLinkersolaris.MakeExecutable:boolean;
  451. var
  452. binstr,
  453. s, linkstr,
  454. cmdstr : TCmdStr;
  455. success : boolean;
  456. DynLinkStr : string[60];
  457. StaticStr,
  458. StripStr : string[40];
  459. begin
  460. if not(cs_link_nolink in current_settings.globalswitches) then
  461. Message1(exec_i_linking,current_module.exefilename^);
  462. { Create some replacements }
  463. StaticStr:='';
  464. StripStr:='';
  465. DynLinkStr:='';
  466. if (cs_link_staticflag in current_settings.globalswitches) then
  467. StaticStr:='-Bstatic';
  468. if (cs_link_strip in current_settings.globalswitches) then
  469. StripStr:='-s';
  470. If (cs_profile in current_settings.moduleswitches) or
  471. ((Info.DynamicLinker<>'') and (not SharedLibFiles.Empty)) then
  472. DynLinkStr:='-dynamic-linker='+Info.DynamicLinker;
  473. { solaris sets DynamicLinker, but gld will (hopefully) defaults to -Bdynamic and add the default-linker }
  474. { Write used files and libraries }
  475. WriteResponseFile(false);
  476. { Call linker }
  477. if use_gnu_ld then
  478. SplitBinCmd(Info.ExeCmd[1],binstr,cmdstr)
  479. else
  480. SplitBinCmd(Info.ExeCmd[2],binstr,cmdstr);
  481. Replace(cmdstr,'$EXE',maybequoted(current_module.exefilename^));
  482. Replace(cmdstr,'$OPT',Info.ExtraOptions);
  483. if use_gnu_ld then
  484. Replace(cmdstr,'$RES',maybequoted(outputexedir+Info.ResName))
  485. else
  486. begin
  487. linkstr:='';
  488. while not linkres.data.Empty do
  489. begin
  490. s:=linkres.data.GetFirst;
  491. linkstr:=linkstr+s+' ';
  492. end;
  493. linkres.free;
  494. Replace(cmdstr,'$RESDATA',linkstr);
  495. end;
  496. Replace(cmdstr,'$STATIC',StaticStr);
  497. Replace(cmdstr,'$STRIP',StripStr);
  498. Replace(cmdstr,'$DYNLINK',DynLinkStr);
  499. if use_gnu_ld then
  500. success:=DoExec(FindUtil(utilsprefix+BinStr),CmdStr,true,false)
  501. else { Using utilsprefix has no sense on /usr/bin/ld }
  502. success:=DoExec(FindUtil(BinStr),CmdStr,true,false);
  503. { Remove ReponseFile }
  504. {$IFNDEF LinkTest}
  505. if (success) and use_gnu_ld and
  506. not(cs_link_nolink in current_settings.globalswitches) then
  507. DeleteFile(outputexedir+Info.ResName);
  508. {$ENDIF}
  509. MakeExecutable:=success; { otherwise a recursive call to link method }
  510. end;
  511. Function TLinkersolaris.MakeSharedLibrary:boolean;
  512. var
  513. binstr,
  514. cmdstr : TCmdStr;
  515. success : boolean;
  516. begin
  517. MakeSharedLibrary:=false;
  518. if not(cs_link_nolink in current_settings.globalswitches) then
  519. Message1(exec_i_linking,current_module.sharedlibfilename^);
  520. { Write used files and libraries }
  521. WriteResponseFile(true);
  522. { Call linker }
  523. if use_gnu_ld then
  524. SplitBinCmd(Info.DllCmd[1],binstr,cmdstr)
  525. else
  526. SplitBinCmd(Info.DllCmd[3],binstr,cmdstr);
  527. Replace(cmdstr,'$EXE',maybequoted(current_module.sharedlibfilename^));
  528. Replace(cmdstr,'$OPT',Info.ExtraOptions);
  529. if use_gnu_ld then
  530. Replace(cmdstr,'$RES',maybequoted(outputexedir+Info.ResName))
  531. else
  532. begin
  533. linkstr:='';
  534. while not linkres.data.Empty do
  535. begin
  536. s:=linkres.data.GetFirst;
  537. linkstr:=linkstr+s+' ';
  538. end;
  539. linkres.free;
  540. Replace(cmdstr,'$RESDATA',linkstr);
  541. end;
  542. if use_gnu_ld then
  543. success:=DoExec(FindUtil(utilsprefix+BinStr),CmdStr,true,false)
  544. else { Using utilsprefix has no sense on /usr/bin/ld }
  545. success:=DoExec(FindUtil(BinStr),CmdStr,true,false);
  546. { Strip the library ? }
  547. if success and (cs_link_strip in current_settings.globalswitches) then
  548. begin
  549. SplitBinCmd(Info.DllCmd[2],binstr,cmdstr);
  550. Replace(cmdstr,'$EXE',maybequoted(current_module.sharedlibfilename^));
  551. success:=DoExec(utilsprefix+FindUtil(binstr),cmdstr,true,false);
  552. end;
  553. { Remove ReponseFile }
  554. {$IFNDEF LinkTest}
  555. if (success) and not(cs_link_nolink in current_settings.globalswitches) then
  556. DeleteFile(outputexedir+Info.ResName);
  557. {$ENDIF}
  558. MakeSharedLibrary:=success; { otherwise a recursive call to link method }
  559. end;
  560. {*****************************************************************************
  561. Initialize
  562. *****************************************************************************}
  563. initialization
  564. {$ifdef i386}
  565. RegisterExternalLinker(system_i386_solaris_info,TLinkersolaris);
  566. RegisterImport(system_i386_solaris,TImportLibsolaris);
  567. RegisterExport(system_i386_solaris,TExportLibsolaris);
  568. RegisterTarget(system_i386_solaris_info);
  569. {$endif i386}
  570. {$ifdef x86_64}
  571. RegisterExternalLinker(system_x86_64_solaris_info,TLinkersolaris);
  572. RegisterImport(system_x86_64_solaris,TImportLibsolaris);
  573. RegisterExport(system_x86_64_solaris,TExportLibsolaris);
  574. RegisterTarget(system_x86_64_solaris_info);
  575. {$endif x86_64}
  576. {$ifdef sparc}
  577. RegisterExternalLinker(system_sparc_solaris_info,TLinkersolaris);
  578. RegisterImport(system_sparc_solaris,TImportLibsolaris);
  579. RegisterExport(system_sparc_solaris,TExportLibsolaris);
  580. RegisterTarget(system_sparc_solaris_info);
  581. {$endif sparc}
  582. RegisterRes(res_elf_info,TWinLikeResourceFile);
  583. end.