t_linux.pas 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795
  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. script : script_unix;
  450. endian : endian_little;
  451. alignment :
  452. (
  453. procalign : 4;
  454. loopalign : 4;
  455. jumpalign : 0;
  456. constalignmin : 0;
  457. constalignmax : 1;
  458. varalignmin : 0;
  459. varalignmax : 1;
  460. localalignmin : 0;
  461. localalignmax : 1;
  462. paraalign : 4;
  463. recordalignmin : 0;
  464. recordalignmax : 2;
  465. maxCrecordalign : 4
  466. );
  467. size_of_pointer : 4;
  468. size_of_longint : 4;
  469. heapsize : 256*1024;
  470. maxheapsize : 32768*1024;
  471. stacksize : 8192;
  472. DllScanSupported:false;
  473. use_bound_instruction : false;
  474. use_function_relative_addresses : true
  475. );
  476. {$endif i386}
  477. {$ifdef m68k}
  478. const
  479. target_m68k_linux_info : ttargetinfo =
  480. (
  481. target : target_m68k_linux;
  482. name : 'Linux for m68k';
  483. shortname : 'linux';
  484. flags : [];
  485. cpu : m68k;
  486. short_name : 'LINUX';
  487. unit_env : 'LINUXUNITS';
  488. extradefines : 'UNIX';
  489. sharedlibext : '.so';
  490. staticlibext : '.a';
  491. sourceext : '.pp';
  492. pasext : '.pas';
  493. exeext : '';
  494. defext : '';
  495. scriptext : '.sh';
  496. smartext : '.sl';
  497. unitext : '.ppu';
  498. unitlibext : '.ppl';
  499. asmext : '.s';
  500. objext : '.o';
  501. resext : '.res';
  502. resobjext : '.or';
  503. staticlibprefix : 'libp';
  504. sharedlibprefix : 'lib';
  505. Cprefix : '';
  506. newline : #10;
  507. assem : as_m68k_as;
  508. assemextern : as_m68k_as;
  509. link : ld_m68k_linux;
  510. linkextern : ld_m68k_linux;
  511. ar : ar_m68k_ar;
  512. res : res_none;
  513. script : script_unix;
  514. endian : endian_big;
  515. stackalignment : 2;
  516. maxCrecordalignment : 32;
  517. size_of_pointer : 4;
  518. size_of_longint : 4;
  519. heapsize : 128*1024;
  520. maxheapsize : 32768*1024;
  521. stacksize : 8192;
  522. DllScanSupported:false;
  523. use_bound_instruction : false;
  524. use_function_relative_addresses : true
  525. );
  526. {$endif m68k}
  527. {$ifdef powerpc}
  528. const
  529. target_powerpc_linux_info : ttargetinfo =
  530. (
  531. target : target_powerpc_LINUX;
  532. name : 'Linux for PowerPC';
  533. shortname : 'linuxppc';
  534. flags : [];
  535. cpu : powerpc;
  536. short_name : 'LINUX';
  537. unit_env : '';
  538. extradefines : 'UNIX';
  539. sharedlibext : '.so';
  540. staticlibext : '.s';
  541. sourceext : '.pp';
  542. pasext : '.pas';
  543. exeext : '';
  544. defext : '.def';
  545. scriptext : '.sh';
  546. smartext : '.sl';
  547. unitext : '.ppu';
  548. unitlibext : '.ppl';
  549. asmext : '.s';
  550. objext : '.o';
  551. resext : '.res';
  552. resobjext : '.or';
  553. staticlibprefix : 'libp';
  554. sharedlibprefix : 'lib';
  555. Cprefix : '';
  556. newline : #10;
  557. assem : as_powerpc_as;
  558. assemsrc : as_powerpc_as;
  559. ar : ar_powerpc_ar;
  560. res : res_none;
  561. script : script_unix;
  562. endian : endian_big;
  563. stackalignment : 8;
  564. maxCrecordalignment : 32;
  565. size_of_pointer : 4;
  566. size_of_longint : 4;
  567. heapsize : 256*1024;
  568. maxheapsize : 32768*1024;
  569. stacksize : 8192;
  570. DllScanSupported:false;
  571. use_bound_instruction : false;
  572. use_function_relative_addresses : true
  573. );
  574. {$endif powerpc}
  575. {$ifdef alpha}
  576. const
  577. target_alpha_linux_info : ttargetinfo =
  578. (
  579. target : target_alpha_LINUX;
  580. name : 'Linux for Alpha';
  581. shortname : 'axplinux';
  582. flags : [];
  583. cpu : alpha;
  584. short_name : 'LINUX';
  585. unit_env : 'LINUXUNITS';
  586. extradefines : 'UNIX';
  587. sharedlibext : '.so';
  588. staticlibext : '.a';
  589. sourceext : '.pp';
  590. pasext : '.pas';
  591. exeext : '';
  592. defext : '.def';
  593. scriptext : '.sh';
  594. smartext : '.sl';
  595. unitext : '.ppu';
  596. unitlibext : '.ppl';
  597. asmext : '.s';
  598. objext : '.o';
  599. resext : '.res';
  600. resobjext : '.or';
  601. staticlibprefix : 'libp';
  602. sharedlibprefix : 'lib';
  603. Cprefix : '';
  604. newline : #10;
  605. assem : as_alpha_as;
  606. assemextern : as_alpha_as;
  607. link : ld_alpha_linux;
  608. linkextern : ld_alpha_linux;
  609. ar : ar_alpha_ar;
  610. res : res_none;
  611. script : script_unix;
  612. endian : endian_little;
  613. stackalignment : 8;
  614. maxCrecordalignment : 32;
  615. size_of_pointer : 8;
  616. size_of_longint : 4;
  617. heapsize : 256*1024;
  618. maxheapsize : 32768*1024;
  619. stacksize : 8192;
  620. DllScanSupported:false;
  621. use_bound_instruction : false;
  622. use_function_relative_addresses : true
  623. );
  624. {$endif alpha}
  625. initialization
  626. {$ifdef i386}
  627. RegisterLinker(ld_i386_linux,TLinkerLinux);
  628. RegisterImport(target_i386_linux,timportliblinux);
  629. RegisterExport(target_i386_linux,texportliblinux);
  630. RegisterTarget(target_i386_linux_info);
  631. {$endif i386}
  632. {$ifdef m68k}
  633. RegisterLinker(ld_m68k_linux,TLinkerLinux);
  634. RegisterImport(target_m68k_linux,timportliblinux);
  635. RegisterExport(target_m68k_linux,texportliblinux);
  636. RegisterTarget(target_m68k_linux_info);
  637. {$endif m68k}
  638. {$ifdef powerpc}
  639. RegisterLinker(ld_powerpc_linux,TLinkerLinux);
  640. RegisterImport(target_powerpc_linux,timportliblinux);
  641. RegisterExport(target_powerpc_linux,texportliblinux);
  642. RegisterTarget(target_powerpc_linux_info);
  643. {$endif powerpc}
  644. {$ifdef alpha}
  645. RegisterLinker(ld_alpha_linux,TLinkerLinux);
  646. RegisterImport(target_alpha_linux,timportliblinux);
  647. RegisterExport(target_alpha_linux,texportliblinux);
  648. RegisterTarget(target_alpha_linux_info);
  649. {$endif alpha}
  650. end.
  651. {
  652. $Log$
  653. Revision 1.11 2001-08-07 18:47:15 peter
  654. * merged netbsd start
  655. * profile for win32
  656. Revision 1.10 2001/07/01 20:16:20 peter
  657. * alignmentinfo record added
  658. * -Oa argument supports more alignment settings that can be specified
  659. per type: PROC,LOOP,VARMIN,VARMAX,CONSTMIN,CONSTMAX,RECORDMIN
  660. RECORDMAX,LOCALMIN,LOCALMAX. It is possible to set the mimimum
  661. required alignment and the maximum usefull alignment. The final
  662. alignment will be choosen per variable size dependent on these
  663. settings
  664. Revision 1.9 2001/06/28 19:46:25 peter
  665. * added override and virtual for constructors
  666. Revision 1.8 2001/06/04 11:51:06 peter
  667. * C linking fixed
  668. Revision 1.7 2001/06/03 15:15:31 peter
  669. * dllprt0 stub for linux shared libs
  670. * pass -init and -fini for linux shared libs
  671. * libprefix splitted into staticlibprefix and sharedlibprefix
  672. Revision 1.6 2001/06/02 19:22:44 peter
  673. * extradefines field added
  674. Revision 1.5 2001/04/21 15:34:01 peter
  675. * fixed writing of end objects to not output an empty INPUT()
  676. Revision 1.4 2001/04/18 22:02:04 peter
  677. * registration of targets and assemblers
  678. Revision 1.3 2001/04/13 01:22:21 peter
  679. * symtable change to classes
  680. * range check generation and errors fixed, make cycle DEBUG=1 works
  681. * memory leaks fixed
  682. Revision 1.2 2001/03/22 10:08:12 michael
  683. + .ctor patch merged from fixbranch
  684. Revision 1.1 2001/02/26 19:43:11 peter
  685. * moved target units to subdir
  686. Revision 1.11 2001/02/20 21:41:17 peter
  687. * new fixfilename, findfile for unix. Look first for lowercase, then
  688. NormalCase and last for UPPERCASE names.
  689. Revision 1.10 2000/12/30 22:53:25 peter
  690. * export with the case provided in the exports section
  691. Revision 1.9 2000/12/25 00:07:30 peter
  692. + new tlinkedlist class (merge of old tstringqueue,tcontainer and
  693. tlinkedlist objects)
  694. Revision 1.8 2000/10/31 22:02:54 peter
  695. * symtable splitted, no real code changes
  696. Revision 1.7 2000/09/24 21:33:47 peter
  697. * message updates merges
  698. Revision 1.6 2000/09/24 15:06:31 peter
  699. * use defines.inc
  700. Revision 1.5 2000/09/10 20:26:55 peter
  701. * bsd patches from marco
  702. Revision 1.4 2000/08/27 16:11:54 peter
  703. * moved some util functions from globals,cobjects to cutils
  704. * splitted files into finput,fmodule
  705. Revision 1.3 2000/07/13 12:08:28 michael
  706. + patched to 1.1.0 with former 1.09patch from peter
  707. Revision 1.2 2000/07/13 11:32:50 michael
  708. + removed logs
  709. }