t_fbsd.pas 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806
  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.set_mangledname(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 : 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 : 4;
  482. varalignmin : 0;
  483. varalignmax : 4;
  484. localalignmin : 0;
  485. localalignmax : 4;
  486. paraalign : 4;
  487. recordalignmin : 0;
  488. recordalignmax : 2;
  489. maxCrecordalign : 4
  490. );
  491. first_parm_offset : 8;
  492. heapsize : 256*1024;
  493. stacksize : 262144;
  494. DllScanSupported:false;
  495. use_function_relative_addresses : true
  496. );
  497. target_i386_netbsd_info : ttargetinfo =
  498. (
  499. target : target_i386_NetBSD;
  500. name : 'NetBSD for i386';
  501. shortname : 'NetBSD';
  502. flags : [tf_under_development];
  503. cpu : cpu_i386;
  504. unit_env : 'BSDUNITS';
  505. extradefines : 'UNIX;BSD';
  506. sourceext : '.pp';
  507. pasext : '.pas';
  508. exeext : '';
  509. defext : '.def';
  510. scriptext : '.sh';
  511. smartext : '.sl';
  512. unitext : '.ppu';
  513. unitlibext : '.ppl';
  514. asmext : '.s';
  515. objext : '.o';
  516. resext : '.res';
  517. resobjext : '.or';
  518. sharedlibext : '.so';
  519. staticlibext : '.a';
  520. staticlibprefix : 'libp';
  521. sharedlibprefix : 'lib';
  522. sharedClibext : '.so';
  523. staticClibext : '.a';
  524. staticClibprefix : 'lib';
  525. sharedClibprefix : 'lib';
  526. Cprefix : '_';
  527. newline : #10;
  528. dirsep : '/';
  529. files_case_relevent : true;
  530. assem : as_i386_as;
  531. assemextern : as_i386_as;
  532. link : ld_i386_freebsd;
  533. linkextern : ld_i386_freebsd;
  534. ar : ar_gnu_ar;
  535. res : res_none;
  536. script : script_unix;
  537. endian : endian_little;
  538. alignment :
  539. (
  540. procalign : 4;
  541. loopalign : 4;
  542. jumpalign : 0;
  543. constalignmin : 0;
  544. constalignmax : 1;
  545. varalignmin : 0;
  546. varalignmax : 1;
  547. localalignmin : 0;
  548. localalignmax : 1;
  549. paraalign : 4;
  550. recordalignmin : 0;
  551. recordalignmax : 2;
  552. maxCrecordalign : 4
  553. );
  554. first_parm_offset : 8;
  555. heapsize : 256*1024;
  556. stacksize : 262144;
  557. DllScanSupported: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 : 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. first_parm_offset : 8;
  621. heapsize : 256*1024;
  622. stacksize : 262144;
  623. DllScanSupported:false;
  624. use_function_relative_addresses : true
  625. );
  626. {$endif m68k}
  627. initialization
  628. {$ifdef i386}
  629. RegisterLinker(ld_i386_freebsd,TLinkerFreeBSD);
  630. RegisterImport(target_i386_freebsd,timportlibfreebsd);
  631. RegisterExport(target_i386_freebsd,texportlibfreebsd);
  632. RegisterTarget(target_i386_freebsd_info);
  633. RegisterImport(target_i386_netbsd,timportlibfreebsd);
  634. RegisterExport(target_i386_netbsd,texportlibfreebsd);
  635. RegisterTarget(target_i386_netbsd_info);
  636. {$endif i386}
  637. {$ifdef m68k}
  638. RegisterLinker(ld_m68k_freebsd,TLinkerFreeBSD);
  639. RegisterImport(target_m68k_netbsd,timportlibfreebsd);
  640. RegisterExport(target_m68k_netbsd,texportlibfreebsd);
  641. RegisterTarget(target_m68k_netbsd_info);
  642. {$endif m68k}
  643. end.
  644. {
  645. $Log$
  646. Revision 1.18 2002-04-22 18:19:22 carl
  647. - remove use_bound_instruction field
  648. Revision 1.17 2002/04/20 21:43:18 carl
  649. * fix stack size for some targets
  650. + add offset to parameters from frame pointer info.
  651. - remove some unused stuff
  652. Revision 1.16 2002/04/19 15:46:04 peter
  653. * mangledname rewrite, tprocdef.mangledname is now created dynamicly
  654. in most cases and not written to the ppu
  655. * add mangeledname_prefix() routine to generate the prefix of
  656. manglednames depending on the current procedure, object and module
  657. * removed static procprefix since the mangledname is now build only
  658. on demand from tprocdef.mangledname
  659. Revision 1.15 2002/04/15 19:16:57 carl
  660. - remove size_of_pointer field
  661. Revision 1.14 2002/01/29 21:27:34 peter
  662. * default alignment changed to 4 bytes for locals and static const,var
  663. Revision 1.13 2001/11/02 22:58:11 peter
  664. * procsym definition rewrite
  665. Revision 1.12 2001/09/18 11:32:00 michael
  666. * Fixes win32 linking problems with import libraries
  667. * LINKLIB Libraries are now looked for using C file extensions
  668. * get_exepath fix
  669. Revision 1.11 2001/09/17 21:29:16 peter
  670. * merged netbsd, fpu-overflow from fixes branch
  671. Revision 1.10 2001/08/12 17:57:07 peter
  672. * under development flag for targets
  673. Revision 1.9 2001/08/07 18:47:15 peter
  674. * merged netbsd start
  675. * profile for win32
  676. Revision 1.8 2001/07/01 20:16:20 peter
  677. * alignmentinfo record added
  678. * -Oa argument supports more alignment settings that can be specified
  679. per type: PROC,LOOP,VARMIN,VARMAX,CONSTMIN,CONSTMAX,RECORDMIN
  680. RECORDMAX,LOCALMIN,LOCALMAX. It is possible to set the mimimum
  681. required alignment and the maximum usefull alignment. The final
  682. alignment will be choosen per variable size dependent on these
  683. settings
  684. Revision 1.7 2001/06/28 19:46:25 peter
  685. * added override and virtual for constructors
  686. Revision 1.6 2001/06/03 15:15:31 peter
  687. * dllprt0 stub for linux shared libs
  688. * pass -init and -fini for linux shared libs
  689. * libprefix splitted into staticlibprefix and sharedlibprefix
  690. Revision 1.5 2001/06/02 19:22:44 peter
  691. * extradefines field added
  692. Revision 1.4 2001/04/21 15:34:01 peter
  693. * fixed writing of end objects to not output an empty INPUT()
  694. Revision 1.3 2001/04/18 22:02:04 peter
  695. * registration of targets and assemblers
  696. Revision 1.2 2001/04/13 01:22:21 peter
  697. * symtable change to classes
  698. * range check generation and errors fixed, make cycle DEBUG=1 works
  699. * memory leaks fixed
  700. Revision 1.1 2001/02/26 19:43:11 peter
  701. * moved target units to subdir
  702. Revision 1.7 2001/02/20 21:41:17 peter
  703. * new fixfilename, findfile for unix. Look first for lowercase, then
  704. NormalCase and last for UPPERCASE names.
  705. Revision 1.6 2000/12/30 22:53:25 peter
  706. * export with the case provided in the exports section
  707. Revision 1.5 2000/12/25 00:07:30 peter
  708. + new tlinkedlist class (merge of old tstringqueue,tcontainer and
  709. tlinkedlist objects)
  710. Revision 1.4 2000/10/31 22:02:53 peter
  711. * symtable splitted, no real code changes
  712. Revision 1.3 2000/09/24 21:33:47 peter
  713. * message updates merges
  714. Revision 1.2 2000/09/24 15:12:12 peter
  715. * renamed to be 8.3
  716. Revision 1.2 2000/09/16 12:24:00 peter
  717. * freebsd support routines
  718. }