t_sunos.pas 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626
  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,expunix,link,comprsrc,rescmn,i_sunos,ogbase;
  34. type
  35. timportlibsolaris=class(timportlib)
  36. procedure generatelib;override;
  37. end;
  38. texportlibsolaris=class(texportlibunix)
  39. (*
  40. procedure setinitname(list: TAsmList; const s: string); override;
  41. procedure setfininame(list: TAsmList; const s: string); override;
  42. *)
  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. (*
  75. procedure texportlibsolaris.setinitname(list: TAsmList; const s: string);
  76. begin
  77. inherited setinitname(list,s);
  78. {$ifdef sparc}
  79. list.concat(tai_section.create(sec_init,'',4));
  80. list.concat(tai_symbol.createname_global('_init',AT_FUNCTION,0));
  81. list.concat(taicpu.op_reg_const_reg(A_SAVE,NR_STACK_POINTER_REG,-96,NR_STACK_POINTER_REG));
  82. {$endif sparc}
  83. end;
  84. procedure texportlibsolaris.setfininame(list: TAsmList; const s: string);
  85. begin
  86. inherited setfininame(list,s);
  87. {$ifdef sparc}
  88. list.concat(tai_section.create(sec_fini,'',4));
  89. list.concat(tai_symbol.createname_global('_fini',AT_FUNCTION,0));
  90. list.concat(taicpu.op_reg_const_reg(A_SAVE,NR_STACK_POINTER_REG,-96,NR_STACK_POINTER_REG));
  91. {$endif sparc}
  92. end;
  93. *)
  94. {*****************************************************************************
  95. TLINKERsolaris
  96. *****************************************************************************}
  97. Constructor TLinkersolaris.Create;
  98. begin
  99. Inherited Create;
  100. {$ifndef x86_64}
  101. use_gnu_ld:=true;
  102. {$endif}
  103. if cs_link_native in init_settings.globalswitches then
  104. use_gnu_ld:=false
  105. else
  106. use_gnu_ld:=true;
  107. if NOT Dontlinkstdlibpath Then
  108. {$ifdef x86_64}
  109. LibrarySearchPath.AddPath(sysrootpath,'/lib/64;/usr/lib/64;/usr/X11R6/lib/64;/opt/sfw/lib/64',true);
  110. {$else not x86_64}
  111. LibrarySearchPath.AddPath(sysrootpath,'/lib;/usr/lib;/usr/X11R6/lib;/opt/sfw/lib',true);
  112. {$endif not x86_64}
  113. {$ifdef LinkTest}
  114. if (cs_link_staticflag in current_settings.globalswitches) then WriteLN('ForceLinkStaticFlag');
  115. if (cs_link_static in current_settings.globalswitches) then WriteLN('LinkStatic-Flag');
  116. if (cs_link_shared in current_settings.globalswitches) then WriteLN('LinkSynamicFlag');
  117. {$EndIf}
  118. end;
  119. procedure TLinkersolaris.SetDefaultInfo;
  120. {
  121. This will also detect which libc version will be used
  122. }
  123. {$ifdef x86_64}
  124. const
  125. gld = 'gld -m elf_x86_64 ';
  126. solaris_ld = '/usr/bin/ld -64 ';
  127. {$else}
  128. const
  129. gld = 'gld ';
  130. solaris_ld = '/usr/bin/ld ';
  131. {$endif}
  132. begin
  133. Glibc2:=false;
  134. Glibc21:=false;
  135. with Info do
  136. begin
  137. {$IFDEF GnuLd}
  138. ExeCmd[1]:=gld + '$OPT $DYNLINK $STATIC $STRIP -L. -o $EXE $RES';
  139. ExeCmd[2]:=solaris_ld + '$OPT $DYNLINK $STATIC $STRIP -L . -o $EXE $RESDATA';
  140. DllCmd[1]:=gld + '$OPT $INITFINI -shared -L. -o $EXE $RES';
  141. DllCmd[2]:='gstrip --strip-unneeded $EXE';
  142. DllCmd[3]:=solaris_ld + '$OPT -M $VERSIONFILE -shared -L. -o $EXE $RESDATA';
  143. DynamicLinker:=''; { Gnu uses the default }
  144. Glibc21:=false;
  145. {$ELSE}
  146. Not Implememted
  147. {$ENDIF}
  148. end;
  149. end;
  150. Function TLinkersolaris.WriteResponseFile(isdll:boolean) : Boolean;
  151. Var
  152. i : longint;
  153. { cprtobj,
  154. gprtobj,
  155. prtobj : string[80];}
  156. HPath : TCmdStrListItem;
  157. s,s2 : TCmdStr;
  158. linkdynamic,
  159. linklibc : boolean;
  160. LinkRes2 : TLinkRes;
  161. begin
  162. WriteResponseFile:=False;
  163. { set special options for some targets }
  164. linkdynamic:=not(SharedLibFiles.empty);
  165. { linkdynamic:=false; // da nicht getestet }
  166. linklibc:=(SharedLibFiles.Find('c')<>nil);
  167. { prtobj:='prt0';
  168. cprtobj:='cprt0';
  169. gprtobj:='gprt0';}
  170. if cs_profile in current_settings.moduleswitches then
  171. begin
  172. { prtobj:=gprtobj;}
  173. if not glibc2 then
  174. AddSharedLibrary('gmon');
  175. AddSharedLibrary('c');
  176. linklibc:=true;
  177. end
  178. else
  179. begin
  180. if linklibc then
  181. begin
  182. { prtobj:=cprtobj;}
  183. end
  184. else
  185. AddSharedLibrary('c'); { quick hack: this solaris implementation needs alwys libc }
  186. end;
  187. if use_gnu_ld then
  188. begin
  189. { Open link.res file }
  190. LinkRes:=TLinkRes.Create(outputexedir+Info.ResName);
  191. { Write path to search libraries }
  192. HPath:=TCmdStrListItem(current_module.locallibrarysearchpath.First);
  193. while assigned(HPath) do
  194. begin
  195. LinkRes.Add('SEARCH_DIR('+maybequoted(HPath.Str)+')');
  196. HPath:=TCmdStrListItem(HPath.Next);
  197. end;
  198. HPath:=TCmdStrListItem(LibrarySearchPath.First);
  199. while assigned(HPath) do
  200. begin
  201. LinkRes.Add('SEARCH_DIR('+maybequoted(HPath.Str)+')');
  202. HPath:=TCmdStrListItem(HPath.Next);
  203. end;
  204. { force local symbol resolution (i.e., inside the shared }
  205. { library itself) for all non-exorted symbols, otherwise }
  206. { several RTL symbols of FPC-compiled shared libraries }
  207. { will be bound to those of a single shared library or }
  208. { to the main program }
  209. if (isdll) then
  210. begin
  211. LinkRes.add('VERSION');
  212. LinkRes.add('{');
  213. LinkRes.add(' {');
  214. if not texportlibunix(exportlib).exportedsymnames.empty then
  215. begin
  216. LinkRes.add(' global:');
  217. repeat
  218. LinkRes.add(' '+texportlibunix(exportlib).exportedsymnames.getfirst+';');
  219. until texportlibunix(exportlib).exportedsymnames.empty;
  220. end;
  221. LinkRes.add(' local:');
  222. LinkRes.add(' *;');
  223. LinkRes.add(' };');
  224. LinkRes.add('}');
  225. end;
  226. LinkRes.Add('INPUT(');
  227. { add objectfiles, start with prt0 always }
  228. { solaris port contains _start inside the system unit, it
  229. needs only one entry because it is linked always against libc
  230. if prtobj<>'' then
  231. LinkRes.AddFileName(FindObjectFile(prtobj,'',false));
  232. }
  233. { try to add crti and crtbegin if linking to C }
  234. if linklibc then { Needed in solaris? }
  235. begin
  236. { if librarysearchpath.FindFile('crtbegin.o',s) then
  237. LinkRes.AddFileName(s);}
  238. if librarysearchpath.FindFile('crti.o',false,s) then
  239. LinkRes.AddFileName(s);
  240. end;
  241. { main objectfiles }
  242. while not ObjectFiles.Empty do
  243. begin
  244. s:=ObjectFiles.GetFirst;
  245. if s<>'' then
  246. LinkRes.AddFileName(maybequoted(s));
  247. end;
  248. LinkRes.Add(')');
  249. { Write staticlibraries }
  250. if not StaticLibFiles.Empty then
  251. begin
  252. LinkRes.Add('GROUP(');
  253. While not StaticLibFiles.Empty do
  254. begin
  255. S:=StaticLibFiles.GetFirst;
  256. LinkRes.AddFileName(maybequoted(s))
  257. end;
  258. LinkRes.Add(')');
  259. end;
  260. { Write sharedlibraries like -l<lib>, also add the needed dynamic linker
  261. here to be sure that it gets linked this is needed for glibc2 systems (PFV) }
  262. if not SharedLibFiles.Empty then
  263. begin
  264. LinkRes.Add('INPUT(');
  265. While not SharedLibFiles.Empty do
  266. begin
  267. S:=SharedLibFiles.GetFirst;
  268. if s<>'c' then
  269. begin
  270. i:=Pos(target_info.sharedlibext,S);
  271. if i>0 then
  272. Delete(S,i,255);
  273. LinkRes.Add('-l'+s);
  274. end
  275. else
  276. begin
  277. linklibc:=true;
  278. linkdynamic:=false; { libc will include the ld-solaris (war ld-linux) for us }
  279. end;
  280. end;
  281. { be sure that libc is the last lib }
  282. if linklibc then
  283. LinkRes.Add('-lc');
  284. { when we have -static for the linker the we also need libgcc }
  285. if (cs_link_staticflag in current_settings.globalswitches) then begin
  286. LinkRes.Add('-lgcc');
  287. end;
  288. if linkdynamic and (Info.DynamicLinker<>'') then { gld has a default, DynamicLinker is not set in solaris }
  289. LinkRes.AddFileName(Info.DynamicLinker);
  290. LinkRes.Add(')');
  291. end;
  292. { objects which must be at the end }
  293. if linklibc then {needed in solaris ? }
  294. begin
  295. if {librarysearchpath.FindFile('crtend.o',s1) or}
  296. librarysearchpath.FindFile('crtn.o',false,s2) then
  297. begin
  298. LinkRes.Add('INPUT(');
  299. { LinkRes.AddFileName(s1);}
  300. LinkRes.AddFileName(s2);
  301. LinkRes.Add(')');
  302. end;
  303. end;
  304. { Write and Close response }
  305. linkres.writetodisk;
  306. LinkRes.Free;
  307. end
  308. else { not use_gnu_ld }
  309. begin
  310. { Open TlinkRes, will not be written to disk }
  311. LinkRes:=TLinkRes.Create(outputexedir+Info.ResName+'2');
  312. { Write path to search libraries }
  313. HPath:=TCmdStrListItem(current_module.locallibrarysearchpath.First);
  314. while assigned(HPath) do
  315. begin
  316. LinkRes.Add('-L '+maybequoted(HPath.Str));
  317. HPath:=TCmdStrListItem(HPath.Next);
  318. end;
  319. HPath:=TCmdStrListItem(LibrarySearchPath.First);
  320. while assigned(HPath) do
  321. begin
  322. LinkRes.Add('-L '+maybequoted(HPath.Str));
  323. HPath:=TCmdStrListItem(HPath.Next);
  324. end;
  325. { force local symbol resolution (i.e., inside the shared }
  326. { library itself) for all non-exorted symbols, otherwise }
  327. { several RTL symbols of FPC-compiled shared libraries }
  328. { will be bound to those of a single shared library or }
  329. { to the main program }
  330. if (isdll) then
  331. begin
  332. LinkRes2:=TLinkRes.Create(outputexedir+Info.ResName);
  333. LinkRes2.add('VERSION');
  334. LinkRes2.add(' {');
  335. if not texportlibunix(exportlib).exportedsymnames.empty then
  336. begin
  337. LinkRes2.add(' global:');
  338. repeat
  339. LinkRes2.add(' '+texportlibunix(exportlib).exportedsymnames.getfirst+';');
  340. until texportlibunix(exportlib).exportedsymnames.empty;
  341. end;
  342. LinkRes2.add(' local:');
  343. LinkRes2.add(' *;');
  344. LinkRes2.add(' };');
  345. LinkRes2.writetodisk;
  346. LinkRes2.Free;
  347. end;
  348. { add objectfiles, start with prt0 always }
  349. { solaris port contains _start inside the system unit, it
  350. needs only one entry because it is linked always against libc
  351. if prtobj<>'' then
  352. LinkRes.AddFileName(FindObjectFile(prtobj,'',false));
  353. }
  354. { try to add crti and crtbegin if linking to C }
  355. if linklibc then { Needed in solaris? }
  356. begin
  357. { if librarysearchpath.FindFile('crtbegin.o',s) then
  358. LinkRes.AddFileName(s);}
  359. if librarysearchpath.FindFile('crti.o',false,s) then
  360. LinkRes.AddFileName(s);
  361. end;
  362. { main objectfiles }
  363. while not ObjectFiles.Empty do
  364. begin
  365. s:=ObjectFiles.GetFirst;
  366. if s<>'' then
  367. LinkRes.AddFileName(maybequoted(s));
  368. end;
  369. { Write staticlibraries }
  370. if not StaticLibFiles.Empty then
  371. begin
  372. linkres.add('-(');
  373. While not StaticLibFiles.Empty do
  374. begin
  375. S:=StaticLibFiles.GetFirst;
  376. LinkRes.AddFileName(maybequoted(s))
  377. end;
  378. linkres.add('(-');
  379. end;
  380. { Write sharedlibraries like -l<lib>, also add the needed dynamic linker
  381. here to be sure that it gets linked this is needed for glibc2 systems (PFV) }
  382. if not SharedLibFiles.Empty then
  383. begin
  384. While not SharedLibFiles.Empty do
  385. begin
  386. S:=SharedLibFiles.GetFirst;
  387. if s<>'c' then
  388. begin
  389. i:=Pos(target_info.sharedlibext,S);
  390. if i>0 then
  391. Delete(S,i,255);
  392. LinkRes.Add('-l'+s);
  393. end
  394. else
  395. begin
  396. linklibc:=true;
  397. linkdynamic:=false; { libc will include the ld-solaris (war ld-linux) for us }
  398. end;
  399. end;
  400. { be sure that libc is the last lib }
  401. if linklibc then
  402. LinkRes.Add('-lc');
  403. { when we have -static for the linker the we also need libgcc }
  404. if (cs_link_staticflag in current_settings.globalswitches) then begin
  405. LinkRes.Add('-lgcc');
  406. end;
  407. if linkdynamic and (Info.DynamicLinker<>'') then { gld has a default, DynamicLinker is not set in solaris }
  408. LinkRes.AddFileName(Info.DynamicLinker);
  409. end;
  410. { objects which must be at the end }
  411. if linklibc then {needed in solaris ? }
  412. begin
  413. if {librarysearchpath.FindFile('crtend.o',s1) or}
  414. librarysearchpath.FindFile('crtn.o',false,s2) then
  415. begin
  416. { LinkRes.AddFileName(s1);}
  417. LinkRes.AddFileName(s2);
  418. end;
  419. end;
  420. { Write and Close response }
  421. //linkres.writetodisk;
  422. //LinkRes.Free;
  423. end;
  424. WriteResponseFile:=True;
  425. end;
  426. function TLinkersolaris.MakeExecutable:boolean;
  427. var
  428. binstr,
  429. s, linkstr,
  430. cmdstr : TCmdStr;
  431. success : boolean;
  432. DynLinkStr : string[60];
  433. StaticStr,
  434. StripStr : string[40];
  435. begin
  436. if not(cs_link_nolink in current_settings.globalswitches) then
  437. Message1(exec_i_linking,current_module.exefilename^);
  438. { Create some replacements }
  439. StaticStr:='';
  440. StripStr:='';
  441. DynLinkStr:='';
  442. if (cs_link_staticflag in current_settings.globalswitches) then
  443. StaticStr:='-Bstatic';
  444. if (cs_link_strip in current_settings.globalswitches) then
  445. StripStr:='-s';
  446. If (cs_profile in current_settings.moduleswitches) or
  447. ((Info.DynamicLinker<>'') and (not SharedLibFiles.Empty)) then
  448. DynLinkStr:='-dynamic-linker='+Info.DynamicLinker;
  449. { solaris sets DynamicLinker, but gld will (hopefully) defaults to -Bdynamic and add the default-linker }
  450. { Write used files and libraries }
  451. WriteResponseFile(false);
  452. { Call linker }
  453. if use_gnu_ld then
  454. SplitBinCmd(Info.ExeCmd[1],binstr,cmdstr)
  455. else
  456. SplitBinCmd(Info.ExeCmd[2],binstr,cmdstr);
  457. Replace(cmdstr,'$EXE',maybequoted(current_module.exefilename^));
  458. Replace(cmdstr,'$OPT',Info.ExtraOptions);
  459. if use_gnu_ld then
  460. Replace(cmdstr,'$RES',maybequoted(outputexedir+Info.ResName))
  461. else
  462. begin
  463. linkstr:='';
  464. while not linkres.data.Empty do
  465. begin
  466. s:=linkres.data.GetFirst;
  467. if s<>'' then
  468. linkstr:=linkstr+' '+s;
  469. end;
  470. linkres.free;
  471. Replace(cmdstr,'$RESDATA',linkstr);
  472. end;
  473. Replace(cmdstr,'$STATIC',StaticStr);
  474. Replace(cmdstr,'$STRIP',StripStr);
  475. Replace(cmdstr,'$DYNLINK',DynLinkStr);
  476. if use_gnu_ld then
  477. success:=DoExec(FindUtil(utilsprefix+BinStr),CmdStr,true,false)
  478. else { Using utilsprefix has no sense on /usr/bin/ld }
  479. success:=DoExec(FindUtil(BinStr),Trim(CmdStr),true,false);
  480. { Remove ReponseFile }
  481. {$IFNDEF LinkTest}
  482. if (success) and use_gnu_ld and
  483. not(cs_link_nolink in current_settings.globalswitches) then
  484. DeleteFile(outputexedir+Info.ResName);
  485. {$ENDIF}
  486. MakeExecutable:=success; { otherwise a recursive call to link method }
  487. end;
  488. Function TLinkersolaris.MakeSharedLibrary:boolean;
  489. var
  490. InitFiniStr : string;
  491. binstr,
  492. s, linkstr,
  493. cmdstr : TCmdStr;
  494. success : boolean;
  495. begin
  496. MakeSharedLibrary:=false;
  497. if not(cs_link_nolink in current_settings.globalswitches) then
  498. Message1(exec_i_linking,current_module.sharedlibfilename^);
  499. { Write used files and libraries }
  500. WriteResponseFile(true);
  501. { Create some replacements }
  502. InitFiniStr:='-init '+exportlib.initname;
  503. if (exportlib.fininame<>'') then
  504. InitFiniStr:=InitFiniStr+' -fini '+exportlib.fininame;
  505. { Call linker }
  506. if use_gnu_ld then
  507. SplitBinCmd(Info.DllCmd[1],binstr,cmdstr)
  508. else
  509. SplitBinCmd(Info.DllCmd[3],binstr,cmdstr);
  510. Replace(cmdstr,'$EXE',maybequoted(current_module.sharedlibfilename^));
  511. Replace(cmdstr,'$OPT',Info.ExtraOptions);
  512. Replace(cmdstr,'$INITFINI',InitFiniStr);
  513. if use_gnu_ld then
  514. Replace(cmdstr,'$RES',maybequoted(outputexedir+Info.ResName))
  515. else
  516. begin
  517. Replace(cmdstr,'$VERSIONFILE',maybequoted(outputexedir+Info.ResName));
  518. linkstr:='';
  519. while not linkres.data.Empty do
  520. begin
  521. s:=linkres.data.GetFirst;
  522. linkstr:=linkstr+s+' ';
  523. end;
  524. linkres.free;
  525. Replace(cmdstr,'$RESDATA',linkstr);
  526. end;
  527. if use_gnu_ld then
  528. success:=DoExec(FindUtil(utilsprefix+BinStr),CmdStr,true,false)
  529. else { Using utilsprefix has no sense on /usr/bin/ld }
  530. success:=DoExec(FindUtil(BinStr),CmdStr,true,false);
  531. { Strip the library ? }
  532. if success and (cs_link_strip in current_settings.globalswitches) then
  533. begin
  534. SplitBinCmd(Info.DllCmd[2],binstr,cmdstr);
  535. Replace(cmdstr,'$EXE',maybequoted(current_module.sharedlibfilename^));
  536. success:=DoExec(utilsprefix+FindUtil(binstr),cmdstr,true,false);
  537. end;
  538. { Remove ReponseFile }
  539. {$IFNDEF LinkTest}
  540. if (success) and not(cs_link_nolink in current_settings.globalswitches) then
  541. DeleteFile(outputexedir+Info.ResName);
  542. {$ENDIF}
  543. MakeSharedLibrary:=success; { otherwise a recursive call to link method }
  544. end;
  545. {*****************************************************************************
  546. Initialize
  547. *****************************************************************************}
  548. initialization
  549. {$ifdef i386}
  550. RegisterExternalLinker(system_i386_solaris_info,TLinkersolaris);
  551. RegisterImport(system_i386_solaris,TImportLibsolaris);
  552. RegisterExport(system_i386_solaris,TExportLibsolaris);
  553. RegisterTarget(system_i386_solaris_info);
  554. {$endif i386}
  555. {$ifdef x86_64}
  556. RegisterExternalLinker(system_x86_64_solaris_info,TLinkersolaris);
  557. RegisterImport(system_x86_64_solaris,TImportLibsolaris);
  558. RegisterExport(system_x86_64_solaris,TExportLibsolaris);
  559. RegisterTarget(system_x86_64_solaris_info);
  560. {$endif x86_64}
  561. {$ifdef sparc}
  562. RegisterExternalLinker(system_sparc_solaris_info,TLinkersolaris);
  563. RegisterImport(system_sparc_solaris,TImportLibsolaris);
  564. RegisterExport(system_sparc_solaris,TExportLibsolaris);
  565. RegisterTarget(system_sparc_solaris_info);
  566. {$endif sparc}
  567. RegisterRes(res_elf_info,TWinLikeResourceFile);
  568. end.