t_fbsd.pas 24 KB

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