t_fbsd.pas 24 KB

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