i_android.pas 15 KB

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