t_linux.pas 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787
  1. {
  2. $Id$
  3. Copyright (c) 1998-2000 by Peter Vreman
  4. This unit implements support import,export,link routines
  5. for the (i386) Linux target
  6. This program is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation; either version 2 of the License, or
  9. (at your option) any later version.
  10. This program is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. GNU General Public License for more details.
  14. You should have received a copy of the GNU General Public License
  15. along with this program; if not, write to the Free Software
  16. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17. ****************************************************************************
  18. }
  19. unit t_linux;
  20. {$i defines.inc}
  21. interface
  22. uses
  23. import,export,link;
  24. type
  25. timportliblinux=class(timportlib)
  26. procedure preparelib(const s:string);override;
  27. procedure importprocedure(const func,module:string;index:longint;const name:string);override;
  28. procedure importvariable(const varname,module:string;const name: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(tlinker)
  38. private
  39. Glibc2,
  40. Glibc21 : boolean;
  41. Function WriteResponseFile(isdll:boolean) : Boolean;
  42. public
  43. constructor Create;override;
  44. procedure SetDefaultInfo;override;
  45. function MakeExecutable:boolean;override;
  46. function MakeSharedLibrary:boolean;override;
  47. end;
  48. implementation
  49. uses
  50. cutils,cclasses,
  51. verbose,systems,globtype,globals,
  52. symconst,script,
  53. fmodule,aasm,cpuasm,cpubase,symsym;
  54. {*****************************************************************************
  55. TIMPORTLIBLINUX
  56. *****************************************************************************}
  57. procedure timportliblinux.preparelib(const s : string);
  58. begin
  59. end;
  60. procedure timportliblinux.importprocedure(const func,module : string;index : longint;const name : string);
  61. begin
  62. { insert sharedlibrary }
  63. current_module.linkothersharedlibs.add(SplitName(module),link_allways);
  64. { do nothing with the procedure, only set the mangledname }
  65. if name<>'' then
  66. aktprocsym.definition.setmangledname(name)
  67. else
  68. message(parser_e_empty_import_name);
  69. end;
  70. procedure timportliblinux.importvariable(const varname,module:string;const name:string);
  71. begin
  72. { insert sharedlibrary }
  73. current_module.linkothersharedlibs.add(SplitName(module),link_allways);
  74. { reset the mangledname and turn off the dll_var option }
  75. aktvarsym.setmangledname(name);
  76. exclude(aktvarsym.varoptions,vo_is_dll_var);
  77. end;
  78. procedure timportliblinux.generatelib;
  79. begin
  80. end;
  81. {*****************************************************************************
  82. TEXPORTLIBLINUX
  83. *****************************************************************************}
  84. procedure texportliblinux.preparelib(const s:string);
  85. begin
  86. end;
  87. procedure texportliblinux.exportprocedure(hp : texported_item);
  88. var
  89. hp2 : texported_item;
  90. begin
  91. { first test the index value }
  92. if (hp.options and eo_index)<>0 then
  93. begin
  94. Message1(parser_e_no_export_with_index_for_target,'linux');
  95. exit;
  96. end;
  97. { now place in correct order }
  98. hp2:=texported_item(current_module._exports.first);
  99. while assigned(hp2) and
  100. (hp.name^>hp2.name^) do
  101. hp2:=texported_item(hp2.next);
  102. { insert hp there !! }
  103. if assigned(hp2) and (hp2.name^=hp.name^) then
  104. begin
  105. { this is not allowed !! }
  106. Message1(parser_e_export_name_double,hp.name^);
  107. exit;
  108. end;
  109. if hp2=texported_item(current_module._exports.first) then
  110. current_module._exports.concat(hp)
  111. else if assigned(hp2) then
  112. begin
  113. hp.next:=hp2;
  114. hp.previous:=hp2.previous;
  115. if assigned(hp2.previous) then
  116. hp2.previous.next:=hp;
  117. hp2.previous:=hp;
  118. end
  119. else
  120. current_module._exports.concat(hp);
  121. end;
  122. procedure texportliblinux.exportvar(hp : texported_item);
  123. begin
  124. hp.is_var:=true;
  125. exportprocedure(hp);
  126. end;
  127. procedure texportliblinux.generatelib;
  128. var
  129. hp2 : texported_item;
  130. begin
  131. hp2:=texported_item(current_module._exports.first);
  132. while assigned(hp2) do
  133. begin
  134. if not hp2.is_var then
  135. begin
  136. { the manglednames can already be the same when the procedure
  137. is declared with cdecl }
  138. if hp2.sym.mangledname<>hp2.name^ then
  139. begin
  140. {$ifdef i386}
  141. { place jump in codesegment }
  142. codesegment.concat(Tai_align.Create_op(4,$90));
  143. codeSegment.concat(Tai_symbol.Createname_global(hp2.name^,0));
  144. codeSegment.concat(Taicpu.Op_sym(A_JMP,S_NO,newasmsymbol(hp2.sym.mangledname)));
  145. codeSegment.concat(Tai_symbol_end.Createname(hp2.name^));
  146. {$endif i386}
  147. end;
  148. end
  149. else
  150. Message1(parser_e_no_export_of_variables_for_target,'linux');
  151. hp2:=texported_item(hp2.next);
  152. end;
  153. end;
  154. {*****************************************************************************
  155. TLINKERLINUX
  156. *****************************************************************************}
  157. Constructor TLinkerLinux.Create;
  158. begin
  159. Inherited Create;
  160. LibrarySearchPath.AddPath('/lib;/usr/lib;/usr/X11R6/lib',true);
  161. end;
  162. procedure TLinkerLinux.SetDefaultInfo;
  163. {
  164. This will also detect which libc version will be used
  165. }
  166. begin
  167. Glibc2:=false;
  168. Glibc21:=false;
  169. with Info do
  170. begin
  171. ExeCmd[1]:='ld $OPT $DYNLINK $STATIC $STRIP -L. -o $EXE $RES';
  172. DllCmd[1]:='ld $OPT $INIT $FINI $SONAME -shared -L. -o $EXE $RES';
  173. DllCmd[2]:='strip --strip-unneeded $EXE';
  174. { first try glibc2 }
  175. DynamicLinker:='/lib/ld-linux.so.2';
  176. if FileExists(DynamicLinker) then
  177. begin
  178. Glibc2:=true;
  179. { Check for 2.0 files, else use the glibc 2.1 stub }
  180. if FileExists('/lib/ld-2.0.*') then
  181. Glibc21:=false
  182. else
  183. Glibc21:=true;
  184. end
  185. else
  186. DynamicLinker:='/lib/ld-linux.so.1';
  187. end;
  188. end;
  189. Function TLinkerLinux.WriteResponseFile(isdll:boolean) : Boolean;
  190. Var
  191. linkres : TLinkRes;
  192. i : longint;
  193. cprtobj,
  194. gprtobj,
  195. prtobj : string[80];
  196. HPath : TStringListItem;
  197. s,s1,s2 : string;
  198. found1,
  199. found2,
  200. linkdynamic,
  201. linklibc : boolean;
  202. begin
  203. WriteResponseFile:=False;
  204. { set special options for some targets }
  205. linkdynamic:=not(SharedLibFiles.empty);
  206. linklibc:=(SharedLibFiles.Find('c')<>nil);
  207. if isdll then
  208. begin
  209. prtobj:='dllprt0';
  210. cprtobj:='dllprt0';
  211. gprtobj:='dllprt0';
  212. end
  213. else
  214. begin
  215. prtobj:='prt0';
  216. cprtobj:='cprt0';
  217. gprtobj:='gprt0';
  218. if glibc21 then
  219. begin
  220. cprtobj:='cprt21';
  221. gprtobj:='gprt21';
  222. end;
  223. end;
  224. if cs_profile in aktmoduleswitches then
  225. begin
  226. prtobj:=gprtobj;
  227. if not glibc2 then
  228. AddSharedLibrary('gmon');
  229. AddSharedLibrary('c');
  230. linklibc:=true;
  231. end
  232. else
  233. begin
  234. if linklibc then
  235. prtobj:=cprtobj;
  236. end;
  237. { Open link.res file }
  238. LinkRes:=TLinkRes.Create(outputexedir+Info.ResName);
  239. { Write path to search libraries }
  240. HPath:=TStringListItem(current_module.locallibrarysearchpath.First);
  241. while assigned(HPath) do
  242. begin
  243. LinkRes.Add('SEARCH_DIR('+HPath.Str+')');
  244. HPath:=TStringListItem(HPath.Next);
  245. end;
  246. HPath:=TStringListItem(LibrarySearchPath.First);
  247. while assigned(HPath) do
  248. begin
  249. LinkRes.Add('SEARCH_DIR('+HPath.Str+')');
  250. HPath:=TStringListItem(HPath.Next);
  251. end;
  252. LinkRes.Add('INPUT(');
  253. { add objectfiles, start with prt0 always }
  254. if prtobj<>'' then
  255. LinkRes.AddFileName(FindObjectFile(prtobj,''));
  256. { try to add crti and crtbegin if linking to C }
  257. if linklibc then
  258. begin
  259. if librarysearchpath.FindFile('crtbegin.o',s) then
  260. LinkRes.AddFileName(s);
  261. if librarysearchpath.FindFile('crti.o',s) then
  262. LinkRes.AddFileName(s);
  263. end;
  264. { main objectfiles }
  265. while not ObjectFiles.Empty do
  266. begin
  267. s:=ObjectFiles.GetFirst;
  268. if s<>'' then
  269. LinkRes.AddFileName(s);
  270. end;
  271. LinkRes.Add(')');
  272. { Write staticlibraries }
  273. if not StaticLibFiles.Empty then
  274. begin
  275. LinkRes.Add('GROUP(');
  276. While not StaticLibFiles.Empty do
  277. begin
  278. S:=StaticLibFiles.GetFirst;
  279. LinkRes.AddFileName(s)
  280. end;
  281. LinkRes.Add(')');
  282. end;
  283. { Write sharedlibraries like -l<lib>, also add the needed dynamic linker
  284. here to be sure that it gets linked this is needed for glibc2 systems (PFV) }
  285. if not SharedLibFiles.Empty then
  286. begin
  287. LinkRes.Add('INPUT(');
  288. While not SharedLibFiles.Empty do
  289. begin
  290. S:=SharedLibFiles.GetFirst;
  291. if s<>'c' then
  292. begin
  293. i:=Pos(target_info.sharedlibext,S);
  294. if i>0 then
  295. Delete(S,i,255);
  296. LinkRes.Add('-l'+s);
  297. end
  298. else
  299. begin
  300. linklibc:=true;
  301. linkdynamic:=false; { libc will include the ld-linux for us }
  302. end;
  303. end;
  304. { be sure that libc is the last lib }
  305. if linklibc then
  306. LinkRes.Add('-lc');
  307. { when we have -static for the linker the we also need libgcc }
  308. if (cs_link_staticflag in aktglobalswitches) then
  309. LinkRes.Add('-lgcc');
  310. if linkdynamic and (Info.DynamicLinker<>'') then
  311. LinkRes.AddFileName(Info.DynamicLinker);
  312. LinkRes.Add(')');
  313. end;
  314. { objects which must be at the end }
  315. if linklibc then
  316. begin
  317. found1:=librarysearchpath.FindFile('crtend.o',s1);
  318. found2:=librarysearchpath.FindFile('crtn.o',s2);
  319. if found1 or found2 then
  320. begin
  321. LinkRes.Add('INPUT(');
  322. if found1 then
  323. LinkRes.AddFileName(s1);
  324. if found2 then
  325. LinkRes.AddFileName(s2);
  326. LinkRes.Add(')');
  327. end;
  328. end;
  329. { Write and Close response }
  330. linkres.writetodisk;
  331. linkres.Free;
  332. WriteResponseFile:=True;
  333. end;
  334. function TLinkerLinux.MakeExecutable:boolean;
  335. var
  336. binstr,
  337. cmdstr : string;
  338. success : boolean;
  339. DynLinkStr : string[60];
  340. StaticStr,
  341. StripStr : string[40];
  342. begin
  343. if not(cs_link_extern in aktglobalswitches) then
  344. Message1(exec_i_linking,current_module.exefilename^);
  345. { Create some replacements }
  346. StaticStr:='';
  347. StripStr:='';
  348. DynLinkStr:='';
  349. if (cs_link_staticflag in aktglobalswitches) then
  350. StaticStr:='-static';
  351. if (cs_link_strip in aktglobalswitches) then
  352. StripStr:='-s';
  353. If (cs_profile in aktmoduleswitches) or
  354. ((Info.DynamicLinker<>'') and (not SharedLibFiles.Empty)) then
  355. DynLinkStr:='-dynamic-linker='+Info.DynamicLinker;
  356. { Write used files and libraries }
  357. WriteResponseFile(false);
  358. { Call linker }
  359. SplitBinCmd(Info.ExeCmd[1],binstr,cmdstr);
  360. Replace(cmdstr,'$EXE',current_module.exefilename^);
  361. Replace(cmdstr,'$OPT',Info.ExtraOptions);
  362. Replace(cmdstr,'$RES',outputexedir+Info.ResName);
  363. Replace(cmdstr,'$STATIC',StaticStr);
  364. Replace(cmdstr,'$STRIP',StripStr);
  365. Replace(cmdstr,'$DYNLINK',DynLinkStr);
  366. success:=DoExec(FindUtil(BinStr),CmdStr,true,false);
  367. { Remove ReponseFile }
  368. if (success) and not(cs_link_extern in aktglobalswitches) then
  369. RemoveFile(outputexedir+Info.ResName);
  370. MakeExecutable:=success; { otherwise a recursive call to link method }
  371. end;
  372. Function TLinkerLinux.MakeSharedLibrary:boolean;
  373. var
  374. InitStr,
  375. FiniStr,
  376. SoNameStr : string[80];
  377. binstr,
  378. cmdstr : string;
  379. success : boolean;
  380. begin
  381. MakeSharedLibrary:=false;
  382. if not(cs_link_extern in aktglobalswitches) then
  383. Message1(exec_i_linking,current_module.sharedlibfilename^);
  384. { Write used files and libraries }
  385. WriteResponseFile(true);
  386. { Create some replacements }
  387. InitStr:='-init FPC_LIB_START';
  388. FiniStr:='-fini FPC_LIB_EXIT';
  389. SoNameStr:='-soname '+SplitFileName(current_module.sharedlibfilename^);
  390. { Call linker }
  391. SplitBinCmd(Info.DllCmd[1],binstr,cmdstr);
  392. Replace(cmdstr,'$EXE',current_module.sharedlibfilename^);
  393. Replace(cmdstr,'$OPT',Info.ExtraOptions);
  394. Replace(cmdstr,'$RES',outputexedir+Info.ResName);
  395. Replace(cmdstr,'$INIT',InitStr);
  396. Replace(cmdstr,'$FINI',FiniStr);
  397. Replace(cmdstr,'$SONAME',SoNameStr);
  398. success:=DoExec(FindUtil(binstr),cmdstr,true,false);
  399. { Strip the library ? }
  400. if success and (cs_link_strip in aktglobalswitches) then
  401. begin
  402. SplitBinCmd(Info.DllCmd[2],binstr,cmdstr);
  403. Replace(cmdstr,'$EXE',current_module.sharedlibfilename^);
  404. success:=DoExec(FindUtil(binstr),cmdstr,true,false);
  405. end;
  406. { Remove ReponseFile }
  407. if (success) and not(cs_link_extern in aktglobalswitches) then
  408. RemoveFile(outputexedir+Info.ResName);
  409. MakeSharedLibrary:=success; { otherwise a recursive call to link method }
  410. end;
  411. {*****************************************************************************
  412. Initialize
  413. *****************************************************************************}
  414. {$ifdef i386}
  415. const
  416. target_i386_linux_info : ttargetinfo =
  417. (
  418. target : target_i386_LINUX;
  419. name : 'Linux for i386';
  420. shortname : 'Linux';
  421. flags : [];
  422. cpu : i386;
  423. unit_env : 'LINUXUNITS';
  424. extradefines : 'UNIX';
  425. sharedlibext : '.so';
  426. staticlibext : '.a';
  427. sourceext : '.pp';
  428. pasext : '.pas';
  429. exeext : '';
  430. defext : '.def';
  431. scriptext : '.sh';
  432. smartext : '.sl';
  433. unitext : '.ppu';
  434. unitlibext : '.ppl';
  435. asmext : '.s';
  436. objext : '.o';
  437. resext : '.res';
  438. resobjext : '.or';
  439. staticlibprefix : 'libp';
  440. sharedlibprefix : 'lib';
  441. Cprefix : '';
  442. newline : #10;
  443. assem : as_i386_elf32;
  444. assemextern : as_i386_as;
  445. link : ld_i386_linux;
  446. linkextern : ld_i386_linux;
  447. ar : ar_gnu_ar;
  448. res : res_none;
  449. endian : endian_little;
  450. alignment :
  451. (
  452. procalign : 4;
  453. loopalign : 4;
  454. jumpalign : 0;
  455. constalignmin : 0;
  456. constalignmax : 1;
  457. varalignmin : 0;
  458. varalignmax : 1;
  459. localalignmin : 0;
  460. localalignmax : 1;
  461. paraalign : 4;
  462. recordalignmin : 0;
  463. recordalignmax : 2;
  464. maxCrecordalign : 4
  465. );
  466. size_of_pointer : 4;
  467. size_of_longint : 4;
  468. heapsize : 256*1024;
  469. maxheapsize : 32768*1024;
  470. stacksize : 8192;
  471. DllScanSupported:false;
  472. use_bound_instruction : false;
  473. use_function_relative_addresses : true
  474. );
  475. {$endif i386}
  476. {$ifdef m68k}
  477. const
  478. target_m68k_linux_info : ttargetinfo =
  479. (
  480. target : target_m68k_linux;
  481. name : 'Linux for m68k';
  482. shortname : 'linux';
  483. flags : [];
  484. cpu : m68k;
  485. short_name : 'LINUX';
  486. unit_env : 'LINUXUNITS';
  487. extradefines : 'UNIX';
  488. sharedlibext : '.so';
  489. staticlibext : '.a';
  490. sourceext : '.pp';
  491. pasext : '.pas';
  492. exeext : '';
  493. defext : '';
  494. scriptext : '.sh';
  495. smartext : '.sl';
  496. unitext : '.ppu';
  497. unitlibext : '.ppl';
  498. asmext : '.s';
  499. objext : '.o';
  500. resext : '.res';
  501. resobjext : '.or';
  502. staticlibprefix : 'libp';
  503. sharedlibprefix : 'lib';
  504. Cprefix : '';
  505. newline : #10;
  506. assem : as_m68k_as;
  507. assemextern : as_m68k_as;
  508. link : ld_m68k_linux;
  509. linkextern : ld_m68k_linux;
  510. ar : ar_m68k_ar;
  511. res : res_none;
  512. endian : endian_big;
  513. stackalignment : 2;
  514. maxCrecordalignment : 32;
  515. size_of_pointer : 4;
  516. size_of_longint : 4;
  517. heapsize : 128*1024;
  518. maxheapsize : 32768*1024;
  519. stacksize : 8192;
  520. DllScanSupported:false;
  521. use_bound_instruction : false;
  522. use_function_relative_addresses : true
  523. );
  524. {$endif m68k}
  525. {$ifdef powerpc}
  526. const
  527. target_powerpc_linux_info : ttargetinfo =
  528. (
  529. target : target_powerpc_LINUX;
  530. name : 'Linux for PowerPC';
  531. shortname : 'linuxppc';
  532. flags : [];
  533. cpu : powerpc;
  534. short_name : 'LINUX';
  535. unit_env : '';
  536. extradefines : 'UNIX';
  537. sharedlibext : '.so';
  538. staticlibext : '.s';
  539. sourceext : '.pp';
  540. pasext : '.pas';
  541. exeext : '';
  542. defext : '.def';
  543. scriptext : '.sh';
  544. smartext : '.sl';
  545. unitext : '.ppu';
  546. unitlibext : '.ppl';
  547. asmext : '.s';
  548. objext : '.o';
  549. resext : '.res';
  550. resobjext : '.or';
  551. staticlibprefix : 'libp';
  552. sharedlibprefix : 'lib';
  553. Cprefix : '';
  554. newline : #10;
  555. assem : as_powerpc_as;
  556. assemsrc : as_powerpc_as;
  557. ar : ar_powerpc_ar;
  558. res : res_none;
  559. endian : endian_big;
  560. stackalignment : 8;
  561. maxCrecordalignment : 32;
  562. size_of_pointer : 4;
  563. size_of_longint : 4;
  564. heapsize : 256*1024;
  565. maxheapsize : 32768*1024;
  566. stacksize : 8192;
  567. DllScanSupported:false;
  568. use_bound_instruction : false;
  569. use_function_relative_addresses : true
  570. );
  571. {$endif powerpc}
  572. {$ifdef alpha}
  573. const
  574. target_alpha_linux_info : ttargetinfo =
  575. (
  576. target : target_alpha_LINUX;
  577. name : 'Linux for Alpha';
  578. shortname : 'axplinux';
  579. flags : [];
  580. cpu : alpha;
  581. short_name : 'LINUX';
  582. unit_env : 'LINUXUNITS';
  583. extradefines : 'UNIX';
  584. sharedlibext : '.so';
  585. staticlibext : '.a';
  586. sourceext : '.pp';
  587. pasext : '.pas';
  588. exeext : '';
  589. defext : '.def';
  590. scriptext : '.sh';
  591. smartext : '.sl';
  592. unitext : '.ppu';
  593. unitlibext : '.ppl';
  594. asmext : '.s';
  595. objext : '.o';
  596. resext : '.res';
  597. resobjext : '.or';
  598. staticlibprefix : 'libp';
  599. sharedlibprefix : 'lib';
  600. Cprefix : '';
  601. newline : #10;
  602. assem : as_alpha_as;
  603. assemextern : as_alpha_as;
  604. link : ld_alpha_linux;
  605. linkextern : ld_alpha_linux;
  606. ar : ar_alpha_ar;
  607. res : res_none;
  608. endian : endian_little;
  609. stackalignment : 8;
  610. maxCrecordalignment : 32;
  611. size_of_pointer : 8;
  612. size_of_longint : 4;
  613. heapsize : 256*1024;
  614. maxheapsize : 32768*1024;
  615. stacksize : 8192;
  616. DllScanSupported:false;
  617. use_bound_instruction : false;
  618. use_function_relative_addresses : true
  619. );
  620. {$endif alpha}
  621. initialization
  622. {$ifdef i386}
  623. RegisterLinker(ld_i386_linux,TLinkerLinux);
  624. RegisterImport(target_i386_linux,timportliblinux);
  625. RegisterExport(target_i386_linux,texportliblinux);
  626. RegisterTarget(target_i386_linux_info);
  627. {$endif i386}
  628. {$ifdef m68k}
  629. RegisterLinker(ld_m68k_linux,TLinkerLinux);
  630. RegisterImport(target_m68k_linux,timportliblinux);
  631. RegisterExport(target_m68k_linux,texportliblinux);
  632. RegisterTarget(target_m68k_linux_info);
  633. {$endif m68k}
  634. {$ifdef powerpc}
  635. RegisterLinker(ld_powerpc_linux,TLinkerLinux);
  636. RegisterImport(target_powerpc_linux,timportliblinux);
  637. RegisterExport(target_powerpc_linux,texportliblinux);
  638. RegisterTarget(target_powerpc_linux_info);
  639. {$endif powerpc}
  640. {$ifdef alpha}
  641. RegisterLinker(ld_alpha_linux,TLinkerLinux);
  642. RegisterImport(target_alpha_linux,timportliblinux);
  643. RegisterExport(target_alpha_linux,texportliblinux);
  644. RegisterTarget(target_alpha_linux_info);
  645. {$endif alpha}
  646. end.
  647. {
  648. $Log$
  649. Revision 1.10 2001-07-01 20:16:20 peter
  650. * alignmentinfo record added
  651. * -Oa argument supports more alignment settings that can be specified
  652. per type: PROC,LOOP,VARMIN,VARMAX,CONSTMIN,CONSTMAX,RECORDMIN
  653. RECORDMAX,LOCALMIN,LOCALMAX. It is possible to set the mimimum
  654. required alignment and the maximum usefull alignment. The final
  655. alignment will be choosen per variable size dependent on these
  656. settings
  657. Revision 1.9 2001/06/28 19:46:25 peter
  658. * added override and virtual for constructors
  659. Revision 1.8 2001/06/04 11:51:06 peter
  660. * C linking fixed
  661. Revision 1.7 2001/06/03 15:15:31 peter
  662. * dllprt0 stub for linux shared libs
  663. * pass -init and -fini for linux shared libs
  664. * libprefix splitted into staticlibprefix and sharedlibprefix
  665. Revision 1.6 2001/06/02 19:22:44 peter
  666. * extradefines field added
  667. Revision 1.5 2001/04/21 15:34:01 peter
  668. * fixed writing of end objects to not output an empty INPUT()
  669. Revision 1.4 2001/04/18 22:02:04 peter
  670. * registration of targets and assemblers
  671. Revision 1.3 2001/04/13 01:22:21 peter
  672. * symtable change to classes
  673. * range check generation and errors fixed, make cycle DEBUG=1 works
  674. * memory leaks fixed
  675. Revision 1.2 2001/03/22 10:08:12 michael
  676. + .ctor patch merged from fixbranch
  677. Revision 1.1 2001/02/26 19:43:11 peter
  678. * moved target units to subdir
  679. Revision 1.11 2001/02/20 21:41:17 peter
  680. * new fixfilename, findfile for unix. Look first for lowercase, then
  681. NormalCase and last for UPPERCASE names.
  682. Revision 1.10 2000/12/30 22:53:25 peter
  683. * export with the case provided in the exports section
  684. Revision 1.9 2000/12/25 00:07:30 peter
  685. + new tlinkedlist class (merge of old tstringqueue,tcontainer and
  686. tlinkedlist objects)
  687. Revision 1.8 2000/10/31 22:02:54 peter
  688. * symtable splitted, no real code changes
  689. Revision 1.7 2000/09/24 21:33:47 peter
  690. * message updates merges
  691. Revision 1.6 2000/09/24 15:06:31 peter
  692. * use defines.inc
  693. Revision 1.5 2000/09/10 20:26:55 peter
  694. * bsd patches from marco
  695. Revision 1.4 2000/08/27 16:11:54 peter
  696. * moved some util functions from globals,cobjects to cutils
  697. * splitted files into finput,fmodule
  698. Revision 1.3 2000/07/13 12:08:28 michael
  699. + patched to 1.1.0 with former 1.09patch from peter
  700. Revision 1.2 2000/07/13 11:32:50 michael
  701. + removed logs
  702. }