t_linux.pas 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644
  1. {
  2. Copyright (c) 1998-2002 by Peter Vreman
  3. This unit implements support import,export,link routines
  4. for the (i386) Linux 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_linux;
  19. {$i fpcdefs.inc}
  20. interface
  21. uses
  22. symsym,symdef,ppu,
  23. import,export,link;
  24. type
  25. timportliblinux=class(timportlib)
  26. procedure preparelib(const s:string);override;
  27. procedure importprocedure(aprocdef:tprocdef;const module:string;index:longint;const name:string);override;
  28. procedure importvariable(vs:tglobalvarsym;const name,module:string);override;
  29. procedure generatelib;override;
  30. end;
  31. texportliblinux=class(texportlib)
  32. procedure preparelib(const s : string);override;
  33. procedure exportprocedure(hp : texported_item);override;
  34. procedure exportvar(hp : texported_item);override;
  35. procedure generatelib;override;
  36. end;
  37. tlinkerlinux=class(texternallinker)
  38. private
  39. libctype:(libc5,glibc2,glibc21,uclibc);
  40. Function WriteResponseFile(isdll:boolean) : Boolean;
  41. public
  42. constructor Create;override;
  43. procedure SetDefaultInfo;override;
  44. function MakeExecutable:boolean;override;
  45. function MakeSharedLibrary:boolean;override;
  46. function postprocessexecutable(const fn : string;isdll:boolean):boolean;
  47. end;
  48. implementation
  49. uses
  50. cutils,cclasses,
  51. verbose,systems,globtype,globals,
  52. symconst,script,
  53. fmodule,dos,
  54. aasmbase,aasmtai,aasmcpu,cpubase,
  55. cgbase,cgobj,cgutils,
  56. i_linux
  57. ;
  58. {*****************************************************************************
  59. TIMPORTLIBLINUX
  60. *****************************************************************************}
  61. procedure timportliblinux.preparelib(const s : string);
  62. begin
  63. end;
  64. procedure timportliblinux.importprocedure(aprocdef:tprocdef;const module:string;index:longint;const name:string);
  65. begin
  66. { insert sharedlibrary }
  67. current_module.linkothersharedlibs.add(SplitName(module),link_allways);
  68. end;
  69. procedure timportliblinux.importvariable(vs:tglobalvarsym;const name,module:string);
  70. begin
  71. { insert sharedlibrary }
  72. current_module.linkothersharedlibs.add(SplitName(module),link_allways);
  73. { reset the mangledname and turn off the dll_var option }
  74. vs.set_mangledname(name);
  75. exclude(vs.varoptions,vo_is_dll_var);
  76. end;
  77. procedure timportliblinux.generatelib;
  78. begin
  79. end;
  80. {*****************************************************************************
  81. TEXPORTLIBLINUX
  82. *****************************************************************************}
  83. procedure texportliblinux.preparelib(const s:string);
  84. begin
  85. end;
  86. procedure texportliblinux.exportprocedure(hp : texported_item);
  87. var
  88. hp2 : texported_item;
  89. begin
  90. { first test the index value }
  91. if (hp.options and eo_index)<>0 then
  92. begin
  93. Message1(parser_e_no_export_with_index_for_target,'linux');
  94. exit;
  95. end;
  96. { now place in correct order }
  97. hp2:=texported_item(current_module._exports.first);
  98. while assigned(hp2) and
  99. (hp.name^>hp2.name^) do
  100. hp2:=texported_item(hp2.next);
  101. { insert hp there !! }
  102. if assigned(hp2) and (hp2.name^=hp.name^) then
  103. begin
  104. { this is not allowed !! }
  105. Message1(parser_e_export_name_double,hp.name^);
  106. exit;
  107. end;
  108. if hp2=texported_item(current_module._exports.first) then
  109. current_module._exports.concat(hp)
  110. else if assigned(hp2) then
  111. begin
  112. hp.next:=hp2;
  113. hp.previous:=hp2.previous;
  114. if assigned(hp2.previous) then
  115. hp2.previous.next:=hp;
  116. hp2.previous:=hp;
  117. end
  118. else
  119. current_module._exports.concat(hp);
  120. end;
  121. procedure texportliblinux.exportvar(hp : texported_item);
  122. begin
  123. hp.is_var:=true;
  124. exportprocedure(hp);
  125. end;
  126. procedure texportliblinux.generatelib;
  127. var
  128. hp2 : texported_item;
  129. sym : tasmsymbol;
  130. r : treference;
  131. begin
  132. new_section(codesegment,sec_code,'',0);
  133. hp2:=texported_item(current_module._exports.first);
  134. while assigned(hp2) do
  135. begin
  136. if (not hp2.is_var) and
  137. (hp2.sym.typ=procsym) then
  138. begin
  139. { the manglednames can already be the same when the procedure
  140. is declared with cdecl }
  141. if tprocsym(hp2.sym).first_procdef.mangledname<>hp2.name^ then
  142. begin
  143. { place jump in codesegment }
  144. codesegment.concat(tai_align.create(target_info.alignment.procalign));
  145. codeSegment.concat(Tai_symbol.Createname_global(hp2.name^,AT_FUNCTION,0));
  146. if (cs_create_pic in aktmoduleswitches) and
  147. { other targets need to be checked how it works }
  148. (target_info.system in [system_x86_64_linux]) then
  149. begin
  150. {$ifdef x86_64}
  151. sym:=objectlibrary.newasmsymbol(hp2.name^,AB_EXTERNAL,AT_FUNCTION);
  152. reference_reset_symbol(r,sym,0);
  153. if cs_create_pic in aktmoduleswitches then
  154. r.refaddr:=addr_pic
  155. else
  156. r.refaddr:=addr_full;
  157. codesegment.concat(taicpu.op_ref(A_JMP,S_NO,r));
  158. {$endif x86_64}
  159. end
  160. else
  161. cg.a_jmp_name(codesegment,tprocsym(hp2.sym).first_procdef.mangledname);
  162. codeSegment.concat(Tai_symbol_end.Createname(hp2.name^));
  163. end;
  164. end
  165. else
  166. Message1(parser_e_no_export_of_variables_for_target,'linux');
  167. hp2:=texported_item(hp2.next);
  168. end;
  169. end;
  170. {*****************************************************************************
  171. TLINKERLINUX
  172. *****************************************************************************}
  173. Constructor TLinkerLinux.Create;
  174. begin
  175. Inherited Create;
  176. if not Dontlinkstdlibpath Then
  177. {$ifdef x86_64}
  178. LibrarySearchPath.AddPath('/lib64;/usr/lib64;/usr/X11R6/lib64',true);
  179. {$else}
  180. LibrarySearchPath.AddPath('/lib;/usr/lib;/usr/X11R6/lib',true);
  181. {$endif x86_64}
  182. end;
  183. procedure TLinkerLinux.SetDefaultInfo;
  184. {
  185. This will also detect which libc version will be used
  186. }
  187. {$ifdef m68k}
  188. var
  189. St : SearchRec;
  190. {$endif m68k}
  191. begin
  192. with Info do
  193. begin
  194. ExeCmd[1]:='ld $OPT $DYNLINK $STATIC $GCSECTIONS $STRIP -L. -o $EXE $RES';
  195. DllCmd[1]:='ld $OPT $INIT $FINI $SONAME -shared -L. -o $EXE $RES';
  196. DllCmd[2]:='strip --strip-unneeded $EXE';
  197. {$ifdef m68k}
  198. libctype:=glibc2;
  199. FindFirst('/lib/ld*',AnyFile,st);
  200. while DosError=0 do
  201. begin
  202. if copy(st.name,1,5)='ld-2.' then
  203. begin
  204. DynamicLinker:='/lib/'+St.name;
  205. if st.name[6]<>'0' then
  206. libctype:=glibc21;
  207. break;
  208. end;
  209. FindNext(St);
  210. end;
  211. FindClose(St);
  212. {$endif m68k}
  213. {$ifdef i386}
  214. { first try glibc2 }
  215. DynamicLinker:='/lib/ld-linux.so.2';
  216. if FileExists(DynamicLinker) then
  217. { Check for 2.0 files, else use the glibc 2.1 stub }
  218. if FileExists('/lib/ld-2.0.*') then
  219. libctype:=glibc2
  220. else
  221. libctype:=glibc21
  222. else
  223. if fileexists('/lib/ld-uClibc.so.0') then
  224. begin
  225. libctype:=uclibc;
  226. dynamiclinker:='/lib/ld-uClibc.so.0';
  227. end
  228. else if fileexists('/lib/ld-linux.so.1') then
  229. DynamicLinker:='/lib/ld-linux.so.1'
  230. else
  231. libctype:=glibc21;
  232. {$endif i386}
  233. {$ifdef x86_64}
  234. DynamicLinker:='/lib64/ld-linux-x86-64.so.2';
  235. libctype:=glibc2;
  236. {$endif x86_64}
  237. {$ifdef sparc}
  238. DynamicLinker:='/lib/ld-linux.so.2';
  239. libctype:=glibc2;
  240. {$endif sparc}
  241. {$ifdef powerpc}
  242. DynamicLinker:='/lib/ld.so.1';
  243. libctype:=glibc2;
  244. {$endif powerpc}
  245. {$ifdef arm}
  246. DynamicLinker:='/lib/ld-linux.so.2';
  247. libctype:=glibc2;
  248. {$endif arm}
  249. end;
  250. end;
  251. Function TLinkerLinux.WriteResponseFile(isdll:boolean) : Boolean;
  252. Var
  253. linkres : TLinkRes;
  254. i : longint;
  255. cprtobj,
  256. gprtobj,
  257. prtobj : string[80];
  258. HPath : TStringListItem;
  259. s,s1,s2 : string;
  260. found1,
  261. found2,
  262. linklibc : boolean;
  263. begin
  264. WriteResponseFile:=False;
  265. { set special options for some targets }
  266. linklibc:=(SharedLibFiles.Find('c')<>nil);
  267. if isdll then
  268. begin
  269. prtobj:='dllprt0';
  270. cprtobj:='dllprt0';
  271. gprtobj:='dllprt0';
  272. end
  273. else
  274. begin
  275. prtobj:='prt0';
  276. case libctype of
  277. glibc21:
  278. begin
  279. cprtobj:='cprt21';
  280. gprtobj:='gprt21';
  281. end;
  282. uclibc:
  283. begin
  284. cprtobj:='ucprt0';
  285. gprtobj:='ugprt0';
  286. end
  287. else
  288. cprtobj:='cprt0';
  289. gprtobj:='gprt0';
  290. end;
  291. end;
  292. if cs_profile in aktmoduleswitches then
  293. begin
  294. prtobj:=gprtobj;
  295. if not(libctype in [glibc2,glibc21]) then
  296. AddSharedLibrary('gmon');
  297. AddSharedLibrary('c');
  298. linklibc:=true;
  299. end
  300. else
  301. begin
  302. if linklibc then
  303. prtobj:=cprtobj;
  304. end;
  305. { Open link.res file }
  306. LinkRes:=TLinkRes.Create(outputexedir+Info.ResName);
  307. { Write path to search libraries }
  308. HPath:=TStringListItem(current_module.locallibrarysearchpath.First);
  309. while assigned(HPath) do
  310. begin
  311. LinkRes.Add('SEARCH_DIR('+maybequoted(HPath.Str)+')');
  312. HPath:=TStringListItem(HPath.Next);
  313. end;
  314. HPath:=TStringListItem(LibrarySearchPath.First);
  315. while assigned(HPath) do
  316. begin
  317. LinkRes.Add('SEARCH_DIR('+maybequoted(HPath.Str)+')');
  318. HPath:=TStringListItem(HPath.Next);
  319. end;
  320. LinkRes.Add('INPUT(');
  321. { add objectfiles, start with prt0 always }
  322. if prtobj<>'' then
  323. LinkRes.AddFileName(maybequoted(FindObjectFile(prtobj,'',false)));
  324. { try to add crti and crtbegin if linking to C }
  325. if linklibc then
  326. begin
  327. if librarysearchpath.FindFile('crtbegin.o',s) then
  328. LinkRes.AddFileName(s);
  329. if librarysearchpath.FindFile('crti.o',s) then
  330. LinkRes.AddFileName(s);
  331. end;
  332. { main objectfiles }
  333. while not ObjectFiles.Empty do
  334. begin
  335. s:=ObjectFiles.GetFirst;
  336. if s<>'' then
  337. LinkRes.AddFileName(maybequoted(s));
  338. end;
  339. LinkRes.Add(')');
  340. { Write staticlibraries }
  341. if not StaticLibFiles.Empty then
  342. begin
  343. LinkRes.Add('GROUP(');
  344. While not StaticLibFiles.Empty do
  345. begin
  346. S:=StaticLibFiles.GetFirst;
  347. LinkRes.AddFileName(maybequoted(s))
  348. end;
  349. LinkRes.Add(')');
  350. end;
  351. { Write sharedlibraries like -l<lib>, also add the needed dynamic linker
  352. here to be sure that it gets linked this is needed for glibc2 systems (PFV) }
  353. if not SharedLibFiles.Empty then
  354. begin
  355. LinkRes.Add('INPUT(');
  356. While not SharedLibFiles.Empty do
  357. begin
  358. S:=SharedLibFiles.GetFirst;
  359. if s<>'c' then
  360. begin
  361. i:=Pos(target_info.sharedlibext,S);
  362. if i>0 then
  363. Delete(S,i,255);
  364. LinkRes.Add('-l'+s);
  365. end
  366. else
  367. begin
  368. linklibc:=true;
  369. end;
  370. end;
  371. { be sure that libc is the last lib }
  372. if linklibc then
  373. LinkRes.Add('-lc');
  374. { when we have -static for the linker the we also need libgcc }
  375. if (cs_link_staticflag in aktglobalswitches) then
  376. LinkRes.Add('-lgcc');
  377. LinkRes.Add(')');
  378. end;
  379. { objects which must be at the end }
  380. if linklibc and (libctype<>uclibc) then
  381. begin
  382. found1:=librarysearchpath.FindFile('crtend.o',s1);
  383. found2:=librarysearchpath.FindFile('crtn.o',s2);
  384. if found1 or found2 then
  385. begin
  386. LinkRes.Add('INPUT(');
  387. if found1 then
  388. LinkRes.AddFileName(s1);
  389. if found2 then
  390. LinkRes.AddFileName(s2);
  391. LinkRes.Add(')');
  392. end;
  393. end;
  394. { Write and Close response }
  395. linkres.writetodisk;
  396. linkres.Free;
  397. WriteResponseFile:=True;
  398. end;
  399. function TLinkerLinux.MakeExecutable:boolean;
  400. var
  401. binstr : String;
  402. cmdstr : TCmdStr;
  403. success : boolean;
  404. DynLinkStr : string[60];
  405. GCSectionsStr,
  406. StaticStr,
  407. StripStr : string[40];
  408. begin
  409. if not(cs_link_extern in aktglobalswitches) then
  410. Message1(exec_i_linking,current_module.exefilename^);
  411. { Create some replacements }
  412. StaticStr:='';
  413. StripStr:='';
  414. GCSectionsStr:='';
  415. DynLinkStr:='';
  416. if (cs_link_staticflag in aktglobalswitches) then
  417. StaticStr:='-static';
  418. if (cs_link_strip in aktglobalswitches) then
  419. StripStr:='-s';
  420. if (cs_link_smart in aktglobalswitches) and
  421. (tf_smartlink_sections in target_info.flags) then
  422. GCSectionsStr:='--gc-sections';
  423. If (cs_profile in aktmoduleswitches) or
  424. ((Info.DynamicLinker<>'') and (not SharedLibFiles.Empty)) then
  425. begin
  426. DynLinkStr:='-dynamic-linker='+Info.DynamicLinker;
  427. if cshared Then
  428. DynLinkStr:='--shared ' + DynLinkStr;
  429. if rlinkpath<>'' Then
  430. DynLinkStr:='--rpath-link '+rlinkpath + ' '+ DynLinkStr;
  431. End;
  432. { Write used files and libraries }
  433. WriteResponseFile(false);
  434. { Call linker }
  435. SplitBinCmd(Info.ExeCmd[1],binstr,cmdstr);
  436. Replace(cmdstr,'$EXE',maybequoted(current_module.exefilename^));
  437. Replace(cmdstr,'$OPT',Info.ExtraOptions);
  438. Replace(cmdstr,'$RES',maybequoted(outputexedir+Info.ResName));
  439. Replace(cmdstr,'$STATIC',StaticStr);
  440. Replace(cmdstr,'$STRIP',StripStr);
  441. Replace(cmdstr,'$GCSECTIONS',GCSectionsStr);
  442. Replace(cmdstr,'$DYNLINK',DynLinkStr);
  443. success:=DoExec(FindUtil(utilsprefix+BinStr),CmdStr,true,false);
  444. { Remove ReponseFile }
  445. if (success) and not(cs_link_extern in aktglobalswitches) then
  446. RemoveFile(outputexedir+Info.ResName);
  447. if (success) then
  448. success:=PostProcessExecutable(current_module.exefilename^,false);
  449. MakeExecutable:=success; { otherwise a recursive call to link method }
  450. end;
  451. Function TLinkerLinux.MakeSharedLibrary:boolean;
  452. var
  453. InitStr,
  454. FiniStr,
  455. SoNameStr : string[80];
  456. binstr : String;
  457. cmdstr : TCmdStr;
  458. success : boolean;
  459. begin
  460. MakeSharedLibrary:=false;
  461. if not(cs_link_extern in aktglobalswitches) then
  462. Message1(exec_i_linking,current_module.sharedlibfilename^);
  463. { Write used files and libraries }
  464. WriteResponseFile(true);
  465. { Create some replacements }
  466. InitStr:='-init FPC_LIB_START';
  467. FiniStr:='-fini FPC_LIB_EXIT';
  468. SoNameStr:='-soname '+SplitFileName(current_module.sharedlibfilename^);
  469. { Call linker }
  470. SplitBinCmd(Info.DllCmd[1],binstr,cmdstr);
  471. Replace(cmdstr,'$EXE',maybequoted(current_module.sharedlibfilename^));
  472. Replace(cmdstr,'$OPT',Info.ExtraOptions);
  473. Replace(cmdstr,'$RES',maybequoted(outputexedir+Info.ResName));
  474. Replace(cmdstr,'$INIT',InitStr);
  475. Replace(cmdstr,'$FINI',FiniStr);
  476. Replace(cmdstr,'$SONAME',SoNameStr);
  477. success:=DoExec(FindUtil(utilsprefix+binstr),cmdstr,true,false);
  478. { Strip the library ? }
  479. if success and (cs_link_strip in aktglobalswitches) then
  480. begin
  481. { only remove non global symbols and debugging info for a library }
  482. Info.DllCmd[2]:='strip --discard-all --strip-debug $EXE';
  483. SplitBinCmd(Info.DllCmd[2],binstr,cmdstr);
  484. Replace(cmdstr,'$EXE',maybequoted(current_module.sharedlibfilename^));
  485. success:=DoExec(FindUtil(utilsprefix+binstr),cmdstr,true,false);
  486. end;
  487. { Remove ReponseFile }
  488. if (success) and not(cs_link_extern in aktglobalswitches) then
  489. RemoveFile(outputexedir+Info.ResName);
  490. MakeSharedLibrary:=success; { otherwise a recursive call to link method }
  491. end;
  492. function tlinkerLinux.postprocessexecutable(const fn : string;isdll:boolean):boolean;
  493. Var
  494. cmdstr: string;
  495. found : boolean;
  496. hp : tused_unit;
  497. begin
  498. postprocessexecutable:=True;
  499. if target_res.id=res_elf then
  500. begin
  501. found:=((current_module.flags and uf_has_resourcefiles)=uf_has_resourcefiles);
  502. if not found then
  503. begin
  504. hp:=tused_unit(usedunits.first);
  505. While Assigned(hp) and not Found do
  506. begin
  507. Found:=((hp.u.flags and uf_has_resourcefiles)=uf_has_resourcefiles);
  508. hp:=tused_unit(hp.next);
  509. end;
  510. end;
  511. if found then
  512. begin
  513. cmdstr:=' -f -i '+maybequoted(fn);
  514. postprocessexecutable:=DoExec(FindUtil(utilsprefix+'fpcres'),cmdstr,false,false);
  515. end;
  516. end;
  517. end;
  518. {*****************************************************************************
  519. Initialize
  520. *****************************************************************************}
  521. initialization
  522. {$ifdef i386}
  523. RegisterExternalLinker(system_i386_linux_info,TLinkerLinux);
  524. RegisterImport(system_i386_linux,timportliblinux);
  525. RegisterExport(system_i386_linux,texportliblinux);
  526. RegisterTarget(system_i386_linux_info);
  527. RegisterRes(res_elf32_info);
  528. RegisterExternalLinker(system_x86_6432_linux_info,TLinkerLinux);
  529. RegisterImport(system_x86_6432_linux,timportliblinux);
  530. RegisterExport(system_x86_6432_linux,texportliblinux);
  531. RegisterTarget(system_x86_6432_linux_info);
  532. {$endif i386}
  533. {$ifdef m68k}
  534. RegisterExternalLinker(system_m68k_linux_info,TLinkerLinux);
  535. RegisterImport(system_m68k_linux,timportliblinux);
  536. RegisterExport(system_m68k_linux,texportliblinux);
  537. RegisterTarget(system_m68k_linux_info);
  538. {$endif m68k}
  539. {$ifdef powerpc}
  540. RegisterExternalLinker(system_powerpc_linux_info,TLinkerLinux);
  541. RegisterImport(system_powerpc_linux,timportliblinux);
  542. RegisterExport(system_powerpc_linux,texportliblinux);
  543. RegisterTarget(system_powerpc_linux_info);
  544. {$endif powerpc}
  545. {$ifdef alpha}
  546. RegisterExternalLinker(system_alpha_linux_info,TLinkerLinux);
  547. RegisterImport(system_alpha_linux,timportliblinux);
  548. RegisterExport(system_alpha_linux,texportliblinux);
  549. RegisterTarget(system_alpha_linux_info);
  550. {$endif alpha}
  551. {$ifdef x86_64}
  552. RegisterExternalLinker(system_x86_64_linux_info,TLinkerLinux);
  553. RegisterImport(system_x86_64_linux,timportliblinux);
  554. RegisterExport(system_x86_64_linux,texportliblinux);
  555. RegisterTarget(system_x86_64_linux_info);
  556. RegisterRes(res_elf64_info);
  557. {$endif x86_64}
  558. {$ifdef SPARC}
  559. RegisterExternalLinker(system_sparc_linux_info,TLinkerLinux);
  560. RegisterImport(system_SPARC_linux,timportliblinux);
  561. RegisterExport(system_SPARC_linux,texportliblinux);
  562. RegisterTarget(system_SPARC_linux_info);
  563. {$endif SPARC}
  564. {$ifdef ARM}
  565. RegisterExternalLinker(system_arm_linux_info,TLinkerLinux);
  566. RegisterImport(system_arm_linux,timportliblinux);
  567. RegisterExport(system_arm_linux,texportliblinux);
  568. RegisterTarget(system_arm_linux_info);
  569. {$endif ARM}
  570. end.