i_android.pas 15 KB

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