t_bsd.pas 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630
  1. {
  2. Copyright (c) 1998-2002 by Peter Vreman (original Linux)
  3. (c) 2000 by Marco van de Voort (FreeBSD mods)
  4. This unit implements support import,export,link routines
  5. for the (i386)FreeBSD 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_bsd;
  20. {$i fpcdefs.inc}
  21. interface
  22. implementation
  23. uses
  24. {$ifdef gdb}
  25. gdb,
  26. {$endif gdb}
  27. cutils,cclasses,
  28. verbose,systems,globtype,globals,
  29. symconst,script,
  30. fmodule,aasmbase,aasmtai,aasmcpu,cpubase,symsym,symdef,
  31. import,export,link,i_bsd,
  32. cgutils,cgbase,cgobj,cpuinfo;
  33. type
  34. tdarwinimported_item = class(timported_item)
  35. procdef : tprocdef;
  36. end;
  37. timportlibdarwin=class(timportlib)
  38. procedure preparelib(const s:string);override;
  39. procedure importprocedure(aprocdef:tprocdef;const module:string;index:longint;const name:string);override;
  40. procedure importvariable(vs:tglobalvarsym;const name,module:string);override;
  41. procedure generatelib;override;
  42. procedure generatesmartlib;override;
  43. end;
  44. timportlibbsd=class(timportlib)
  45. procedure preparelib(const s:string);override;
  46. procedure importprocedure(aprocdef:tprocdef;const module:string;index:longint;const name:string);override;
  47. procedure importvariable(vs:tglobalvarsym;const name,module:string);override;
  48. procedure generatelib;override;
  49. end;
  50. texportlibbsd=class(texportlib)
  51. procedure preparelib(const s : string);override;
  52. procedure exportprocedure(hp : texported_item);override;
  53. procedure exportvar(hp : texported_item);override;
  54. procedure generatelib;override;
  55. end;
  56. tlinkerbsd=class(texternallinker)
  57. private
  58. LdSupportsNoResponseFile : boolean;
  59. LibrarySuffix : Char;
  60. Function WriteResponseFile(isdll:boolean) : Boolean;
  61. public
  62. constructor Create;override;
  63. procedure SetDefaultInfo;override;
  64. function MakeExecutable:boolean;override;
  65. function MakeSharedLibrary:boolean;override;
  66. end;
  67. {*****************************************************************************
  68. TIMPORTLIBDARWIN
  69. *****************************************************************************}
  70. procedure timportlibdarwin.preparelib(const s : string);
  71. begin
  72. if not(assigned(importssection)) then
  73. importssection:=TAAsmoutput.create;
  74. end;
  75. procedure timportlibdarwin.importprocedure(aprocdef:tprocdef;const module : string;index : longint;const name : string);
  76. begin
  77. { insert sharedlibrary }
  78. { current_module.linkothersharedlibs.add(SplitName(module),link_allways); }
  79. end;
  80. procedure timportlibdarwin.importvariable(vs:tglobalvarsym;const name,module:string);
  81. begin
  82. { insert sharedlibrary }
  83. { current_module.linkothersharedlibs.add(SplitName(module),link_allways); }
  84. { the rest is handled in the nppcld.pas tppcloadnode }
  85. vs.set_mangledname(name);
  86. end;
  87. procedure timportlibdarwin.generatesmartlib;
  88. begin
  89. generatelib;
  90. end;
  91. procedure timportlibdarwin.generatelib;
  92. begin
  93. end;
  94. {*****************************************************************************
  95. TIMPORTLIBBSD
  96. *****************************************************************************}
  97. procedure timportlibbsd.preparelib(const s : string);
  98. begin
  99. end;
  100. procedure timportlibbsd.importprocedure(aprocdef:tprocdef;const module:string;index:longint;const name:string);
  101. begin
  102. { insert sharedlibrary }
  103. current_module.linkothersharedlibs.add(SplitName(module),link_allways);
  104. end;
  105. procedure timportlibbsd.importvariable(vs:tglobalvarsym;const name,module:string);
  106. begin
  107. { insert sharedlibrary }
  108. current_module.linkothersharedlibs.add(SplitName(module),link_allways);
  109. { reset the mangledname and turn off the dll_var option }
  110. vs.set_mangledname(name);
  111. exclude(vs.varoptions,vo_is_dll_var);
  112. end;
  113. procedure timportlibbsd.generatelib;
  114. begin
  115. end;
  116. {*****************************************************************************
  117. TEXPORTLIBBSD
  118. *****************************************************************************}
  119. procedure texportlibbsd.preparelib(const s:string);
  120. begin
  121. end;
  122. procedure texportlibbsd.exportprocedure(hp : texported_item);
  123. var
  124. hp2 : texported_item;
  125. begin
  126. { first test the index value }
  127. if (hp.options and eo_index)<>0 then
  128. begin
  129. Message1(parser_e_no_export_with_index_for_target,'freebsd');
  130. exit;
  131. end;
  132. { now place in correct order }
  133. hp2:=texported_item(current_module._exports.first);
  134. while assigned(hp2) and
  135. (hp.name^>hp2.name^) do
  136. hp2:=texported_item(hp2.next);
  137. { insert hp there !! }
  138. if assigned(hp2) and (hp2.name^=hp.name^) then
  139. begin
  140. { this is not allowed !! }
  141. Message1(parser_e_export_name_double,hp.name^);
  142. exit;
  143. end;
  144. if hp2=texported_item(current_module._exports.first) then
  145. current_module._exports.concat(hp)
  146. else if assigned(hp2) then
  147. begin
  148. hp.next:=hp2;
  149. hp.previous:=hp2.previous;
  150. if assigned(hp2.previous) then
  151. hp2.previous.next:=hp;
  152. hp2.previous:=hp;
  153. end
  154. else
  155. current_module._exports.concat(hp);
  156. end;
  157. procedure texportlibbsd.exportvar(hp : texported_item);
  158. begin
  159. hp.is_var:=true;
  160. exportprocedure(hp);
  161. end;
  162. procedure texportlibbsd.generatelib;
  163. var
  164. hp2 : texported_item;
  165. begin
  166. hp2:=texported_item(current_module._exports.first);
  167. while assigned(hp2) do
  168. begin
  169. if (not hp2.is_var) and
  170. (hp2.sym.typ=procsym) then
  171. begin
  172. { the manglednames can already be the same when the procedure
  173. is declared with cdecl }
  174. if tprocsym(hp2.sym).first_procdef.mangledname<>hp2.name^ then
  175. begin
  176. {$ifdef i386}
  177. { place jump in codesegment }
  178. codesegment.concat(Tai_align.Create_op(4,$90));
  179. codeSegment.concat(Tai_symbol.Createname_global(hp2.name^,AT_FUNCTION,0));
  180. codeSegment.concat(Taicpu.Op_sym(A_JMP,S_NO,objectlibrary.newasmsymbol(tprocsym(hp2.sym).first_procdef.mangledname,AB_EXTERNAL,AT_FUNCTION)));
  181. codeSegment.concat(Tai_symbol_end.Createname(hp2.name^));
  182. {$endif i386}
  183. end;
  184. end
  185. else
  186. Message1(parser_e_no_export_of_variables_for_target,'freebsd');
  187. hp2:=texported_item(hp2.next);
  188. end;
  189. end;
  190. {*****************************************************************************
  191. TLINKERLINUX
  192. *****************************************************************************}
  193. Constructor TLinkerBSD.Create;
  194. begin
  195. Inherited Create;
  196. if not Dontlinkstdlibpath Then
  197. if (target_info.system <> system_powerpc_darwin) then
  198. LibrarySearchPath.AddPath('/lib;/usr/lib;/usr/X11R6/lib',true)
  199. else
  200. { Mac OS X doesn't have a /lib }
  201. LibrarySearchPath.AddPath('/usr/lib',true)
  202. end;
  203. procedure TLinkerBSD.SetDefaultInfo;
  204. {
  205. This will also detect which libc version will be used
  206. }
  207. begin
  208. LibrarySuffix:=' ';
  209. LdSupportsNoResponseFile := (target_info.system in [system_m68k_netbsd,system_powerpc_darwin]);
  210. with Info do
  211. begin
  212. if LdSupportsNoResponseFile then
  213. begin
  214. ExeCmd[1]:='ld $OPT $DYNLINK $STATIC $GCSECTIONS $STRIP -L. -o $EXE `cat $RES`';
  215. end
  216. else
  217. ExeCmd[1]:='ld $OPT $DYNLINK $STATIC $GCSECTIONS $STRIP -L. -o $EXE $RES';
  218. DllCmd[1]:='ld $OPT $INIT $FINI $SONAME -shared -L. -o $EXE $RES';
  219. DllCmd[2]:='strip --strip-unneeded $EXE';
  220. { first try glibc2 }
  221. {$ifdef GLIBC2} {Keep linux code in place. FBSD might go to a different
  222. glibc too once}
  223. DynamicLinker:='/lib/ld-linux.so.2';
  224. if FileExists(DynamicLinker) then
  225. begin
  226. Glibc2:=true;
  227. { Check for 2.0 files, else use the glibc 2.1 stub }
  228. if FileExists('/lib/ld-2.0.*') then
  229. Glibc21:=false
  230. else
  231. Glibc21:=true;
  232. end
  233. else
  234. DynamicLinker:='/lib/ld-linux.so.1';
  235. {$else}
  236. DynamicLinker:='';
  237. {$endif}
  238. end;
  239. end;
  240. Function TLinkerBSD.WriteResponseFile(isdll:boolean) : Boolean;
  241. Var
  242. linkres : TLinkRes;
  243. i : longint;
  244. cprtobj,
  245. gprtobj,
  246. prtobj : string[80];
  247. HPath : TStringListItem;
  248. s,s1,s2 : string;
  249. linkpthread,
  250. linkdynamic,
  251. linklibc : boolean;
  252. Fl1,Fl2 : Boolean;
  253. begin
  254. WriteResponseFile:=False;
  255. { set special options for some targets }
  256. if target_info.system <> system_powerpc_darwin then
  257. begin
  258. linkdynamic:=not(SharedLibFiles.empty);
  259. linklibc:=(SharedLibFiles.Find('c')<>nil);
  260. linkpthread:=(SharedLibFiles.Find('pthread')<>nil);
  261. if (target_info.system =system_i386_freebsd) and linkpthread Then
  262. Begin
  263. if not (cs_link_pthread in aktglobalswitches) Then
  264. begin
  265. {delete pthreads from list, in this case it is in libc_r}
  266. SharedLibFiles.Remove(SharedLibFiles.Find('pthread').str);
  267. LibrarySuffix:='r';
  268. end;
  269. End;
  270. prtobj:='prt0';
  271. cprtobj:='cprt0';
  272. gprtobj:='gprt0';
  273. if cs_profile in aktmoduleswitches then
  274. begin
  275. prtobj:=gprtobj;
  276. AddSharedLibrary('c');
  277. LibrarySuffix:='p';
  278. linklibc:=true;
  279. end
  280. else
  281. begin
  282. if linklibc then
  283. prtobj:=cprtobj;
  284. end;
  285. end
  286. else
  287. begin
  288. { for darwin: always link dynamically against libc }
  289. linklibc := true;
  290. if not(cs_profile in aktmoduleswitches) then
  291. prtobj:='/usr/lib/crt1.o'
  292. else
  293. prtobj:='/usr/lib/gcrt1.o';
  294. end;
  295. { Open link.res file }
  296. LinkRes:=TLinkRes.Create(outputexedir+Info.ResName);
  297. { Write path to search libraries }
  298. HPath:=TStringListItem(current_module.locallibrarysearchpath.First);
  299. while assigned(HPath) do
  300. begin
  301. if LdSupportsNoResponseFile then
  302. LinkRes.Add(maybequoted('-L'+HPath.Str))
  303. else
  304. LinkRes.Add('SEARCH_DIR('+maybequoted(HPath.Str)+')');
  305. HPath:=TStringListItem(HPath.Next);
  306. end;
  307. HPath:=TStringListItem(LibrarySearchPath.First);
  308. while assigned(HPath) do
  309. begin
  310. if LdSupportsNoResponseFile then
  311. LinkRes.Add(maybequoted('-L'+HPath.Str))
  312. else
  313. LinkRes.Add('SEARCH_DIR('+maybequoted(HPath.Str)+')');
  314. HPath:=TStringListItem(HPath.Next);
  315. end;
  316. if not LdSupportsNoResponseFile then
  317. LinkRes.Add('INPUT(');
  318. { add objectfiles, start with prt0 always }
  319. if prtobj<>'' then
  320. LinkRes.AddFileName(FindObjectFile(prtobj,'',false));
  321. { try to add crti and crtbegin if linking to C }
  322. if linklibc and
  323. (target_info.system <> system_powerpc_darwin) then
  324. begin
  325. if librarysearchpath.FindFile('crtbegin.o',s) then
  326. LinkRes.AddFileName(s);
  327. if librarysearchpath.FindFile('crti.o',s) then
  328. LinkRes.AddFileName(s);
  329. end;
  330. { main objectfiles }
  331. while not ObjectFiles.Empty do
  332. begin
  333. s:=ObjectFiles.GetFirst;
  334. if s<>'' then
  335. LinkRes.AddFileName(maybequoted(s));
  336. end;
  337. if not LdSupportsNoResponseFile then
  338. LinkRes.Add(')');
  339. { Write staticlibraries }
  340. if not StaticLibFiles.Empty then
  341. begin
  342. if not LdSupportsNoResponseFile then
  343. LinkRes.Add('GROUP(');
  344. While not StaticLibFiles.Empty do
  345. begin
  346. S:=StaticLibFiles.GetFirst;
  347. LinkRes.AddFileName(maybequoted(s))
  348. end;
  349. if not LdSupportsNoResponseFile then
  350. LinkRes.Add(')');
  351. end;
  352. { Write sharedlibraries like -l<lib>, also add the needed dynamic linker
  353. here to be sure that it gets linked this is needed for glibc2 systems (PFV) }
  354. if not SharedLibFiles.Empty then
  355. begin
  356. if not LdSupportsNoResponseFile then
  357. LinkRes.Add('INPUT(');
  358. While not SharedLibFiles.Empty do
  359. begin
  360. S:=SharedLibFiles.GetFirst;
  361. if s<>'c' then
  362. begin
  363. i:=Pos(target_info.sharedlibext,S);
  364. if i>0 then
  365. Delete(S,i,255);
  366. LinkRes.Add('-l'+s);
  367. end
  368. else
  369. begin
  370. linklibc:=true;
  371. linkdynamic:=false; { libc will include the ld-linux for us }
  372. end;
  373. end;
  374. { be sure that libc is the last lib }
  375. if linklibc then
  376. Begin
  377. If LibrarySuffix=' ' Then
  378. LinkRes.Add('-lc')
  379. else
  380. LinkRes.Add('-lc_'+LibrarySuffix);
  381. If LibrarySuffix='r' Then
  382. LinkRes.Add('-lc');
  383. end;
  384. { when we have -static for the linker the we also need libgcc }
  385. if (cs_link_staticflag in aktglobalswitches) then
  386. LinkRes.Add('-lgcc');
  387. if linkdynamic and (Info.DynamicLinker<>'') then
  388. LinkRes.AddFileName(Info.DynamicLinker);
  389. if not LdSupportsNoResponseFile then
  390. LinkRes.Add(')');
  391. end;
  392. { objects which must be at the end }
  393. if linklibc and
  394. (target_info.system <> system_powerpc_darwin) then
  395. begin
  396. Fl1:=librarysearchpath.FindFile('crtend.o',s1);
  397. Fl2:=librarysearchpath.FindFile('crtn.o',s2);
  398. if Fl1 or Fl2 then
  399. begin
  400. LinkRes.Add('INPUT(');
  401. If Fl1 Then
  402. LinkRes.AddFileName(s1);
  403. If Fl2 Then
  404. LinkRes.AddFileName(s2);
  405. LinkRes.Add(')');
  406. end;
  407. end;
  408. { Write and Close response }
  409. linkres.writetodisk;
  410. linkres.Free;
  411. WriteResponseFile:=True;
  412. end;
  413. function TLinkerBSD.MakeExecutable:boolean;
  414. var
  415. binstr : String;
  416. cmdstr : TCmdStr;
  417. success : boolean;
  418. DynLinkStr : string[60];
  419. GCSectionsStr,
  420. StaticStr,
  421. StripStr : string[40];
  422. begin
  423. if not(cs_link_extern in aktglobalswitches) then
  424. Message1(exec_i_linking,current_module.exefilename^);
  425. { Create some replacements }
  426. StaticStr:='';
  427. StripStr:='';
  428. DynLinkStr:='';
  429. GCSectionsStr:='';
  430. if (cs_link_staticflag in aktglobalswitches) then
  431. begin
  432. if (target_info.system=system_m68k_netbsd) and
  433. ((cs_link_on_target in aktglobalswitches) or
  434. (target_info.system=source_info.system)) then
  435. StaticStr:='-Bstatic'
  436. else
  437. StaticStr:='-static';
  438. end;
  439. if (cs_link_strip in aktglobalswitches) then
  440. if (target_info.system <> system_powerpc_darwin) then
  441. StripStr:='-s'
  442. else
  443. StripStr:='-x';
  444. if (cs_link_smart in aktglobalswitches) and
  445. (tf_smartlink_sections in target_info.flags) then
  446. GCSectionsStr:='--gc-sections';
  447. If (cs_profile in aktmoduleswitches) or
  448. ((Info.DynamicLinker<>'') and (not SharedLibFiles.Empty)) then
  449. DynLinkStr:='-dynamic-linker='+Info.DynamicLinker;
  450. if CShared Then
  451. DynLinKStr:=DynLinkStr+' --shared';
  452. { Write used files and libraries }
  453. WriteResponseFile(false);
  454. { Call linker }
  455. SplitBinCmd(Info.ExeCmd[1],binstr,cmdstr);
  456. Replace(cmdstr,'$EXE',maybequoted(current_module.exefilename^));
  457. Replace(cmdstr,'$OPT',Info.ExtraOptions);
  458. Replace(cmdstr,'$RES',maybequoted(outputexedir+Info.ResName));
  459. Replace(cmdstr,'$STATIC',StaticStr);
  460. Replace(cmdstr,'$STRIP',StripStr);
  461. Replace(cmdstr,'$GCSECTIONS',GCSectionsStr);
  462. Replace(cmdstr,'$DYNLINK',DynLinkStr);
  463. success:=DoExec(FindUtil(utilsprefix+BinStr),CmdStr,true,LdSupportsNoResponseFile);
  464. { Remove ReponseFile }
  465. if (success) and not(cs_link_extern in aktglobalswitches) then
  466. RemoveFile(outputexedir+Info.ResName);
  467. MakeExecutable:=success; { otherwise a recursive call to link method }
  468. end;
  469. Function TLinkerBSD.MakeSharedLibrary:boolean;
  470. var
  471. InitStr,
  472. FiniStr,
  473. SoNameStr : string[80];
  474. binstr : String;
  475. cmdstr : TCmdStr;
  476. success : boolean;
  477. begin
  478. MakeSharedLibrary:=false;
  479. if not(cs_link_extern in aktglobalswitches) then
  480. Message1(exec_i_linking,current_module.sharedlibfilename^);
  481. { Write used files and libraries }
  482. WriteResponseFile(true);
  483. InitStr:='-init FPC_LIB_START';
  484. FiniStr:='-fini FPC_LIB_EXIT';
  485. SoNameStr:='-soname '+SplitFileName(current_module.sharedlibfilename^);
  486. { Call linker }
  487. SplitBinCmd(Info.DllCmd[1],binstr,cmdstr);
  488. Replace(cmdstr,'$EXE',maybequoted(current_module.sharedlibfilename^));
  489. Replace(cmdstr,'$OPT',Info.ExtraOptions);
  490. Replace(cmdstr,'$RES',maybequoted(outputexedir+Info.ResName));
  491. Replace(cmdstr,'$INIT',InitStr);
  492. Replace(cmdstr,'$FINI',FiniStr);
  493. Replace(cmdstr,'$SONAME',SoNameStr);
  494. success:=DoExec(FindUtil(utilsprefix+binstr),cmdstr,true,false);
  495. { Strip the library ? }
  496. if success and (cs_link_strip in aktglobalswitches) then
  497. begin
  498. SplitBinCmd(Info.DllCmd[2],binstr,cmdstr);
  499. Replace(cmdstr,'$EXE',maybequoted(current_module.sharedlibfilename^));
  500. success:=DoExec(FindUtil(utilsprefix+binstr),cmdstr,true,false);
  501. end;
  502. { Remove ReponseFile }
  503. if (success) and not(cs_link_extern in aktglobalswitches) then
  504. RemoveFile(outputexedir+Info.ResName);
  505. MakeSharedLibrary:=success; { otherwise a recursive call to link method }
  506. end;
  507. {*****************************************************************************
  508. Initialize
  509. *****************************************************************************}
  510. initialization
  511. {$ifdef x86_64}
  512. RegisterExternalLinker(system_x86_64_FreeBSD_info,TLinkerBSD);
  513. RegisterImport(system_x86_64_freebsd,timportlibbsd);
  514. RegisterExport(system_x86_64_freebsd,texportlibbsd);
  515. RegisterTarget(system_x86_64_freebsd_info);
  516. {$endif}
  517. {$ifdef i386}
  518. RegisterExternalLinker(system_i386_FreeBSD_info,TLinkerBSD);
  519. RegisterExternalLinker(system_i386_NetBSD_info,TLinkerBSD);
  520. RegisterExternalLinker(system_i386_OpenBSD_info,TLinkerBSD);
  521. RegisterImport(system_i386_freebsd,timportlibbsd);
  522. RegisterExport(system_i386_freebsd,texportlibbsd);
  523. RegisterTarget(system_i386_freebsd_info);
  524. RegisterImport(system_i386_netbsd,timportlibbsd);
  525. RegisterExport(system_i386_netbsd,texportlibbsd);
  526. RegisterTarget(system_i386_netbsd_info);
  527. RegisterImport(system_i386_openbsd,timportlibbsd);
  528. RegisterExport(system_i386_openbsd,texportlibbsd);
  529. RegisterTarget(system_i386_openbsd_info);
  530. {$endif i386}
  531. {$ifdef m68k}
  532. // RegisterExternalLinker(system_m68k_FreeBSD_info,TLinkerBSD);
  533. RegisterExternalLinker(system_m68k_NetBSD_info,TLinkerBSD);
  534. RegisterImport(system_m68k_netbsd,timportlibbsd);
  535. RegisterExport(system_m68k_netbsd,texportlibbsd);
  536. RegisterTarget(system_m68k_netbsd_info);
  537. {$endif m68k}
  538. {$ifdef powerpc}
  539. // RegisterExternalLinker(system_m68k_FreeBSD_info,TLinkerBSD);
  540. RegisterExternalLinker(system_powerpc_darwin_info,TLinkerBSD);
  541. RegisterImport(system_powerpc_darwin,timportlibdarwin);
  542. RegisterExport(system_powerpc_darwin,texportlibbsd);
  543. RegisterTarget(system_powerpc_darwin_info);
  544. RegisterExternalLinker(system_powerpc_netbsd_info,TLinkerBSD);
  545. RegisterImport(system_powerpc_netbsd,timportlibbsd);
  546. RegisterExport(system_powerpc_netbsd,texportlibbsd);
  547. RegisterTarget(system_powerpc_netbsd_info);
  548. {$endif powerpc}
  549. end.