i_haiku.pas 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  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_smartlink_sections, tf_has_winlike_resources];
  32. cpu : cpu_i386;
  33. unit_env : 'HAIKUUNITS';
  34. extradefines : 'BEOS;UNIX;HASUNIX';
  35. exeext : '';
  36. defext : '.def';
  37. scriptext : '.sh';
  38. smartext : '.sl';
  39. unitext : '.ppu';
  40. unitlibext : '.ppl';
  41. asmext : '.s';
  42. objext : '.o';
  43. resext : '.res';
  44. resobjext : '.or';
  45. sharedlibext : '.so';
  46. staticlibext : '.a';
  47. staticlibprefix : 'libp';
  48. sharedlibprefix : 'lib';
  49. sharedClibext : '.so';
  50. staticClibext : '.a';
  51. staticClibprefix : 'lib';
  52. sharedClibprefix : 'lib';
  53. importlibprefix : 'libimp';
  54. importlibext : '.a';
  55. Cprefix : '';
  56. newline : #10;
  57. dirsep : '/';
  58. assem : as_i386_elf32;
  59. assemextern : as_gas;
  60. link : ld_none;
  61. linkextern : ld_haiku;
  62. ar : ar_gnu_ar;
  63. res : res_elf;
  64. dbg : dbg_stabs;
  65. script : script_unix;
  66. endian : endian_little;
  67. alignment :
  68. (
  69. procalign : 4;
  70. loopalign : 4;
  71. jumpalign : 0;
  72. jumpalignskipmax : 0;
  73. coalescealign : 0;
  74. coalescealignskipmax: 0;
  75. constalignmin : 0;
  76. constalignmax : 4;
  77. varalignmin : 0;
  78. varalignmax : 4;
  79. localalignmin : 0;
  80. localalignmax : 4;
  81. recordalignmin : 0;
  82. recordalignmax : 2;
  83. maxCrecordalign : 4
  84. );
  85. first_parm_offset : 8;
  86. { Stack size used to be 256 K under BeOS. So, it was the value
  87. used in previous version of FPC for BeOS (but lost in the road
  88. to 2.* ;-).
  89. According to buildtools/gcc/gcc/config/i386/beos-elf.h in the
  90. Haiku's repository, this value was increased to 1Mb since r4.1b3.
  91. Under R5, this value is even greater. listarea report a default
  92. size of 16 Mb for the user stack of the main thread.
  93. People who still use BeOS nowadays should use R5 (or Haiku),
  94. so i use this new value.
  95. }
  96. stacksize : 16 * 1024 * 1024;
  97. stackalign : 4;
  98. abi : abi_default;
  99. { note: default LLVM stack alignment is 16 bytes for this target }
  100. 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';
  101. );
  102. const
  103. system_x86_64_haiku_info : tsysteminfo =
  104. (
  105. system : system_x86_64_Haiku;
  106. name : 'Haiku for x86_64';
  107. shortname : 'Haiku';
  108. flags : [tf_under_development,tf_needs_symbol_size,tf_files_case_sensitive,
  109. tf_pic_default,tf_library_needs_pic,tf_smartlink_sections,
  110. tf_has_winlike_resources];
  111. cpu : cpu_x86_64;
  112. unit_env : 'HAIKUUNITS';
  113. extradefines : 'BEOS;UNIX;HASUNIX';
  114. exeext : '';
  115. defext : '.def';
  116. scriptext : '.sh';
  117. smartext : '.sl';
  118. unitext : '.ppu';
  119. unitlibext : '.ppl';
  120. asmext : '.s';
  121. objext : '.o';
  122. resext : '.res';
  123. resobjext : '.or';
  124. sharedlibext : '.so';
  125. staticlibext : '.a';
  126. staticlibprefix : 'libp';
  127. sharedlibprefix : 'lib';
  128. sharedClibext : '.so';
  129. staticClibext : '.a';
  130. staticClibprefix : 'lib';
  131. sharedClibprefix : 'lib';
  132. importlibprefix : 'libimp';
  133. importlibext : '.a';
  134. Cprefix : '';
  135. newline : #10;
  136. dirsep : '/';
  137. assem : as_x86_64_elf64;
  138. assemextern : as_gas;
  139. link : ld_none;
  140. linkextern : ld_haiku;
  141. ar : ar_gnu_ar;
  142. res : res_elf;
  143. dbg : dbg_stabs;
  144. script : script_unix;
  145. endian : endian_little;
  146. { FIXME: stuff below is copied from Linux/x64 now, could be incorrect for Haiku (KB) }
  147. alignment :
  148. (
  149. procalign : 16;
  150. loopalign : 8;
  151. jumpalign : 16;
  152. jumpalignskipmax : 10;
  153. coalescealign : 0;
  154. coalescealignskipmax: 0;
  155. constalignmin : 0;
  156. constalignmax : 16;
  157. varalignmin : 0;
  158. varalignmax : 16;
  159. localalignmin : 4;
  160. localalignmax : 16;
  161. recordalignmin : 0;
  162. recordalignmax : 16;
  163. maxCrecordalign : 16
  164. );
  165. first_parm_offset : 16;
  166. stacksize : 16 * 1024 * 1024;
  167. stackalign : 16;
  168. abi : abi_default;
  169. 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';
  170. );
  171. implementation
  172. initialization
  173. {$ifdef cpui386}
  174. {$ifdef haiku}
  175. set_source_info(system_i386_haiku_info);
  176. {$endif haiku}
  177. {$endif cpui386}
  178. {$ifdef cpux86_64}
  179. {$ifdef haiku}
  180. set_source_info(system_x86_64_haiku_info);
  181. {$endif haiku}
  182. {$endif cpux86_64}
  183. end.