i_haiku.pas 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. {
  2. Copyright (c) 1998-2002 by Peter Vreman
  3. Copyright (c) 2008-2008 by Olivier Coursière
  4. This unit implements support information structures for Haiku
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  16. ****************************************************************************
  17. }
  18. { This unit implements support information structures for Haiku. }
  19. unit i_haiku;
  20. {$i fpcdefs.inc}
  21. interface
  22. uses
  23. systems;
  24. const
  25. system_i386_haiku_info : tsysteminfo =
  26. (
  27. system : system_i386_Haiku;
  28. name : 'Haiku for i386';
  29. shortname : 'Haiku';
  30. flags : [tf_under_development,tf_needs_symbol_size,tf_files_case_sensitive,
  31. tf_pic_default,tf_pic_uses_got,tf_library_needs_pic,
  32. tf_smartlink_sections,tf_has_winlike_resources,tf_supports_hidden_symbols];
  33. cpu : cpu_i386;
  34. unit_env : 'HAIKUUNITS';
  35. extradefines : 'BEOS;UNIX;HASUNIX';
  36. exeext : '';
  37. defext : '.def';
  38. scriptext : '.sh';
  39. smartext : '.sl';
  40. unitext : '.ppu';
  41. unitlibext : '.ppl';
  42. asmext : '.s';
  43. objext : '.o';
  44. resext : '.res';
  45. resobjext : '.or';
  46. sharedlibext : '.so';
  47. staticlibext : '.a';
  48. staticlibprefix : 'libp';
  49. sharedlibprefix : 'lib';
  50. sharedClibext : '.so';
  51. staticClibext : '.a';
  52. staticClibprefix : 'lib';
  53. sharedClibprefix : 'lib';
  54. importlibprefix : 'libimp';
  55. importlibext : '.a';
  56. Cprefix : '';
  57. newline : #10;
  58. dirsep : '/';
  59. assem : as_i386_elf32;
  60. assemextern : as_gas;
  61. link : ld_none;
  62. linkextern : ld_haiku;
  63. ar : ar_gnu_ar;
  64. res : res_elf;
  65. dbg : dbg_stabs;
  66. script : script_unix;
  67. endian : endian_little;
  68. alignment :
  69. (
  70. procalign : 4;
  71. loopalign : 4;
  72. jumpalign : 0;
  73. jumpalignskipmax : 0;
  74. coalescealign : 0;
  75. coalescealignskipmax: 0;
  76. constalignmin : 0;
  77. constalignmax : 4;
  78. varalignmin : 0;
  79. varalignmax : 4;
  80. localalignmin : 0;
  81. localalignmax : 4;
  82. recordalignmin : 0;
  83. recordalignmax : 2;
  84. maxCrecordalign : 4
  85. );
  86. first_parm_offset : 8;
  87. { Stack size used to be 256 K under BeOS. So, it was the value
  88. used in previous version of FPC for BeOS (but lost in the road
  89. to 2.* ;-).
  90. According to buildtools/gcc/gcc/config/i386/beos-elf.h in the
  91. Haiku's repository, this value was increased to 1Mb since r4.1b3.
  92. Under R5, this value is even greater. listarea report a default
  93. size of 16 Mb for the user stack of the main thread.
  94. People who still use BeOS nowadays should use R5 (or Haiku),
  95. so i use this new value.
  96. }
  97. stacksize : 16 * 1024 * 1024;
  98. stackalign : 4;
  99. abi : abi_default;
  100. { note: default LLVM stack alignment is 16 bytes for this target }
  101. llvmdatalayout : 'e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32-S32';
  102. mos6502page0alloc : [];
  103. );
  104. const
  105. system_x86_64_haiku_info : tsysteminfo =
  106. (
  107. system : system_x86_64_Haiku;
  108. name : 'Haiku for x86_64';
  109. shortname : 'Haiku';
  110. flags : [tf_under_development,tf_needs_symbol_size,tf_files_case_sensitive,
  111. tf_pic_default,tf_library_needs_pic,tf_smartlink_sections,
  112. tf_has_winlike_resources,tf_supports_hidden_symbols];
  113. cpu : cpu_x86_64;
  114. unit_env : 'HAIKUUNITS';
  115. extradefines : 'BEOS;UNIX;HASUNIX';
  116. exeext : '';
  117. defext : '.def';
  118. scriptext : '.sh';
  119. smartext : '.sl';
  120. unitext : '.ppu';
  121. unitlibext : '.ppl';
  122. asmext : '.s';
  123. objext : '.o';
  124. resext : '.res';
  125. resobjext : '.or';
  126. sharedlibext : '.so';
  127. staticlibext : '.a';
  128. staticlibprefix : 'libp';
  129. sharedlibprefix : 'lib';
  130. sharedClibext : '.so';
  131. staticClibext : '.a';
  132. staticClibprefix : 'lib';
  133. sharedClibprefix : 'lib';
  134. importlibprefix : 'libimp';
  135. importlibext : '.a';
  136. Cprefix : '';
  137. newline : #10;
  138. dirsep : '/';
  139. assem : as_x86_64_elf64;
  140. assemextern : as_gas;
  141. link : ld_none;
  142. linkextern : ld_haiku;
  143. ar : ar_gnu_ar;
  144. res : res_elf;
  145. dbg : dbg_dwarf2;
  146. script : script_unix;
  147. endian : endian_little;
  148. { FIXME: stuff below is copied from Linux/x64 now, could be incorrect for Haiku (KB) }
  149. alignment :
  150. (
  151. procalign : 16;
  152. loopalign : 8;
  153. jumpalign : 16;
  154. jumpalignskipmax : 10;
  155. coalescealign : 0;
  156. coalescealignskipmax: 0;
  157. constalignmin : 0;
  158. constalignmax : 16;
  159. varalignmin : 0;
  160. varalignmax : 16;
  161. localalignmin : 4;
  162. localalignmax : 16;
  163. recordalignmin : 0;
  164. recordalignmax : 16;
  165. maxCrecordalign : 16
  166. );
  167. first_parm_offset : 16;
  168. stacksize : 16 * 1024 * 1024;
  169. stackalign : 16;
  170. abi : abi_default;
  171. llvmdatalayout : 'e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128';
  172. mos6502page0alloc : [];
  173. );
  174. implementation
  175. initialization
  176. {$ifdef cpui386}
  177. {$ifdef haiku}
  178. set_source_info(system_i386_haiku_info);
  179. {$endif haiku}
  180. {$endif cpui386}
  181. {$ifdef cpux86_64}
  182. {$ifdef haiku}
  183. set_source_info(system_x86_64_haiku_info);
  184. {$endif haiku}
  185. {$endif cpux86_64}
  186. end.