i_android.pas 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389
  1. {
  2. Copyright (c) 1998-2012 by Peter Vreman
  3. This unit implements support information structures for Android
  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 android. }
  18. unit i_android;
  19. {$i fpcdefs.inc}
  20. interface
  21. uses
  22. systems, rescmn;
  23. const
  24. system_arm_android_info : tsysteminfo =
  25. (
  26. system : system_arm_Android;
  27. name : 'Android for ARMEL';
  28. shortname : 'Android';
  29. flags : [tf_needs_symbol_size,tf_needs_symbol_type,tf_files_case_sensitive,
  30. tf_requires_proper_alignment, tf_safecall_exceptions,
  31. tf_pic_uses_got, tf_pic_default,
  32. tf_smartlink_sections,tf_has_winlike_resources];
  33. cpu : cpu_arm;
  34. unit_env : 'ANDROIDUNITS';
  35. extradefines : 'UNIX;HASUNIX;CPUARMEL';
  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_gas;
  60. assemextern : as_gas;
  61. link : ld_none;
  62. linkextern : ld_android;
  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 : 8;
  75. varalignmin : 0;
  76. varalignmax : 8;
  77. localalignmin : 4;
  78. localalignmax : 8;
  79. recordalignmin : 0;
  80. recordalignmax : 8;
  81. maxCrecordalign : 8
  82. );
  83. first_parm_offset : 8;
  84. stacksize : 8*1024*1024;
  85. stackalign : 8;
  86. abi : abi_eabi;
  87. llvmdatalayout : 'e-p:32:32:32-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:64:128-a0:0:64-n32-S64';
  88. );
  89. system_i386_android_info : tsysteminfo =
  90. (
  91. system : system_i386_ANDROID;
  92. name : 'Android for i386';
  93. shortname : 'Android';
  94. flags : [tf_needs_symbol_size,tf_needs_symbol_type,tf_files_case_sensitive,
  95. tf_needs_dwarf_cfi,tf_has_winlike_resources,
  96. tf_pic_uses_got, tf_pic_default, tf_smartlink_sections,
  97. tf_safecall_exceptions];
  98. cpu : cpu_i386;
  99. unit_env : 'ANDROIDUNITS';
  100. extradefines : 'UNIX;HASUNIX';
  101. exeext : '';
  102. defext : '.def';
  103. scriptext : '.sh';
  104. smartext : '.sl';
  105. unitext : '.ppu';
  106. unitlibext : '.ppl';
  107. asmext : '.s';
  108. objext : '.o';
  109. resext : '.res';
  110. resobjext : '.or';
  111. sharedlibext : '.so';
  112. staticlibext : '.a';
  113. staticlibprefix : 'libp';
  114. sharedlibprefix : 'lib';
  115. sharedClibext : '.so';
  116. staticClibext : '.a';
  117. staticClibprefix : 'lib';
  118. sharedClibprefix : 'lib';
  119. importlibprefix : 'libimp';
  120. importlibext : '.a';
  121. Cprefix : '';
  122. newline : #10;
  123. dirsep : '/';
  124. assem : as_i386_elf32;
  125. assemextern : as_gas;
  126. link : ld_none;
  127. linkextern : ld_android;
  128. ar : ar_gnu_ar;
  129. res : res_elf;
  130. dbg : dbg_stabs;
  131. script : script_unix;
  132. endian : endian_little;
  133. alignment :
  134. (
  135. procalign : 16;
  136. loopalign : 4;
  137. jumpalign : 0;
  138. constalignmin : 0;
  139. constalignmax : 16;
  140. varalignmin : 0;
  141. varalignmax : 16;
  142. localalignmin : 4;
  143. localalignmax : 8;
  144. recordalignmin : 0;
  145. recordalignmax : 16;
  146. maxCrecordalign : 4
  147. );
  148. first_parm_offset : 8;
  149. stacksize : 8*1024*1024;
  150. stackalign : 16;
  151. abi : abi_default;
  152. 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-S128';
  153. );
  154. system_aarch64_android_info : tsysteminfo =
  155. (
  156. system : system_aarch64_android;
  157. name : 'Android for AArch64';
  158. shortname : 'Android';
  159. flags : [tf_needs_symbol_size,tf_needs_symbol_type,tf_files_case_sensitive,
  160. tf_requires_proper_alignment, tf_safecall_exceptions,
  161. tf_pic_uses_got, tf_pic_default,
  162. tf_smartlink_sections,tf_has_winlike_resources];
  163. cpu : cpu_aarch64;
  164. unit_env : 'ANDROIDUNITS';
  165. extradefines : 'UNIX;HASUNIX';
  166. exeext : '';
  167. defext : '.def';
  168. scriptext : '.sh';
  169. smartext : '.sl';
  170. unitext : '.ppu';
  171. unitlibext : '.ppl';
  172. asmext : '.s';
  173. objext : '.o';
  174. resext : '.res';
  175. resobjext : '.or';
  176. sharedlibext : '.so';
  177. staticlibext : '.a';
  178. staticlibprefix : 'libp';
  179. sharedlibprefix : 'lib';
  180. sharedClibext : '.so';
  181. staticClibext : '.a';
  182. staticClibprefix : 'lib';
  183. sharedClibprefix : 'lib';
  184. importlibprefix : 'libimp';
  185. importlibext : '.a';
  186. Cprefix : '';
  187. newline : #10;
  188. dirsep : '/';
  189. assem : as_gas;
  190. assemextern : as_gas;
  191. link : ld_none;
  192. linkextern : ld_android;
  193. ar : ar_gnu_ar;
  194. res : res_elf;
  195. dbg : dbg_dwarf2;
  196. script : script_unix;
  197. endian : endian_little;
  198. alignment :
  199. (
  200. procalign : 8;
  201. loopalign : 4;
  202. jumpalign : 0;
  203. constalignmin : 0;
  204. constalignmax : 16;
  205. varalignmin : 0;
  206. varalignmax : 16;
  207. localalignmin : 4;
  208. localalignmax : 16;
  209. recordalignmin : 0;
  210. recordalignmax : 16;
  211. maxCrecordalign : 16
  212. );
  213. first_parm_offset : 16;
  214. stacksize : 8*1024*1024;
  215. stackalign : 16;
  216. abi : abi_default;
  217. 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-n32:64-S128'
  218. );
  219. system_x86_64_android_info : tsysteminfo =
  220. (
  221. system : system_x86_64_android;
  222. name : 'Android for x86-64';
  223. shortname : 'Android';
  224. flags : [tf_needs_symbol_size,tf_needs_symbol_type,tf_files_case_sensitive,
  225. tf_needs_dwarf_cfi,tf_has_winlike_resources,
  226. {tf_pic_uses_got,} tf_pic_default, tf_smartlink_sections,
  227. tf_safecall_exceptions, tf_safecall_clearstack];
  228. cpu : cpu_x86_64;
  229. unit_env : 'ANDROIDUNITS';
  230. extradefines : 'UNIX;HASUNIX';
  231. exeext : '';
  232. defext : '.def';
  233. scriptext : '.sh';
  234. smartext : '.sl';
  235. unitext : '.ppu';
  236. unitlibext : '.ppl';
  237. asmext : '.s';
  238. objext : '.o';
  239. resext : '.res';
  240. resobjext : '.or';
  241. sharedlibext : '.so';
  242. staticlibext : '.a';
  243. staticlibprefix : 'libp';
  244. sharedlibprefix : 'lib';
  245. sharedClibext : '.so';
  246. staticClibext : '.a';
  247. staticClibprefix : 'lib';
  248. sharedClibprefix : 'lib';
  249. importlibprefix : 'libimp';
  250. importlibext : '.a';
  251. Cprefix : '';
  252. newline : #10;
  253. dirsep : '/';
  254. assem : as_x86_64_elf64;
  255. assemextern : as_gas;
  256. link : ld_none;
  257. linkextern : ld_android;
  258. ar : ar_gnu_ar;
  259. res : res_elf;
  260. dbg : dbg_dwarf2;
  261. script : script_unix;
  262. endian : endian_little;
  263. alignment :
  264. (
  265. procalign : 16;
  266. loopalign : 8;
  267. jumpalign : 0;
  268. constalignmin : 0;
  269. constalignmax : 16;
  270. varalignmin : 0;
  271. varalignmax : 16;
  272. localalignmin : 4;
  273. localalignmax : 16;
  274. recordalignmin : 0;
  275. recordalignmax : 16;
  276. maxCrecordalign : 16
  277. );
  278. first_parm_offset : 16;
  279. stacksize : 8*1024*1024;
  280. stackalign : 16;
  281. abi : abi_default;
  282. 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';
  283. );
  284. system_mipsel_android_info : tsysteminfo =
  285. (
  286. system : system_mipsel_android;
  287. name : 'Android for MIPSEL';
  288. shortname : 'Android';
  289. flags : [tf_needs_symbol_size,tf_needs_symbol_type,tf_files_case_sensitive,
  290. tf_requires_proper_alignment,tf_pic_default,tf_safecall_exceptions,
  291. tf_smartlink_sections,tf_has_winlike_resources];
  292. cpu : cpu_mipsel;
  293. unit_env : 'ANDROIDUNITS';
  294. extradefines : 'UNIX;HASUNIX';
  295. exeext : '';
  296. defext : '.def';
  297. scriptext : '.sh';
  298. smartext : '.sl';
  299. unitext : '.ppu';
  300. unitlibext : '.ppl';
  301. asmext : '.s';
  302. objext : '.o';
  303. resext : '.res';
  304. resobjext : '.or';
  305. sharedlibext : '.so';
  306. staticlibext : '.a';
  307. staticlibprefix : 'libp';
  308. sharedlibprefix : 'lib';
  309. sharedClibext : '.so';
  310. staticClibext : '.a';
  311. staticClibprefix : 'lib';
  312. sharedClibprefix : 'lib';
  313. importlibprefix : 'libimp';
  314. importlibext : '.a';
  315. Cprefix : '';
  316. newline : #10;
  317. dirsep : '/';
  318. assem : as_gas;
  319. assemextern : as_gas;
  320. link : ld_none;
  321. linkextern : ld_android;
  322. ar : ar_gnu_ar;
  323. res : res_elf;
  324. dbg : dbg_stabs;
  325. script : script_unix;
  326. endian : endian_little;
  327. alignment :
  328. (
  329. procalign : 4;
  330. loopalign : 4;
  331. jumpalign : 0;
  332. constalignmin : 0;
  333. constalignmax : 8;
  334. varalignmin : 0;
  335. varalignmax : 8;
  336. localalignmin : 4;
  337. localalignmax : 8;
  338. recordalignmin : 0;
  339. recordalignmax : 8;
  340. maxCrecordalign : 8
  341. );
  342. first_parm_offset : 0;
  343. stacksize : 32*1024*1024;
  344. stackalign : 8;
  345. abi : abi_default;
  346. llvmdatalayout : 'e-p:32:32:32-i1:8:8-i8:8:32-i16:16:32-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-n32-S64';
  347. );
  348. implementation
  349. initialization
  350. {$ifdef CPUI386}
  351. {$ifdef android}
  352. set_source_info(system_i386_android_info);
  353. {$endif}
  354. {$endif CPUI386}
  355. {$ifdef CPUX86_64}
  356. {$ifdef android}
  357. set_source_info(system_x86_64_android_info);
  358. {$endif}
  359. {$endif CPUX86_64}
  360. {$ifdef CPUARM}
  361. {$ifdef android}
  362. set_source_info(system_arm_android_info);
  363. {$endif android}
  364. {$endif CPUARM}
  365. {$ifdef CPUAARCH64}
  366. {$ifdef android}
  367. set_source_info(system_aarch64_android_info);
  368. {$endif android}
  369. {$endif CPUAARCH64}
  370. {$ifdef CPUMIPSEL}
  371. {$ifdef android}
  372. set_source_info(system_mipsel_android_info);
  373. {$endif android}
  374. {$endif CPUMIPSEL}
  375. end.