i_haiku.pas 7.1 KB

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