t_linux.pas 25 KB

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