i_bsd.pas 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546
  1. {
  2. Copyright (c) 1998-2002 by Peter Vreman
  3. This unit implements support information structures for FreeBSD/NetBSD
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program; if not, write to the Free Software
  14. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  15. ****************************************************************************
  16. }
  17. { This unit implements support information structures for FreeBSD/NetBSD.
  18. OpenBSD is only added for i386 for now, though it exists for most
  19. other common CPU's too}
  20. unit i_bsd;
  21. interface
  22. uses
  23. systems;
  24. const
  25. system_i386_freebsd_info : tsysteminfo =
  26. (
  27. system : system_i386_FreeBSD;
  28. name : 'FreeBSD/ELF for i386';
  29. shortname : 'FreeBSD';
  30. flags : [tf_pic_uses_got,tf_files_case_sensitive,tf_use_function_relative_addresses];
  31. cpu : cpu_i386;
  32. unit_env : 'BSDUNITS';
  33. extradefines : 'UNIX;BSD;HASUNIX';
  34. exeext : '';
  35. defext : '.def';
  36. scriptext : '.sh';
  37. smartext : '.sl';
  38. unitext : '.ppu';
  39. unitlibext : '.ppl';
  40. asmext : '.s';
  41. objext : '.o';
  42. resext : '.res';
  43. resobjext : '.or';
  44. sharedlibext : '.so';
  45. staticlibext : '.a';
  46. staticlibprefix : 'libp';
  47. sharedlibprefix : 'lib';
  48. sharedClibext : '.so';
  49. staticClibext : '.a';
  50. staticClibprefix : 'lib';
  51. sharedClibprefix : 'lib';
  52. Cprefix : '';
  53. newline : #10;
  54. dirsep : '/';
  55. assem : as_i386_elf32;
  56. assemextern : as_gas;
  57. link : nil;
  58. linkextern : nil;
  59. ar : ar_gnu_ar;
  60. res : res_none;
  61. dbg : dbg_stabs;
  62. script : script_unix;
  63. endian : endian_little;
  64. alignment :
  65. (
  66. procalign : 4;
  67. loopalign : 4;
  68. jumpalign : 0;
  69. constalignmin : 0;
  70. constalignmax : 4;
  71. varalignmin : 0;
  72. varalignmax : 4;
  73. localalignmin : 0;
  74. localalignmax : 4;
  75. recordalignmin : 0;
  76. recordalignmax : 2;
  77. maxCrecordalign : 4
  78. );
  79. first_parm_offset : 8;
  80. stacksize : 262144;
  81. abi : abi_default;
  82. );
  83. system_x86_64_freebsd_info : tsysteminfo =
  84. (
  85. system : system_x86_64_freebsd;
  86. name : 'FreeBSD for x86-64';
  87. shortname : 'FreeBSD';
  88. flags : [tf_needs_symbol_size,tf_pic_uses_got,tf_files_case_sensitive,tf_use_function_relative_addresses{,tf_smartlink_sections}];
  89. cpu : cpu_x86_64;
  90. unit_env : 'BSDUNITS';
  91. extradefines : 'UNIX;HASUNIX';
  92. exeext : '';
  93. defext : '.def';
  94. scriptext : '.sh';
  95. smartext : '.sl';
  96. unitext : '.ppu';
  97. unitlibext : '.ppl';
  98. asmext : '.s';
  99. objext : '.o';
  100. resext : '.res';
  101. resobjext : '.or';
  102. sharedlibext : '.so';
  103. staticlibext : '.a';
  104. staticlibprefix : 'libp';
  105. sharedlibprefix : 'lib';
  106. sharedClibext : '.so';
  107. staticClibext : '.a';
  108. staticClibprefix : 'lib';
  109. sharedClibprefix : 'lib';
  110. Cprefix : '';
  111. newline : #10;
  112. dirsep : '/';
  113. assem : as_gas;
  114. assemextern : as_gas;
  115. link : nil;
  116. linkextern : nil;
  117. ar : ar_gnu_ar;
  118. res : res_none;
  119. dbg : dbg_stabs;
  120. script : script_unix;
  121. endian : endian_little;
  122. alignment :
  123. (
  124. procalign : 8;
  125. loopalign : 4;
  126. jumpalign : 0;
  127. constalignmin : 0;
  128. constalignmax : 8;
  129. varalignmin : 0;
  130. varalignmax : 8;
  131. localalignmin : 4;
  132. localalignmax : 8;
  133. recordalignmin : 0;
  134. recordalignmax : 8;
  135. maxCrecordalign : 8
  136. );
  137. first_parm_offset : 16;
  138. stacksize : 256*1024;
  139. abi : abi_default;
  140. );
  141. system_i386_netbsd_info : tsysteminfo =
  142. (
  143. system : system_i386_NetBSD;
  144. name : 'NetBSD for i386';
  145. shortname : 'NetBSD';
  146. flags : [tf_under_development,tf_files_case_sensitive,tf_use_function_relative_addresses];
  147. cpu : cpu_i386;
  148. unit_env : 'BSDUNITS';
  149. extradefines : 'UNIX;BSD;HASUNIX';
  150. exeext : '';
  151. defext : '.def';
  152. scriptext : '.sh';
  153. smartext : '.sl';
  154. unitext : '.ppu';
  155. unitlibext : '.ppl';
  156. asmext : '.s';
  157. objext : '.o';
  158. resext : '.res';
  159. resobjext : '.or';
  160. sharedlibext : '.so';
  161. staticlibext : '.a';
  162. staticlibprefix : 'libp';
  163. sharedlibprefix : 'lib';
  164. sharedClibext : '.so';
  165. staticClibext : '.a';
  166. staticClibprefix : 'lib';
  167. sharedClibprefix : 'lib';
  168. Cprefix : '_';
  169. newline : #10;
  170. dirsep : '/';
  171. assem : as_gas;
  172. assemextern : as_gas;
  173. link : nil;
  174. linkextern : nil;
  175. ar : ar_gnu_ar;
  176. res : res_none;
  177. dbg : dbg_stabs;
  178. script : script_unix;
  179. endian : endian_little;
  180. alignment :
  181. (
  182. procalign : 4;
  183. loopalign : 4;
  184. jumpalign : 0;
  185. constalignmin : 0;
  186. constalignmax : 1;
  187. varalignmin : 0;
  188. varalignmax : 1;
  189. localalignmin : 0;
  190. localalignmax : 1;
  191. recordalignmin : 0;
  192. recordalignmax : 2;
  193. maxCrecordalign : 4
  194. );
  195. first_parm_offset : 8;
  196. stacksize : 262144;
  197. abi : abi_default;
  198. );
  199. system_i386_openbsd_info : tsysteminfo =
  200. (
  201. system : system_i386_OpenBSD;
  202. name : 'OpenBSD for i386';
  203. shortname : 'OpenBSD';
  204. flags : [tf_under_development,tf_files_case_sensitive,tf_use_function_relative_addresses];
  205. cpu : cpu_i386;
  206. unit_env : 'BSDUNITS';
  207. extradefines : 'UNIX;BSD;HASUNIX';
  208. exeext : '';
  209. defext : '.def';
  210. scriptext : '.sh';
  211. smartext : '.sl';
  212. unitext : '.ppu';
  213. unitlibext : '.ppl';
  214. asmext : '.s';
  215. objext : '.o';
  216. resext : '.res';
  217. resobjext : '.or';
  218. sharedlibext : '.so';
  219. staticlibext : '.a';
  220. staticlibprefix : 'libp';
  221. sharedlibprefix : 'lib';
  222. sharedClibext : '.so';
  223. staticClibext : '.a';
  224. staticClibprefix : 'lib';
  225. sharedClibprefix : 'lib';
  226. Cprefix : '_';
  227. newline : #10;
  228. dirsep : '/';
  229. assem : as_gas;
  230. assemextern : as_gas;
  231. link : nil;
  232. linkextern : nil;
  233. ar : ar_gnu_ar;
  234. res : res_none;
  235. dbg : dbg_stabs;
  236. script : script_unix;
  237. endian : endian_little;
  238. alignment :
  239. (
  240. procalign : 4;
  241. loopalign : 4;
  242. jumpalign : 0;
  243. constalignmin : 0;
  244. constalignmax : 1;
  245. varalignmin : 0;
  246. varalignmax : 1;
  247. localalignmin : 0;
  248. localalignmax : 1;
  249. recordalignmin : 0;
  250. recordalignmax : 2;
  251. maxCrecordalign : 4
  252. );
  253. first_parm_offset : 8;
  254. stacksize : 262144;
  255. abi : abi_default;
  256. );
  257. system_m68k_netbsd_info : tsysteminfo =
  258. (
  259. system : system_m68k_NetBSD;
  260. name : 'NetBSD for m68k';
  261. shortname : 'NetBSD';
  262. flags : [tf_under_development,tf_files_case_sensitive,tf_use_function_relative_addresses];
  263. cpu : cpu_m68k;
  264. unit_env : 'BSDUNITS';
  265. extradefines : 'UNIX;BSD;HASUNIX';
  266. exeext : '';
  267. defext : '.def';
  268. scriptext : '.sh';
  269. smartext : '.sl';
  270. unitext : '.ppu';
  271. unitlibext : '.ppl';
  272. asmext : '.s';
  273. objext : '.o';
  274. resext : '.res';
  275. resobjext : '.or';
  276. sharedlibext : '.so';
  277. staticlibext : '.a';
  278. staticlibprefix : 'libp';
  279. sharedlibprefix : 'lib';
  280. sharedClibext : '.so';
  281. staticClibext : '.a';
  282. staticClibprefix : 'lib';
  283. sharedClibprefix : 'lib';
  284. Cprefix : '';
  285. newline : #10;
  286. dirsep : '/';
  287. assem : as_gas;
  288. assemextern : as_gas;
  289. link : nil;
  290. linkextern : nil;
  291. ar : ar_gnu_ar;
  292. res : res_none;
  293. dbg : dbg_stabs;
  294. script : script_unix;
  295. endian : endian_big;
  296. alignment :
  297. (
  298. procalign : 4;
  299. loopalign : 4;
  300. jumpalign : 0;
  301. constalignmin : 0;
  302. constalignmax : 1;
  303. varalignmin : 0;
  304. varalignmax : 1;
  305. localalignmin : 0;
  306. localalignmax : 1;
  307. recordalignmin : 0;
  308. recordalignmax : 2;
  309. maxCrecordalign : 4
  310. );
  311. first_parm_offset : 8;
  312. stacksize : 262144;
  313. abi : abi_default;
  314. );
  315. system_powerpc_netbsd_info : tsysteminfo =
  316. (
  317. system : system_powerpc_netbsd;
  318. name : 'NetBSD for PowerPC';
  319. shortname : 'NetBSD';
  320. flags : [tf_under_development,tf_files_case_sensitive,tf_use_function_relative_addresses];
  321. cpu : cpu_powerpc;
  322. unit_env : '';
  323. extradefines : 'UNIX;BSD;HASUNIX';
  324. exeext : '';
  325. defext : '.def';
  326. scriptext : '.sh';
  327. smartext : '.sl';
  328. unitext : '.ppu';
  329. unitlibext : '.ppl';
  330. asmext : '.s';
  331. objext : '.o';
  332. resext : '.res';
  333. resobjext : '.or';
  334. sharedlibext : '.so';
  335. staticlibext : '.s';
  336. staticlibprefix : 'libp';
  337. sharedlibprefix : 'lib';
  338. sharedClibext : '.so';
  339. staticClibext : '.a';
  340. staticClibprefix : 'lib';
  341. sharedClibprefix : 'lib';
  342. Cprefix : '';
  343. newline : #10;
  344. dirsep : '/';
  345. assem : as_gas;
  346. assemextern : as_gas;
  347. link : nil;
  348. linkextern : nil;
  349. ar : ar_gnu_ar;
  350. res : res_none;
  351. dbg : dbg_stabs;
  352. script : script_unix;
  353. endian : endian_big;
  354. alignment :
  355. (
  356. procalign : 4;
  357. loopalign : 4;
  358. jumpalign : 0;
  359. constalignmin : 0;
  360. constalignmax : 4;
  361. varalignmin : 0;
  362. varalignmax : 4;
  363. localalignmin : 0;
  364. localalignmax : 4;
  365. recordalignmin : 0;
  366. recordalignmax : 2;
  367. maxCrecordalign : 4 // should be 8 probably
  368. );
  369. first_parm_offset : 8;
  370. stacksize : 32*1024*1024;
  371. { abi_powerpc_sysv doesn't work yet }
  372. abi : abi_powerpc_aix;
  373. );
  374. system_powerpc_darwin_info : tsysteminfo =
  375. (
  376. system : system_powerpc_darwin;
  377. name : 'Darwin for PowerPC';
  378. shortname : 'Darwin';
  379. flags : [tf_p_ext_support,tf_files_case_sensitive];
  380. cpu : cpu_powerpc;
  381. unit_env : 'BSDUNITS';
  382. extradefines : 'UNIX;BSD;HASUNIX';
  383. exeext : '';
  384. defext : '.def';
  385. scriptext : '.sh';
  386. smartext : '.sl';
  387. unitext : '.ppu';
  388. unitlibext : '.ppl';
  389. asmext : '.s';
  390. objext : '.o';
  391. resext : '.res';
  392. resobjext : '.or';
  393. sharedlibext : '.dylib';
  394. staticlibext : '.a';
  395. staticlibprefix : 'libp';
  396. sharedlibprefix : 'lib';
  397. sharedClibext : '.dylib';
  398. staticClibext : '.a';
  399. staticClibprefix : 'lib';
  400. sharedClibprefix : 'lib';
  401. Cprefix : '_';
  402. newline : #10;
  403. dirsep : '/';
  404. assem : as_darwin;
  405. assemextern : as_darwin;
  406. link : nil;
  407. linkextern : nil;
  408. ar : ar_gnu_ar;
  409. res : res_none;
  410. dbg : dbg_stabs;
  411. script : script_unix;
  412. endian : endian_big;
  413. alignment :
  414. (
  415. procalign : 16;
  416. loopalign : 4;
  417. jumpalign : 0;
  418. constalignmin : 0;
  419. constalignmax : 4;
  420. varalignmin : 0;
  421. varalignmax : 4;
  422. localalignmin : 0;
  423. localalignmax : 4;
  424. recordalignmin : 0;
  425. recordalignmax : 2;
  426. maxCrecordalign : 4
  427. );
  428. first_parm_offset : 24;
  429. stacksize : 262144;
  430. abi : abi_powerpc_aix;
  431. );
  432. system_i386_darwin_info : tsysteminfo =
  433. (
  434. system : system_i386_darwin;
  435. name : 'Darwin for i386';
  436. shortname : 'Darwin';
  437. flags : [tf_p_ext_support,tf_files_case_sensitive,tf_use_function_relative_addresses];
  438. cpu : cpu_i386;
  439. unit_env : 'BSDUNITS';
  440. extradefines : 'UNIX;BSD;HASUNIX';
  441. exeext : '';
  442. defext : '.def';
  443. scriptext : '.sh';
  444. smartext : '.sl';
  445. unitext : '.ppu';
  446. unitlibext : '.ppl';
  447. asmext : '.s';
  448. objext : '.o';
  449. resext : '.res';
  450. resobjext : '.or';
  451. sharedlibext : '.dylib';
  452. staticlibext : '.a';
  453. staticlibprefix : 'libp';
  454. sharedlibprefix : 'lib';
  455. sharedClibext : '.dylib';
  456. staticClibext : '.a';
  457. staticClibprefix : 'lib';
  458. sharedClibprefix : 'lib';
  459. Cprefix : '_';
  460. newline : #10;
  461. dirsep : '/';
  462. assem : as_darwin;
  463. assemextern : as_darwin;
  464. link : nil;
  465. linkextern : nil;
  466. ar : ar_gnu_ar;
  467. res : res_none;
  468. dbg : dbg_stabs;
  469. script : script_unix;
  470. endian : endian_big;
  471. alignment :
  472. (
  473. procalign : 16;
  474. loopalign : 4;
  475. jumpalign : 0;
  476. constalignmin : 0;
  477. constalignmax : 4;
  478. varalignmin : 0;
  479. varalignmax : 4;
  480. localalignmin : 0;
  481. localalignmax : 4;
  482. recordalignmin : 0;
  483. recordalignmax : 16;
  484. maxCrecordalign : 16
  485. );
  486. first_parm_offset : 8;
  487. stacksize : 262144;
  488. abi : abi_default;
  489. );
  490. implementation
  491. initialization
  492. {$ifdef cpu86}
  493. {$ifdef FreeBSD}
  494. set_source_info(system_i386_FreeBSD_info);
  495. {$endif}
  496. {$ifdef NetBSD}
  497. set_source_info(system_i386_NetBSD_info);
  498. {$endif}
  499. {$ifdef OpenBSD}
  500. set_source_info(system_i386_NetBSD_info);
  501. {$endif}
  502. {$ifdef Darwin}
  503. set_source_info(system_i386_Darwin_info);
  504. {$endif Darwin}
  505. {$endif cpu86}
  506. {$ifdef cpux86_64}
  507. {$ifdef FreeBSD}
  508. set_source_info(system_x86_64_FreeBSD_info);
  509. {$endif}
  510. {$endif}
  511. {$ifdef cpu68}
  512. {$ifdef NetBSD}
  513. set_source_info(system_m68k_NetBSD_info);
  514. {$endif NetBSD}
  515. {$endif cpu68}
  516. {$ifdef cpupowerpc}
  517. {$ifdef Darwin}
  518. set_source_info(system_powerpc_darwin_info);
  519. {$endif Darwin}
  520. {$ifdef NetBSD}
  521. set_source_info(system_powerpc_netbsd_info);
  522. {$endif}
  523. {$endif cpu68}
  524. end.