i_haiku.pas 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  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];
  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. );
  103. const
  104. system_x86_64_haiku_info : tsysteminfo =
  105. (
  106. system : system_x86_64_Haiku;
  107. name : 'Haiku for x86_64';
  108. shortname : 'Haiku';
  109. flags : [tf_under_development,tf_needs_symbol_size,tf_files_case_sensitive,
  110. tf_pic_default,tf_library_needs_pic,tf_smartlink_sections,
  111. tf_has_winlike_resources];
  112. cpu : cpu_x86_64;
  113. unit_env : 'HAIKUUNITS';
  114. extradefines : 'BEOS;UNIX;HASUNIX';
  115. exeext : '';
  116. defext : '.def';
  117. scriptext : '.sh';
  118. smartext : '.sl';
  119. unitext : '.ppu';
  120. unitlibext : '.ppl';
  121. asmext : '.s';
  122. objext : '.o';
  123. resext : '.res';
  124. resobjext : '.or';
  125. sharedlibext : '.so';
  126. staticlibext : '.a';
  127. staticlibprefix : 'libp';
  128. sharedlibprefix : 'lib';
  129. sharedClibext : '.so';
  130. staticClibext : '.a';
  131. staticClibprefix : 'lib';
  132. sharedClibprefix : 'lib';
  133. importlibprefix : 'libimp';
  134. importlibext : '.a';
  135. Cprefix : '';
  136. newline : #10;
  137. dirsep : '/';
  138. assem : as_x86_64_elf64;
  139. assemextern : as_gas;
  140. link : ld_none;
  141. linkextern : ld_haiku;
  142. ar : ar_gnu_ar;
  143. res : res_elf;
  144. dbg : dbg_dwarf2;
  145. script : script_unix;
  146. endian : endian_little;
  147. { FIXME: stuff below is copied from Linux/x64 now, could be incorrect for Haiku (KB) }
  148. alignment :
  149. (
  150. procalign : 16;
  151. loopalign : 8;
  152. jumpalign : 16;
  153. jumpalignskipmax : 10;
  154. coalescealign : 0;
  155. coalescealignskipmax: 0;
  156. constalignmin : 0;
  157. constalignmax : 16;
  158. varalignmin : 0;
  159. varalignmax : 16;
  160. localalignmin : 4;
  161. localalignmax : 16;
  162. recordalignmin : 0;
  163. recordalignmax : 16;
  164. maxCrecordalign : 16
  165. );
  166. first_parm_offset : 16;
  167. stacksize : 16 * 1024 * 1024;
  168. stackalign : 16;
  169. abi : abi_default;
  170. 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';
  171. );
  172. implementation
  173. initialization
  174. {$ifdef cpui386}
  175. {$ifdef haiku}
  176. set_source_info(system_i386_haiku_info);
  177. {$endif haiku}
  178. {$endif cpui386}
  179. {$ifdef cpux86_64}
  180. {$ifdef haiku}
  181. set_source_info(system_x86_64_haiku_info);
  182. {$endif haiku}
  183. {$endif cpux86_64}
  184. end.